From: Dave Kleikamp <dave.kleikamp@oracle.com>
To: Hugh Dickins <hughd@google.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
"Rafael J. Wysocki" <rjw@sisk.pl>,
jfs-discussion@lists.sourceforge.net,
Kernel Testers List <kernel-testers@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Maciej Rutecki <maciej.rutecki@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
Florian Mickler <florian@mickler.org>,
davem@davemloft.net, Al Viro <viro@zeniv.linux.org.uk>,
linux-mm@kvack.org
Subject: [PATCH v2] vfs: __read_cache_page should use gfp argument rather than GFP_KERNEL
Date: Wed, 21 Dec 2011 11:05:48 -0600 [thread overview]
Message-ID: <4EF211EC.7090002@oracle.com> (raw)
In-Reply-To: <alpine.LSU.2.00.1112202213310.3987@eggly.anvils>
[ updated to remove now-obsolete comment in read_cache_page_gfp()]
lockdep reports a deadlock in jfs because a special inode's rw semaphore
is taken recursively. The mapping's gfp mask is GFP_NOFS, but is not used
when __read_cache_page() calls add_to_page_cache_lru().
Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Acked-by: Hugh Dickins <hughd@google.com>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
diff --git a/mm/filemap.c b/mm/filemap.c
index c106d3b..5f0a3c9 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -1828,7 +1828,7 @@ repeat:
page = __page_cache_alloc(gfp | __GFP_COLD);
if (!page)
return ERR_PTR(-ENOMEM);
- err = add_to_page_cache_lru(page, mapping, index, GFP_KERNEL);
+ err = add_to_page_cache_lru(page, mapping, index, gfp);
if (unlikely(err)) {
page_cache_release(page);
if (err == -EEXIST)
@@ -1925,10 +1925,7 @@ static struct page *wait_on_page_read(struct page *page)
* @gfp: the page allocator flags to use if allocating
*
* This is the same as "read_mapping_page(mapping, index, NULL)", but with
- * any new page allocations done using the specified allocation flags. Note
- * that the Radix tree operations will still use GFP_KERNEL, so you can't
- * expect to do this atomically or anything like that - but you can pass in
- * other page requirements.
+ * any new page allocations done using the specified allocation flags.
*
* If the page does not get brought uptodate, return -EIO.
*/
--
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 internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
WARNING: multiple messages have this Message-ID (diff)
From: Dave Kleikamp <dave.kleikamp@oracle.com>
To: Hugh Dickins <hughd@google.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
"Rafael J. Wysocki" <rjw@sisk.pl>,
jfs-discussion@lists.sourceforge.net,
Kernel Testers List <kernel-testers@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Maciej Rutecki <maciej.rutecki@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
Florian Mickler <florian@mickler.org>,
davem@davemloft.net, Al Viro <viro@zeniv.linux.org.uk>,
linux-mm@kvack.org
Subject: [PATCH v2] vfs: __read_cache_page should use gfp argument rather than GFP_KERNEL
Date: Wed, 21 Dec 2011 11:05:48 -0600 [thread overview]
Message-ID: <4EF211EC.7090002@oracle.com> (raw)
In-Reply-To: <alpine.LSU.2.00.1112202213310.3987@eggly.anvils>
[ updated to remove now-obsolete comment in read_cache_page_gfp()]
lockdep reports a deadlock in jfs because a special inode's rw semaphore
is taken recursively. The mapping's gfp mask is GFP_NOFS, but is not used
when __read_cache_page() calls add_to_page_cache_lru().
Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Acked-by: Hugh Dickins <hughd@google.com>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
diff --git a/mm/filemap.c b/mm/filemap.c
index c106d3b..5f0a3c9 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -1828,7 +1828,7 @@ repeat:
page = __page_cache_alloc(gfp | __GFP_COLD);
if (!page)
return ERR_PTR(-ENOMEM);
- err = add_to_page_cache_lru(page, mapping, index, GFP_KERNEL);
+ err = add_to_page_cache_lru(page, mapping, index, gfp);
if (unlikely(err)) {
page_cache_release(page);
if (err == -EEXIST)
@@ -1925,10 +1925,7 @@ static struct page *wait_on_page_read(struct page *page)
* @gfp: the page allocator flags to use if allocating
*
* This is the same as "read_mapping_page(mapping, index, NULL)", but with
- * any new page allocations done using the specified allocation flags. Note
- * that the Radix tree operations will still use GFP_KERNEL, so you can't
- * expect to do this atomically or anything like that - but you can pass in
- * other page requirements.
+ * any new page allocations done using the specified allocation flags.
*
* If the page does not get brought uptodate, return -EIO.
*/
next prev parent reply other threads:[~2011-12-21 17:05 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-20 23:54 [Resend] 3.2-rc6+: Reported regressions from 3.0 and 3.1 Rafael J. Wysocki
2011-12-20 23:54 ` Rafael J. Wysocki
[not found] ` <201112210054.46995.rjw-KKrjLPT3xs0@public.gmane.org>
2011-12-21 2:31 ` Linus Torvalds
2011-12-21 2:31 ` Linus Torvalds
[not found] ` <CA+55aFzee7ORKzjZ-_PrVy796k2ASyTe_Odz=ji7f1VzToOkKw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-12-21 4:23 ` Dave Kleikamp
2011-12-21 4:23 ` Dave Kleikamp
[not found] ` <4EF15F42.4070104-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2011-12-21 4:44 ` Linus Torvalds
2011-12-21 4:44 ` Linus Torvalds
2011-12-21 4:44 ` Linus Torvalds
2011-12-21 6:15 ` Hugh Dickins
[not found] ` <alpine.LSU.2.00.1112202213310.3987-fupSdm12i1nKWymIFiNcPA@public.gmane.org>
2011-12-21 7:10 ` Al Viro
2011-12-21 7:10 ` Al Viro
2011-12-21 7:10 ` Al Viro
2011-12-21 17:05 ` Dave Kleikamp [this message]
2011-12-21 17:05 ` [PATCH v2] vfs: __read_cache_page should use gfp argument rather than GFP_KERNEL Dave Kleikamp
[not found] ` <4EF211EC.7090002-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2011-12-21 20:28 ` Andrew Morton
2011-12-21 20:28 ` Andrew Morton
2011-12-21 20:28 ` Andrew Morton
2011-12-21 20:53 ` Dave Kleikamp
2011-12-21 20:53 ` Dave Kleikamp
2011-12-21 4:50 ` [Resend] 3.2-rc6+: Reported regressions from 3.0 and 3.1 David Miller
2011-12-21 4:50 ` David Miller
2011-12-21 16:32 ` Nick Bowler
2011-12-21 16:32 ` Nick Bowler
[not found] ` <20111221163213.GA17116-7BP4RkwGw0uXmMXjJBpWqg@public.gmane.org>
2011-12-21 17:51 ` Keith Packard
2011-12-21 17:51 ` Keith Packard
2011-12-21 21:01 ` Jan Kara
2011-12-21 21:01 ` Jan Kara
2011-12-22 10:58 ` Srivatsa S. Bhat
2011-12-22 10:58 ` Srivatsa S. Bhat
[not found] ` <4EF30D4B.9060906-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2011-12-22 11:27 ` Jeff Layton
2011-12-22 11:27 ` Jeff Layton
2011-12-22 11:15 ` Srivatsa S. Bhat
2011-12-22 11:15 ` Srivatsa S. Bhat
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=4EF211EC.7090002@oracle.com \
--to=dave.kleikamp@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=florian@mickler.org \
--cc=hughd@google.com \
--cc=jfs-discussion@lists.sourceforge.net \
--cc=kernel-testers@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=maciej.rutecki@gmail.com \
--cc=rjw@sisk.pl \
--cc=torvalds@linux-foundation.org \
--cc=viro@zeniv.linux.org.uk \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.