svn commit: r330828 - user/jeff/numa/sys/kern
Jeff Roberson
jeff at FreeBSD.org
Tue Mar 13 03:54:42 UTC 2018
Author: jeff
Date: Tue Mar 13 03:54:41 2018
New Revision: 330828
URL: https://svnweb.freebsd.org/changeset/base/330828
Log:
Most of the time bufspace_adjust() shouldn't be adjusting anything. In
this case don't waste time on an expensive atomic.
Modified:
user/jeff/numa/sys/kern/vfs_bio.c
Modified: user/jeff/numa/sys/kern/vfs_bio.c
==============================================================================
--- user/jeff/numa/sys/kern/vfs_bio.c Tue Mar 13 03:53:33 2018 (r330827)
+++ user/jeff/numa/sys/kern/vfs_bio.c Tue Mar 13 03:54:41 2018 (r330828)
@@ -613,7 +613,7 @@ bufspace_adjust(struct buf *bp, int bufsize)
diff = bufsize - bp->b_bufsize;
if (diff < 0) {
atomic_subtract_long(&bd->bd_bufspace, -diff);
- } else {
+ } else if (diff > 0) {
space = atomic_fetchadd_long(&bd->bd_bufspace, diff);
/* Wake up the daemon on the transition. */
if (space < bd->bd_bufspacethresh &&
More information about the svn-src-user
mailing list