Date: Tue, 13 Mar 2018 03:54:42 +0000 (UTC) From: Jeff Roberson <jeff@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r330828 - user/jeff/numa/sys/kern Message-ID: <201803130354.w2D3sgen029754@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 &&
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803130354.w2D3sgen029754>