Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[buildbot, proof-of-concept (*2)/testing, #2129 + new (tracepoint multilist) #3115], <feedback, comments> #3216

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
cf1f40f
Add compatibility layer for {kmap,kunmap}_atomic
tuxoko Feb 11, 2015
19b0589
Introduce ABD: linear/scatter dual typed buffer for ARC
tuxoko Feb 11, 2015
2750a18
Modify/Add incremental checksum function for abd_iterate_rfunc
tuxoko Feb 11, 2015
4ef44f3
Use abd_t in arc.h, ddt.h, dmu.h and zio.h
tuxoko Feb 11, 2015
d5e9ab8
Convert zio_checksum to ABD version
tuxoko Feb 11, 2015
8180345
Handle abd_t in arc.c, bpobj.c and bptree.c
tuxoko Feb 11, 2015
d001d87
Handle abd_t in dbuf.c, ddt.c, dmu*.c
tuxoko Feb 11, 2015
4812c90
Handle abd_t in dnode*.c, dsl_*.c
tuxoko Feb 11, 2015
a4f28b9
Handle abd_t in sa_impl.h, sa.c, space_map.c, spa.c, spa_history.c an…
tuxoko Feb 11, 2015
7364eac
Handle abd_t in zap*.c, zfs_fuid.c, zfs_sa.c and zfs_vnops.c
tuxoko Feb 11, 2015
76f2c36
Handle abd_t in zio.c
tuxoko Feb 11, 2015
5badaba
Handle abd_t in vdev*.c sans vdev_raidz.c
tuxoko Feb 11, 2015
d0efe9d
Handle abd_t in vdev_raidz.c
tuxoko Feb 11, 2015
3fc3174
Handle ABD in ztest and zdb
tuxoko Feb 11, 2015
9442025
Enable ABD
tuxoko Feb 11, 2015
8e99d78
Try to fix build error
tuxoko Feb 17, 2015
e19172f
attempt to make DEBUG build (buildbots) happy:
kernelOfTruth Mar 23, 2015
70a292b
Revert "fix l2arc compression buffers leak"
dweeezil Feb 16, 2015
707d6dc
Revert "Add ddt, ddt_entry, and l2arc_hdr caches"
dweeezil Jan 24, 2015
115a8c2
Illumos 5369 - arc flags should be an enum
grwilson Dec 6, 2014
b0258ca
Illumos - 5408 managing ZFS cache devices requires lots of RAM
cwill Dec 30, 2014
2130841
5497 lock contention on arcs_mtx
Jan 13, 2015
8f2267a
Merge branch 'zfs_master_03.04.2015' into zfs_master_20.03.2015_2129+…
kernelOfTruth Apr 4, 2015
6eba24c
Merge branch 'zfs_master_28.04.2015' into zfs_master_20.03.2015_2129+…
kernelOfTruth Apr 30, 2015
87b8ecc
applying fix for spinlock found in https://github.com/zfsonlinux/zfs/…
tuxoko Apr 30, 2015
c99dfad
[test port] 5701 zpool list reports incorrect "alloc" value for cache…
May 15, 2015
19b6408
[test] commenting out
kernelOfTruth May 15, 2015
a7683f5
[RFC, discussion, feedback] account for ashift when choosing buffers …
avg-I May 28, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions cmd/arcstat/arcstat.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
"mrug": [4, 1000, "MRU Ghost List hits per second"],
"eskip": [5, 1000, "evict_skip per second"],
"mtxmis": [6, 1000, "mutex_miss per second"],
"rmis": [4, 1000, "recycle_miss per second"],
"dread": [5, 1000, "Demand accesses per second"],
"pread": [5, 1000, "Prefetch accesses per second"],
"l2hits": [6, 1000, "L2ARC hits per second"],
Expand Down Expand Up @@ -406,7 +405,6 @@ def calculate():
v["mrug"] = d["mru_ghost_hits"] / sint
v["mfug"] = d["mfu_ghost_hits"] / sint
v["eskip"] = d["evict_skip"] / sint
v["rmis"] = d["recycle_miss"] / sint
v["mtxmis"] = d["mutex_miss"] / sint

if l2exist:
Expand Down
23 changes: 13 additions & 10 deletions cmd/zdb/zdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1171,7 +1171,7 @@ visit_indirect(spa_t *spa, const dnode_phys_t *dnp,
print_indirect(bp, zb, dnp);

if (BP_GET_LEVEL(bp) > 0 && !BP_IS_HOLE(bp)) {
uint32_t flags = ARC_WAIT;
arc_flags_t flags = ARC_FLAG_WAIT;
int i;
blkptr_t *cbp;
int epb = BP_GET_LSIZE(bp) >> SPA_BLKPTRSHIFT;
Expand All @@ -1185,7 +1185,7 @@ visit_indirect(spa_t *spa, const dnode_phys_t *dnp,
ASSERT(buf->b_data);

/* recursively visit blocks below this */
cbp = buf->b_data;
cbp = ABD_TO_BUF(buf->b_data);
for (i = 0; i < epb; i++, cbp++) {
zbookmark_phys_t czb;

Expand Down Expand Up @@ -1357,7 +1357,7 @@ dump_bptree(objset_t *os, uint64_t obj, char *name)
return;

VERIFY3U(0, ==, dmu_bonus_hold(os, obj, FTAG, &db));
bt = db->db_data;
bt = ABD_TO_BUF(db->db_data);
zdb_nicenum(bt->bt_bytes, bytes);
(void) printf("\n %s: %llu datasets, %s\n",
name, (unsigned long long)(bt->bt_end - bt->bt_begin), bytes);
Expand Down Expand Up @@ -1807,7 +1807,7 @@ dump_object(objset_t *os, uint64_t object, int verbosity, int *print_header)
if (error)
fatal("dmu_bonus_hold(%llu) failed, errno %u",
object, error);
bonus = db->db_data;
bonus = ABD_TO_BUF(db->db_data);
bsize = db->db_size;
dn = DB_DNODE((dmu_buf_impl_t *)db);
}
Expand Down Expand Up @@ -2030,7 +2030,7 @@ dump_config(spa_t *spa)
spa->spa_config_object, FTAG, &db);

if (error == 0) {
nvsize = *(uint64_t *)db->db_data;
nvsize = *(uint64_t *)ABD_TO_BUF(db->db_data);
dmu_buf_rele(db, FTAG);

(void) printf("\nMOS Configuration:\n");
Expand Down Expand Up @@ -2317,7 +2317,7 @@ zdb_blkptr_done(zio_t *zio)
zdb_cb_t *zcb = zio->io_private;
zbookmark_phys_t *zb = &zio->io_bookmark;

zio_data_buf_free(zio->io_data, zio->io_size);
abd_free(zio->io_data, zio->io_size);

mutex_enter(&spa->spa_scrub_lock);
spa->spa_scrub_inflight--;
Expand Down Expand Up @@ -2380,7 +2380,7 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
if (!BP_IS_EMBEDDED(bp) &&
(dump_opt['c'] > 1 || (dump_opt['c'] && is_metadata))) {
size_t size = BP_GET_PSIZE(bp);
void *data = zio_data_buf_alloc(size);
abd_t *data = abd_alloc_linear(size);
int flags = ZIO_FLAG_CANFAIL | ZIO_FLAG_SCRUB | ZIO_FLAG_RAW;

/* If it's an intent log block, failure is expected. */
Expand Down Expand Up @@ -3143,6 +3143,7 @@ zdb_read_block(char *thing, spa_t *spa)
zio_t *zio;
vdev_t *vd;
void *pbuf, *lbuf, *buf;
abd_t *pbuf_abd;
char *s, *p, *dup, *vdev, *flagstr;
int i, error;

Expand Down Expand Up @@ -3214,6 +3215,7 @@ zdb_read_block(char *thing, spa_t *spa)
lsize = size;

pbuf = umem_alloc_aligned(SPA_MAXBLOCKSIZE, 512, UMEM_NOFAIL);
pbuf_abd = abd_get_from_buf(pbuf, SPA_MAXBLOCKSIZE);
lbuf = umem_alloc(SPA_MAXBLOCKSIZE, UMEM_NOFAIL);

BP_ZERO(bp);
Expand Down Expand Up @@ -3241,15 +3243,15 @@ zdb_read_block(char *thing, spa_t *spa)
/*
* Treat this as a normal block read.
*/
zio_nowait(zio_read(zio, spa, bp, pbuf, psize, NULL, NULL,
zio_nowait(zio_read(zio, spa, bp, pbuf_abd, psize, NULL, NULL,
ZIO_PRIORITY_SYNC_READ,
ZIO_FLAG_CANFAIL | ZIO_FLAG_RAW, NULL));
} else {
/*
* Treat this as a vdev child I/O.
*/
zio_nowait(zio_vdev_child_io(zio, bp, vd, offset, pbuf, psize,
ZIO_TYPE_READ, ZIO_PRIORITY_SYNC_READ,
zio_nowait(zio_vdev_child_io(zio, bp, vd, offset, pbuf_abd,
psize, ZIO_TYPE_READ, ZIO_PRIORITY_SYNC_READ,
ZIO_FLAG_DONT_CACHE | ZIO_FLAG_DONT_QUEUE |
ZIO_FLAG_DONT_PROPAGATE | ZIO_FLAG_DONT_RETRY |
ZIO_FLAG_CANFAIL | ZIO_FLAG_RAW, NULL, NULL));
Expand Down Expand Up @@ -3323,6 +3325,7 @@ zdb_read_block(char *thing, spa_t *spa)
zdb_dump_block(thing, buf, size, flags);

out:
abd_put(pbuf_abd);
umem_free(pbuf, SPA_MAXBLOCKSIZE);
umem_free(lbuf, SPA_MAXBLOCKSIZE);
free(dup);
Expand Down
5 changes: 4 additions & 1 deletion cmd/zdb/zdb_il.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ zil_prt_rec_write(zilog_t *zilog, int txtype, lr_write_t *lr)
blkptr_t *bp = &lr->lr_blkptr;
zbookmark_phys_t zb;
char buf[SPA_MAXBLOCKSIZE];
abd_t *abd;
int verbose = MAX(dump_opt['d'], dump_opt['i']);
int error;

Expand Down Expand Up @@ -158,9 +159,11 @@ zil_prt_rec_write(zilog_t *zilog, int txtype, lr_write_t *lr)
lr->lr_foid, ZB_ZIL_LEVEL,
lr->lr_offset / BP_GET_LSIZE(bp));

abd = abd_get_from_buf(buf, BP_GET_LSIZE(bp));
error = zio_wait(zio_read(NULL, zilog->zl_spa,
bp, buf, BP_GET_LSIZE(bp), NULL, NULL,
bp, abd, BP_GET_LSIZE(bp), NULL, NULL,
ZIO_PRIORITY_SYNC_READ, ZIO_FLAG_CANFAIL, &zb));
abd_put(abd);
if (error)
return;
data = buf;
Expand Down
44 changes: 27 additions & 17 deletions cmd/ztest/ztest.c
Original file line number Diff line number Diff line change
Expand Up @@ -1305,26 +1305,31 @@ ztest_tx_assign(dmu_tx_t *tx, uint64_t txg_how, const char *tag)
}

static void
ztest_pattern_set(void *buf, uint64_t size, uint64_t value)
ztest_pattern_set(abd_t *abd, uint64_t size, uint64_t value)
{
void *buf = abd_borrow_buf(abd, size);
uint64_t *ip = buf;
uint64_t *ip_end = (uint64_t *)((uintptr_t)buf + (uintptr_t)size);

while (ip < ip_end)
*ip++ = value;

abd_return_buf_copy(abd, buf, size);
}

#ifndef NDEBUG
static boolean_t
ztest_pattern_match(void *buf, uint64_t size, uint64_t value)
ztest_pattern_match(abd_t *abd, uint64_t size, uint64_t value)
{
void *buf = abd_borrow_buf_copy(abd, size);
uint64_t *ip = buf;
uint64_t *ip_end = (uint64_t *)((uintptr_t)buf + (uintptr_t)size);
uint64_t diff = 0;

while (ip < ip_end)
diff |= (value - *ip++);

abd_return_buf(abd, buf, size);
return (diff == 0);
}
#endif
Expand Down Expand Up @@ -1364,7 +1369,8 @@ ztest_bt_bonus(dmu_buf_t *db)
dmu_object_info_from_db(db, &doi);
ASSERT3U(doi.doi_bonus_size, <=, db->db_size);
ASSERT3U(doi.doi_bonus_size, >=, sizeof (*bt));
bt = (void *)((char *)db->db_data + doi.doi_bonus_size - sizeof (*bt));
bt = (void *)((char *)ABD_TO_BUF(db->db_data) + doi.doi_bonus_size -
sizeof (*bt));

return (bt);
}
Expand Down Expand Up @@ -1726,7 +1732,7 @@ ztest_replay_write(ztest_ds_t *zd, lr_write_t *lr, boolean_t byteswap)
if (abuf == NULL) {
dmu_write(os, lr->lr_foid, offset, length, data, tx);
} else {
bcopy(data, abuf->b_data, length);
abd_copy_from_buf(abuf->b_data, data, length);
dmu_assign_arcbuf(db, offset, abuf, tx);
}

Expand Down Expand Up @@ -4051,7 +4057,7 @@ ztest_dmu_read_write_zcopy(ztest_ds_t *zd, uint64_t id)
* assign an arcbuf to a dbuf.
*/
for (j = 0; j < s; j++) {
if (i != 5) {
if (i != 5 || chunksize < (SPA_MINBLOCKSIZE * 2)) {
bigbuf_arcbufs[j] =
dmu_request_arcbuf(bonus_db, chunksize);
} else {
Expand All @@ -4075,7 +4081,8 @@ ztest_dmu_read_write_zcopy(ztest_ds_t *zd, uint64_t id)
umem_free(packbuf, packsize);
umem_free(bigbuf, bigsize);
for (j = 0; j < s; j++) {
if (i != 5) {
if (i != 5 ||
chunksize < (SPA_MINBLOCKSIZE * 2)) {
dmu_return_arcbuf(bigbuf_arcbufs[j]);
} else {
dmu_return_arcbuf(
Expand Down Expand Up @@ -4120,24 +4127,27 @@ ztest_dmu_read_write_zcopy(ztest_ds_t *zd, uint64_t id)
}
for (off = bigoff, j = 0; j < s; j++, off += chunksize) {
dmu_buf_t *dbt;
if (i != 5) {
bcopy((caddr_t)bigbuf + (off - bigoff),
bigbuf_arcbufs[j]->b_data, chunksize);
if (i != 5 || chunksize < (SPA_MINBLOCKSIZE * 2)) {
abd_copy_from_buf(bigbuf_arcbufs[j]->b_data,
(caddr_t)bigbuf + (off - bigoff),
chunksize);
} else {
bcopy((caddr_t)bigbuf + (off - bigoff),
abd_copy_from_buf(
bigbuf_arcbufs[2 * j]->b_data,
(caddr_t)bigbuf + (off - bigoff),
chunksize / 2);
bcopy((caddr_t)bigbuf + (off - bigoff) +
chunksize / 2,

abd_copy_from_buf(
bigbuf_arcbufs[2 * j + 1]->b_data,
chunksize / 2);
(caddr_t)bigbuf + (off - bigoff) +
chunksize / 2, chunksize / 2);
}

if (i == 1) {
VERIFY(dmu_buf_hold(os, bigobj, off,
FTAG, &dbt, DMU_READ_NO_PREFETCH) == 0);
}
if (i != 5) {
if (i != 5 || chunksize < (SPA_MINBLOCKSIZE * 2)) {
dmu_assign_arcbuf(bonus_db, off,
bigbuf_arcbufs[j], tx);
} else {
Expand Down Expand Up @@ -5181,7 +5191,7 @@ ztest_ddt_repair(ztest_ds_t *zd, uint64_t id)
enum zio_checksum checksum = spa_dedup_checksum(spa);
dmu_buf_t *db;
dmu_tx_t *tx;
void *buf;
abd_t *buf;
blkptr_t blk;
int copies = 2 * ZIO_DEDUPDITTO_MIN;
int i;
Expand Down Expand Up @@ -5262,14 +5272,14 @@ ztest_ddt_repair(ztest_ds_t *zd, uint64_t id)
* Damage the block. Dedup-ditto will save us when we read it later.
*/
psize = BP_GET_PSIZE(&blk);
buf = zio_buf_alloc(psize);
buf = abd_alloc_linear(psize);
ztest_pattern_set(buf, psize, ~pattern);

(void) zio_wait(zio_rewrite(NULL, spa, 0, &blk,
buf, psize, NULL, NULL, ZIO_PRIORITY_SYNC_WRITE,
ZIO_FLAG_CANFAIL | ZIO_FLAG_INDUCE_DAMAGE, NULL));

zio_buf_free(buf, psize);
abd_free(buf, psize);

(void) rw_unlock(&ztest_name_lock);
umem_free(od, sizeof (ztest_od_t));
Expand Down
24 changes: 24 additions & 0 deletions config/kernel-kmap-atomic-args.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
dnl #
dnl # 2.6.37 API change
dnl # kmap_atomic changed from assigning hard-coded named slot to using
dnl # push/pop based dynamical allocation.
dnl #
AC_DEFUN([ZFS_AC_KERNEL_KMAP_ATOMIC_ARGS], [
AC_MSG_CHECKING([whether kmap_atomic wants 1 args])
ZFS_LINUX_TRY_COMPILE([
#include <linux/pagemap.h>

void test_kmap_atomic(void)
{
struct page page;
kmap_atomic(&page);
}
],[
],[
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_1ARG_KMAP_ATOMIC, 1,
[kmap_atomic wants 1 args])
],[
AC_MSG_RESULT(no)
])
])
1 change: 1 addition & 0 deletions config/kernel.m4
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [
ZFS_AC_KERNEL_5ARG_SGET
ZFS_AC_KERNEL_LSEEK_EXECUTE
ZFS_AC_KERNEL_VFS_ITERATE
ZFS_AC_KERNEL_KMAP_ATOMIC_ARGS

AS_IF([test "$LINUX_OBJ" != "$LINUX"], [
KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ"
Expand Down
3 changes: 2 additions & 1 deletion include/linux/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ KERNEL_H = \
$(top_srcdir)/include/linux/xattr_compat.h \
$(top_srcdir)/include/linux/vfs_compat.h \
$(top_srcdir)/include/linux/blkdev_compat.h \
$(top_srcdir)/include/linux/utsname_compat.h
$(top_srcdir)/include/linux/utsname_compat.h \
$(top_srcdir)/include/linux/kmap_compat.h

USER_H =

Expand Down
40 changes: 40 additions & 0 deletions include/linux/kmap_compat.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/

/*
* Copyright (c) 2014 by Chunwei Chen. All rights reserved.
*/

#ifndef _ZFS_KMAP_H
#define _ZFS_KMAP_H

#include <linux/highmem.h>

#ifdef HAVE_1ARG_KMAP_ATOMIC
/* 2.6.37 API change */
#define zfs_kmap_atomic(page, km_type) kmap_atomic(page)
#define zfs_kunmap_atomic(addr, km_type) kunmap_atomic(addr)
#else
#define zfs_kmap_atomic(page, km_type) kmap_atomic(page, km_type)
#define zfs_kunmap_atomic(addr, km_type) kunmap_atomic(addr, km_type)
#endif

#endif /* _ZFS_KMAP_H */
3 changes: 3 additions & 0 deletions include/sys/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ SUBDIRS = fm fs
COMMON_H = \
$(top_srcdir)/include/sys/arc.h \
$(top_srcdir)/include/sys/arc_impl.h \
$(top_srcdir)/include/sys/abd.h \
$(top_srcdir)/include/sys/avl.h \
$(top_srcdir)/include/sys/avl_impl.h \
$(top_srcdir)/include/sys/blkptr.h \
Expand Down Expand Up @@ -33,6 +34,7 @@ COMMON_H = \
$(top_srcdir)/include/sys/efi_partition.h \
$(top_srcdir)/include/sys/metaslab.h \
$(top_srcdir)/include/sys/metaslab_impl.h \
$(top_srcdir)/include/sys/multilist.h \
$(top_srcdir)/include/sys/nvpair.h \
$(top_srcdir)/include/sys/nvpair_impl.h \
$(top_srcdir)/include/sys/range_tree.h \
Expand All @@ -53,6 +55,7 @@ COMMON_H = \
$(top_srcdir)/include/sys/trace_dbuf.h \
$(top_srcdir)/include/sys/trace_dmu.h \
$(top_srcdir)/include/sys/trace_dnode.h \
$(top_srcdir)/include/sys/trace_multilist.h \
$(top_srcdir)/include/sys/trace_txg.h \
$(top_srcdir)/include/sys/trace_zil.h \
$(top_srcdir)/include/sys/trace_zrlock.h \
Expand Down
Loading