linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Ricardo M. Correia" <ricardo.correia@oracle.com>
To: linux-mm@kvack.org
Cc: linux-arch@vger.kernel.org, andreas.dilger@oracle.com,
	behlendorf1@llnl.gov
Subject: Re: [PATCH] Fix unconditional GFP_KERNEL allocations in __vmalloc().
Date: Wed, 15 Dec 2010 03:53:20 +0100	[thread overview]
Message-ID: <1292381600.2994.6.camel@oralap> (raw)
In-Reply-To: <1292381126-5710-1-git-send-email-ricardo.correia@oracle.com>

On Wed, 2010-12-15 at 03:45 +0100, Ricardo M. Correia wrote:
> (Patch based on 2.6.36 tag).
> 
> These GFP_KERNEL allocations could happen even though the caller of __vmalloc()
> requested a stricter gfp mask (such as GFP_NOFS or GFP_ATOMIC).

Sorry for taking a while to write this patch. For the discussion behind
it, you can read: http://marc.info/?t=128942209500002&r=1&w=2

Please note that I have only tested this patch on my laptop (x86-64)
 with one Kconfig.

Since I have done all these changes manually and I don't have any
non-x86-64 machines, it's possible that I may have typoed or missed
something and that this patch may break compilation on other
architectures or with other config options.

Any suggestions are welcome.

Thanks,
Ricardo

> This was first noticed in Lustre, where it led to deadlocks due to a filesystem
> thread which requested a GFP_NOFS __vmalloc() allocation ended up calling down
> to Lustre itself to free memory, despite this not being allowed by GFP_NOFS.
> 
> Further analysis showed that some in-tree filesystems (namely GFS, Ceph and XFS)
> were vulnerable to the same bug due to calling __vmalloc() or vm_map_ram() in
> contexts where __GFP_FS allocations are not allowed.
> 
> Fixing this bug required changing a few mm interfaces to accept gfp flags.
> This needed to be done in all architectures, thus the large number of changes.


--
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/ .
Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2010-12-15  2:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-15  2:45 [PATCH] Fix unconditional GFP_KERNEL allocations in __vmalloc() Ricardo M. Correia
2010-12-15  2:53 ` Ricardo M. Correia [this message]
2010-12-15  3:48   ` Cross compilers (Was: Re: [PATCH] Fix unconditional GFP_KERNEL allocations in __vmalloc().) Stephen Rothwell
2010-12-23 21:37     ` Randy Dunlap
2011-01-09 23:17       ` Tony Breeds
2010-12-17  7:27 ` [PATCH] Fix unconditional GFP_KERNEL allocations in __vmalloc() KOSAKI Motohiro
2010-12-23 21:08   ` David Rientjes

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=1292381600.2994.6.camel@oralap \
    --to=ricardo.correia@oracle.com \
    --cc=andreas.dilger@oracle.com \
    --cc=behlendorf1@llnl.gov \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-mm@kvack.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;
as well as URLs for NNTP newsgroup(s).