[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140520063330.GI18954@dastard>
Date: Tue, 20 May 2014 16:33:30 +1000
From: Dave Chinner <david@...morbit.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>, riel@...hat.com,
kosaki.motohiro@...fujitsu.com, fengguang.wu@...el.com,
kamezawa.hiroyu@...fujitsu.com, linux-kernel@...r.kernel.org,
xfs@....sgi.com
Subject: Re: [PATCH] mm/vmscan: Do not block forever at
shrink_inactive_list().
On Mon, May 19, 2014 at 11:03:11PM -0700, Andrew Morton wrote:
> On Mon, 19 May 2014 22:59:15 -0700 Andrew Morton <akpm@...ux-foundation.org> wrote:
>
> > On Tue, 20 May 2014 10:44:49 +1000 Dave Chinner <david@...morbit.com> wrote:
> >
> > > @@ -258,14 +258,23 @@ xfs_bmapi_allocate_worker(
> > > struct xfs_bmalloca *args = container_of(work,
> > > struct xfs_bmalloca, work);
> > > unsigned long pflags;
> > > + unsigned long new_pflags = PF_FSTRANS;
> > >
> > > - /* we are in a transaction context here */
> > > - current_set_flags_nested(&pflags, PF_FSTRANS);
> > > + /*
> > > + * we are in a transaction context here, but may also be doing work
> > > + * in kswapd context, and hence we may need to inherit that state
> > > + * temporarily to ensure that we don't block waiting for memory reclaim
> > > + * in any way.
> > > + */
> > > + if (args->kswapd)
> > > + new_pflags |= PF_MEMALLOC | PF_SWAPWRITE | PF_KSWAPD;
> >
> > So current_is_kswapd() returns true for a thread which is not kswapd.
> > That's a bit smelly.
> >
> > Should this thread really be incrementing KSWAPD_INODESTEAL instead of
> > PGINODESTEAL, for example? current_is_kswapd() does a range of things,
> > only one(?) of which you actually want.
> >
> > It would be cleaner to create a new PF_ flag to select just that
> > behavior. That's a better model than telling the world "I am magic and
> > special".
>
> Or a new __GFP_FLAG.
Sure - and with that XFS will need another PF_ flag to tell the
memory allocator to set the new __GFP_FLAG on every allocation done
in that kworker task context, just like it uses PF_FSTRANS to ensure
that __GFP_NOFS is set for all the allocations in that kworker
context....
Cheers,
Dave.
--
Dave Chinner
david@...morbit.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists