mm: make page ref count overflow check tighter and more explicit
We have a VM_BUG_ON() to check that the page reference count doesn't
underflow (or get close to overflow) by checking the sign of the count.
That's all fine, but we actually want to allow people to use a "get page
ref unless it's already very high" helper function, and we want that one
to use the sign of the page ref (without triggering this VM_BUG_ON).
Change the VM_BUG_ON to only check for small underflows (or _very_ close
to overflowing), and ignore overflows which have strayed into negative
Acked-by: Matthew Wilcox <firstname.lastname@example.org>
Cc: Jann Horn <email@example.com>
Signed-off-by: Linus Torvalds <firstname.lastname@example.org>
1 file changed