[Bug 223059] [patch] consider skipped 2 pages in sw_nblks and add size check before blist_alloc

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Thu Oct 19 06:08:32 UTC 2017


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=223059

--- Comment #1 from Alan Cox <alc at FreeBSD.org> ---
Testing "(sp->sw_nblks - sp->sw_used >= npages)" before every call to
blist_alloc() is of no real benefit.  In the common case, where there is
available swap space, it is added overhead, albeit a tiny amount of overhead. 
Only in the rare case, where there is no swap space available will it be of any
benefit.  But, in that case, the gain is minimal.  The hinting mechanism in the
blist code will quickly conclude that there is no available space, and return
failure.  In summary, the tiny amount of overhead in the common case is going
to outweigh the gain in the rare case.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list