* [PATCH 7/7] xfs: Don't use PF_MEMALLOC [not found] <20091117161551.3DD4.A69D9226@jp.fujitsu.com> @ 2009-11-17 7:23 ` KOSAKI Motohiro 2009-11-17 22:11 ` Dave Chinner 0 siblings, 1 reply; 4+ messages in thread From: KOSAKI Motohiro @ 2009-11-17 7:23 UTC (permalink / raw) To: LKML Cc: xfs-masters, xfs, Christoph Hellwig, linux-mm, kosaki.motohiro, linux-fsdevel, Andrew Morton Non MM subsystem must not use PF_MEMALLOC. Memory reclaim need few memory, anyone must not prevent it. Otherwise the system cause mysterious hang-up and/or OOM Killer invokation. Cc: Christoph Hellwig <hch@infradead.org> Cc: linux-fsdevel@vger.kernel.org Cc: xfs-masters@oss.sgi.com Cc: xfs@oss.sgi.com Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> --- fs/xfs/linux-2.6/xfs_buf.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c index 965df12..b9a06fc 100644 --- a/fs/xfs/linux-2.6/xfs_buf.c +++ b/fs/xfs/linux-2.6/xfs_buf.c @@ -1724,8 +1724,6 @@ xfsbufd( int count; xfs_buf_t *bp; - current->flags |= PF_MEMALLOC; - set_freezable(); do { -- 1.6.2.5 _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 7/7] xfs: Don't use PF_MEMALLOC 2009-11-17 7:23 ` [PATCH 7/7] xfs: Don't use PF_MEMALLOC KOSAKI Motohiro @ 2009-11-17 22:11 ` Dave Chinner 2009-11-18 8:56 ` KOSAKI Motohiro 0 siblings, 1 reply; 4+ messages in thread From: Dave Chinner @ 2009-11-17 22:11 UTC (permalink / raw) To: KOSAKI Motohiro Cc: xfs-masters, LKML, xfs, Christoph Hellwig, linux-mm, linux-fsdevel, Andrew Morton On Tue, Nov 17, 2009 at 04:23:43PM +0900, KOSAKI Motohiro wrote: > > Non MM subsystem must not use PF_MEMALLOC. Memory reclaim need few > memory, anyone must not prevent it. Otherwise the system cause > mysterious hang-up and/or OOM Killer invokation. The xfsbufd is a woken run by a registered memory shaker. i.e. it runs when the system needs to reclaim memory. It forceѕ the delayed write metadata buffers (of which there can be a lot) to disk so that they can be reclaimed on IO completion. This IO submission may require ѕome memory to be allocated to be able to free that memory. Hence, AFAICT the use of PF_MEMALLOC is valid here. Cheers, Dave. -- Dave Chinner david@fromorbit.com _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 7/7] xfs: Don't use PF_MEMALLOC 2009-11-17 22:11 ` Dave Chinner @ 2009-11-18 8:56 ` KOSAKI Motohiro 2009-11-18 22:16 ` Dave Chinner 0 siblings, 1 reply; 4+ messages in thread From: KOSAKI Motohiro @ 2009-11-18 8:56 UTC (permalink / raw) To: Dave Chinner Cc: xfs-masters, LKML, xfs, Christoph Hellwig, linux-mm, kosaki.motohiro, linux-fsdevel, Andrew Morton > On Tue, Nov 17, 2009 at 04:23:43PM +0900, KOSAKI Motohiro wrote: > > > > Non MM subsystem must not use PF_MEMALLOC. Memory reclaim need few > > memory, anyone must not prevent it. Otherwise the system cause > > mysterious hang-up and/or OOM Killer invokation. > > The xfsbufd is a woken run by a registered memory shaker. i.e. it > runs when the system needs to reclaim memory. It forceѕ the > delayed write metadata buffers (of which there can be a lot) to disk > so that they can be reclaimed on IO completion. This IO submission > may require ѕome memory to be allocated to be able to free that > memory. > > Hence, AFAICT the use of PF_MEMALLOC is valid here. Thanks a lot. I have one additional question, may I ask you? How can we calculate maximum memory usage in xfsbufd? I'm afraid that VM and XFS works properly but adding two makes memory exhaust. And, I conclude XFS doesn't need sharing reservation memory with VM, it only need non failed allocation. right? IOW I'm prefer perter's suggestion. _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 7/7] xfs: Don't use PF_MEMALLOC 2009-11-18 8:56 ` KOSAKI Motohiro @ 2009-11-18 22:16 ` Dave Chinner 0 siblings, 0 replies; 4+ messages in thread From: Dave Chinner @ 2009-11-18 22:16 UTC (permalink / raw) To: KOSAKI Motohiro Cc: xfs-masters, LKML, xfs, Christoph Hellwig, linux-mm, linux-fsdevel, Andrew Morton On Wed, Nov 18, 2009 at 05:56:46PM +0900, KOSAKI Motohiro wrote: > > On Tue, Nov 17, 2009 at 04:23:43PM +0900, KOSAKI Motohiro wrote: > > > > > > Non MM subsystem must not use PF_MEMALLOC. Memory reclaim need few > > > memory, anyone must not prevent it. Otherwise the system cause > > > mysterious hang-up and/or OOM Killer invokation. > > > > The xfsbufd is a woken run by a registered memory shaker. i.e. it > > runs when the system needs to reclaim memory. It forceѕ the > > delayed write metadata buffers (of which there can be a lot) to disk > > so that they can be reclaimed on IO completion. This IO submission > > may require ѕome memory to be allocated to be able to free that > > memory. > > > > Hence, AFAICT the use of PF_MEMALLOC is valid here. > > Thanks a lot. > I have one additional question, may I ask you? > > How can we calculate maximum memory usage in xfsbufd? It doesn't get calculated at the moment. It is very difficult to calculate a usable size metric for it because there are multiple caches (up to 3 per filesystem), and dentry/inode reclaim causes the size of the cache to grow. Hence the size of the cache is not really something that can be considered a stable or predictable input into a "reclaim now" calculation. As such we simply cause xfsbufd run simultaneously with the shrinkers that cause it to grow.... > I'm afraid that VM and XFS works properly but adding two makes memory exhaust. I don't understand what you are trying to say here. > And, I conclude XFS doesn't need sharing reservation memory with VM, > it only need non failed allocation. right? IOW I'm prefer perter's > suggestion. Right. However, it is worth keeping in mind that this is a performance critical path for inode reclaim. Hence any throttling of allocation will slow down the rate at which memory is freed by the system.... Cheers, Dave. -- Dave Chinner david@fromorbit.com _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-11-18 22:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20091117161551.3DD4.A69D9226@jp.fujitsu.com>
2009-11-17 7:23 ` [PATCH 7/7] xfs: Don't use PF_MEMALLOC KOSAKI Motohiro
2009-11-17 22:11 ` Dave Chinner
2009-11-18 8:56 ` KOSAKI Motohiro
2009-11-18 22:16 ` Dave Chinner
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox