Re: svn commit: r331404 - in head: cddl/contrib/opensolaris/lib/libzpool/common/sys sys/cddl/contrib/opensolaris/uts/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/

2018-03-22 Thread Mateusz Guzik
On Fri, Mar 23, 2018 at 3:15 AM, Alexander Motin  wrote:

> Author: mav
> Date: Fri Mar 23 02:15:05 2018
> New Revision: 331404
> URL: https://svnweb.freebsd.org/changeset/base/331404
>
> Log:
>   MFV r331400: 8484 Implement aggregate sum and use for arc counters
>
>   In pursuit of improving performance on multi-core systems, we should
>   implements fanned out counters and use them to improve the performance of
>   some of the arc statistics. These stats are updated extremely frequently,
>   and can consume a significant amount of CPU time.
>
>
>
>
Due to seriously fat locks this struct:

typedef struct aggsum_bucket {
kmutex_t asc_lock;
int64_t asc_delta;
uint64_t asc_borrowed;
uint64_t asc_pad[4]; /* pad out to cache line (64 bytes) */
} aggsum_bucket_t __aligned(CACHE_LINE_SIZE);

ends up using *two* cache lines. Without asc_pad the size is 48 bytes.
asc_pad adds 4 * 8 = 32 which pushes it to the next line for no good reason.

That said, I suggest #ifndefing it the field.

-- 
Mateusz Guzik 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r331404 - in head: cddl/contrib/opensolaris/lib/libzpool/common/sys sys/cddl/contrib/opensolaris/uts/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/u...

2018-03-22 Thread Alexander Motin
Author: mav
Date: Fri Mar 23 02:15:05 2018
New Revision: 331404
URL: https://svnweb.freebsd.org/changeset/base/331404

Log:
  MFV r331400: 8484 Implement aggregate sum and use for arc counters
  
  In pursuit of improving performance on multi-core systems, we should
  implements fanned out counters and use them to improve the performance of
  some of the arc statistics. These stats are updated extremely frequently,
  and can consume a significant amount of CPU time.
  
  Reviewed by: Pavel Zakharov 
  Reviewed by: Matthew Ahrens 
  Approved by: Dan McDonald 
  Author: Paul Dagnelie 

Added:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/THIRDPARTYLICENSE.cityhash
 - copied unchanged from r331400, 
vendor-sys/illumos/dist/uts/common/fs/zfs/THIRDPARTYLICENSE.cityhash
  
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/THIRDPARTYLICENSE.cityhash.descrip
 - copied unchanged from r331400, 
vendor-sys/illumos/dist/uts/common/fs/zfs/THIRDPARTYLICENSE.cityhash.descrip
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/aggsum.c
 - copied unchanged from r331400, 
vendor-sys/illumos/dist/uts/common/fs/zfs/aggsum.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/cityhash.c
 - copied unchanged from r331400, 
vendor-sys/illumos/dist/uts/common/fs/zfs/cityhash.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/aggsum.h
 - copied, changed from r331400, 
vendor-sys/illumos/dist/uts/common/fs/zfs/sys/aggsum.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/cityhash.h
 - copied unchanged from r331400, 
vendor-sys/illumos/dist/uts/common/fs/zfs/sys/cityhash.h
Modified:
  head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
  head/sys/cddl/contrib/opensolaris/uts/common/Makefile.files
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h
  head/sys/conf/files
Directory Properties:
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
==
--- head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Fri Mar 
23 01:43:27 2018(r331403)
+++ head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Fri Mar 
23 02:15:05 2018(r331404)
@@ -559,6 +559,7 @@ extern void delay(clock_t ticks);
} while (0);
 
 #definemax_ncpus   64
+#defineboot_ncpus  (sysconf(_SC_NPROCESSORS_ONLN))
 
 #defineminclsyspri 60
 #definemaxclsyspri 99

Modified: head/sys/cddl/contrib/opensolaris/uts/common/Makefile.files
==
--- head/sys/cddl/contrib/opensolaris/uts/common/Makefile.files Fri Mar 23 
01:43:27 2018(r331403)
+++ head/sys/cddl/contrib/opensolaris/uts/common/Makefile.files Fri Mar 23 
02:15:05 2018(r331404)
@@ -63,12 +63,14 @@ LUA_OBJS += \
 
 ZFS_COMMON_OBJS += \
abd.o   \
+   aggsum.o\
arc.o   \
bplist.o\
blkptr.o\
bpobj.o \
bptree.o\
bqueue.o\
+   cityhash.o  \
dbuf.o  \
ddt.o   \
ddt_zap.o   \

Copied: 
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/THIRDPARTYLICENSE.cityhash 
(from r331400, 
vendor-sys/illumos/dist/uts/common/fs/zfs/THIRDPARTYLICENSE.cityhash)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ 
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/THIRDPARTYLICENSE.cityhash  
Fri Mar 23 02:15:05 2018(r331404, copy of r331400, 
vendor-sys/illumos/dist/uts/common/fs/zfs/THIRDPARTYLICENSE.cityhash)
@@ -0,0 +1,19 @@
+Copyright (c) 2011 Google, Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND