Thread (8 messages) 8 messages, 2 authors, 2015-09-22

Re: [PATCH 1/2] xfs: Add __GFP_NORETRY and __GFP_NOWARN to open-coded __GFP_NOFAIL allocations

From: Dave Chinner <david@fromorbit.com>
Date: 2015-09-20 23:12:20
Also in: linux-xfs

On Sun, Sep 20, 2015 at 04:03:13PM +0900, Tetsuo Handa wrote:
kmem_alloc(), kmem_zone_alloc() and xfs_buf_allocate_memory() are doing
open-coded __GFP_NOFAIL allocations with warning messages as a canary.
But since small !__GFP_NOFAIL allocations retry forever inside memory
allocator unless TIF_MEMDIE is set, the canary does not help even if
allocations are stalling. Thus, this patch adds __GFP_NORETRY so that
we can know possibility of allocation deadlock.

If a patchset which makes small !__GFP_NOFAIL !__GFP_FS allocations not
retry inside memory allocator is merged, warning messages by
warn_alloc_failed() will dominate warning messages by the canary
because each thread calls warn_alloc_failed() for approximately
every 2 milliseconds. Thus, this patch also adds __GFP_NOWARN so that
we won't flood kernel logs by these open-coded __GFP_NOFAIL allocations.
Please, at minimum, look at the code you are modifying. __GFP_NOWARN
is already set by both kmem_flags_convert() and xb_to_gfp(),
precisely for this reason. Any changes to the default gfp flags we
use need to be inside those wrappers - that's why they exist.

Further, xb_to_gfp() may already return just "__GFP_NORETRY |
__GFP_NOWARN", so appending them unconditionally is clearly not the
best approach.

Further, fundamentally changing the allocation behaviour of the
filesystem requires some indication of the testing and
characterisation of how the change has impacted low memory balance
and performance of the filesystem.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help