mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steve French <smfrench@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 6/7] cifs: Don't use PF_MEMALLOC
Date: Tue, 17 Nov 2009 10:41:54 -0600	[thread overview]
Message-ID: <524f69650911170841p262ca2a6s8f2802f20d15a4f4@mail.gmail.com> (raw)
In-Reply-To: <20091117074739.4abaef85@tlielax.poochiereds.net>

It is hard to follow exactly what this flag does in /mm (other than
try harder on memory allocations) - I haven't found much about this
flag (e.g. http://lwn.net/Articles/246928/) but it does look like most
of the fs no longer set this (except xfs) e.g. ext3_ordered_writepage.
 When running out of memory in the cifs_demultiplex_thread it will
retry 3 seconds later, but if memory allocations ever fail in this
path we could potentially be holding up (an already issued write in)
writepages for that period by not having memory to get the response to
see if the write succeeded.

We pass in few flags for these memory allocation requests: GFP_NOFS
(on the mempool_alloc) and SLAB_HWCACHE_ALIGN (on the
kmem_cache_create of the pool) should we be passing in other flags on
the allocations?

On Tue, Nov 17, 2009 at 6:47 AM, Jeff Layton <jlayton@redhat.com> wrote:
>
> On Tue, 17 Nov 2009 16:22:32 +0900 (JST)
> KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> 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.
> >
> > Cc: Steve French <sfrench@samba.org>
> > Cc: linux-cifs-client@lists.samba.org
> > Cc: samba-technical@lists.samba.org
> > Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> > ---
> >  fs/cifs/connect.c |    1 -
> >  1 files changed, 0 insertions(+), 1 deletions(-)
> >
> > diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
> > index 63ea83f..f9b1553 100644
> > --- a/fs/cifs/connect.c
> > +++ b/fs/cifs/connect.c
> > @@ -337,7 +337,6 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
> >       bool isMultiRsp;
> >       int reconnect;
> >
> > -     current->flags |= PF_MEMALLOC;
> >       cFYI(1, ("Demultiplex PID: %d", task_pid_nr(current)));
> >
> >       length = atomic_inc_return(&tcpSesAllocCount);
>
> This patch appears to be safe for CIFS. I believe that the demultiplex
> thread only does mempool allocations currently. The only other case
> where it did an allocation was recently changed with the conversion of
> the oplock break code to use slow_work.
>
> Barring anything I've missed...
>
> Acked-by: Jeff Layton <jlayton@redhat.com>



--
Thanks,

Steve

  reply	other threads:[~2009-11-17 16:41 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-17  7:16 [PATCH 0/7] Kill PF_MEMALLOC abuse KOSAKI Motohiro
2009-11-17  7:17 ` [PATCH 1/7] dm: use __GFP_HIGH instead PF_MEMALLOC KOSAKI Motohiro
2009-11-17 13:15   ` Alasdair G Kergon
2009-11-18  6:17     ` KOSAKI Motohiro
2009-11-17  7:17 ` [PATCH 2/7] mmc: Don't use PF_MEMALLOC KOSAKI Motohiro
2009-11-17 10:29   ` Alan Cox
2009-11-17 10:32     ` Minchan Kim
2009-11-17 10:38       ` Oliver Neukum
2009-11-17 11:58     ` KOSAKI Motohiro
2009-11-17 12:51       ` Minchan Kim
2009-11-17 20:47         ` Peter Zijlstra
2009-11-18  0:01           ` Minchan Kim
2009-11-18  9:56             ` Peter Zijlstra
2009-11-18 10:31               ` Minchan Kim
2009-11-18 10:54                 ` Peter Zijlstra
2009-11-18 11:15                   ` Minchan Kim
2009-11-17  7:18 ` [PATCH 3/7] mtd: " KOSAKI Motohiro
2009-11-17  7:19 ` [PATCH 4/7] nandsim: " KOSAKI Motohiro
2009-11-23 15:00   ` Artem Bityutskiy
2009-11-23 20:01     ` Adrian Hunter
2009-11-24 10:46       ` KOSAKI Motohiro
2009-11-24 11:56         ` Adrian Hunter
2009-11-25  0:42           ` KOSAKI Motohiro
2009-11-25  7:13             ` Adrian Hunter
2009-11-25  7:18               ` KOSAKI Motohiro
2009-11-17  7:21 ` [PATCH 5/7] Revert "Intel IOMMU: Avoid memory allocation failures in dma map api calls" KOSAKI Motohiro
2009-11-17  7:22 ` [PATCH 6/7] cifs: Don't use PF_MEMALLOC KOSAKI Motohiro
2009-11-17  7:32   ` [PATCH] Mark cifs mailing list as "moderated as non-subscribers" KOSAKI Motohiro
2009-11-17 12:47   ` [PATCH 6/7] cifs: Don't use PF_MEMALLOC Jeff Layton
2009-11-17 16:41     ` Steve French [this message]
     [not found]     ` <524f69650911170840o5be241a0q5d9863c8d7f4e571@mail.gmail.com>
2009-11-18  6:31       ` KOSAKI Motohiro
2009-11-17  7:23 ` [PATCH 7/7] xfs: " KOSAKI Motohiro
2009-11-17 22:11   ` Dave Chinner
2009-11-18  8:56     ` KOSAKI Motohiro
2009-11-18 22:16       ` Dave Chinner
2009-11-17  8:07 ` [PATCH 0/7] Kill PF_MEMALLOC abuse David Rientjes
2009-11-17  8:33   ` KOSAKI Motohiro
2009-11-17  8:36     ` David Rientjes
2009-11-17 20:56     ` Peter Zijlstra
2009-11-18  5:55       ` KOSAKI Motohiro
2009-11-17 10:15 ` Christoph Hellwig
2009-11-17 10:24   ` KOSAKI Motohiro
2009-11-17 10:27     ` Christoph Hellwig
2009-11-17 12:24       ` KOSAKI Motohiro
2009-11-17 12:47         ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=524f69650911170841p262ca2a6s8f2802f20d15a4f4@mail.gmail.com \
    --to=smfrench@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®