+ mm-netfs-fscache-stop-read-optimisation-when-folio-removed-from-pagecache-fix.patch added to mm-nonmm-unstable branch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: mm: call folio_mapping() inside folio_needs_release()
has been added to the -mm mm-nonmm-unstable branch.  Its filename is
     mm-netfs-fscache-stop-read-optimisation-when-folio-removed-from-pagecache-fix.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-netfs-fscache-stop-read-optimisation-when-folio-removed-from-pagecache-fix.patch

This patch will later appear in the mm-nonmm-unstable branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days

------------------------------------------------------
From: Dave Wysochanski <dwysocha@xxxxxxxxxx>
Subject: mm: call folio_mapping() inside folio_needs_release()
Date: Fri Jul  7 11:54:53 AM PDT 2023

We must call folio_mapping() inside folio_needs_release() or we will end
up oopsing on an anon page as follows:

 RIP: 0010:filemap_release_folio+0x69/0x80
 Code: 75 95 00 5d e9 58 7c 95 00 48 85 d2 74 f5 48 8b 8a 98 00 00 00 84 c9 79 ea 48 8b 0f 31 c0 80 e5 80 75 e0 48 8b 82 90 00 00 00 <48> 8b 40 48 48 85 c0 75 cb e8 19 69 15  00 5d e9 23 7c 95 00 0f 0b
 RSP: 0018:ffffa89c4057b980 EFLAGS: 00010246
 RAX: 0500000001251880 RBX: ffffa89c4057baa8 RCX: 0017ffffc0080005
 RDX: ffff90c709bd3f71 RSI: 0000000000000cc0 RDI: ffffebcf45a6e800
 RBP: ffffa89c4057b980 R08: ffff90c707f800c0 R09: ffffebcf45a6e808
 R10: 0000000000000000 R11: 000000000000000c R12: ffffebcf45a6e800
 R13: ffffa89c4057ba08 R14: ffffebcf45a6e808 R15: ffffa89c4057bdb0
 FS:  0000000000000000(0000) GS:ffff91443fdc0000(0000) knlGS:0000000000000000
 CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
 CR2: 00007f4472634000 CR3: 0000000103d8a000 CR4: 0000000000350ee0
 Call Trace:
  <TASK>
  shrink_folio_list+0x746/0xc80
  evict_folios+0x272/0x5f0
  try_to_shrink_lruvec+0x1f1/0x2d0
  shrink_one+0x13b/0x1b0
  lru_gen_shrink_node+0x1ee/0x3e0
  shrink_node+0x68d/0x730
  balance_pgdat+0x41e/0x8c0
  kswapd+0x1f4/0x3b0
  kthread+0xf9/0x130
  ret_from_fork+0x2c/0x50
  </TASK>

Link: https://github.com/DaveWysochanskiRH/kernel/commit/902c990e311120179fa5de99d68364b2947b79ec
Signed-off-by: Dave Wysochanski <dwysocha@xxxxxxxxxx>
Reported-by: Daire Byrne <daire.byrne@xxxxxxxxx>
Cc: Andreas Dilger <adilger.kernel@xxxxxxxxx>
Cc: Dave Wysochanski <dwysocha@xxxxxxxxxx>
Cc: David Howells <dhowells@xxxxxxxxxx>
Cc: Dominique Martinet <asmadeus@xxxxxxxxxxxxx>
Cc: Ilya Dryomov <idryomov@xxxxxxxxx>
Cc: Jingbo Xu <jefflexu@xxxxxxxxxxxxxxxxx>
Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Cc: Matthew Wilcox <willy@xxxxxxxxxxxxx>
Cc: Rohith Surabattula <rohiths.msft@xxxxxxxxx>
Cc: Shyam Prasad N <nspmangalore@xxxxxxxxx>
Cc: Steve French <sfrench@xxxxxxxxx>
Cc: "Theodore Ts'o" <tytso@xxxxxxx>
Cc: Xiubo Li <xiubli@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 mm/internal.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/mm/internal.h~mm-netfs-fscache-stop-read-optimisation-when-folio-removed-from-pagecache-fix
+++ a/mm/internal.h
@@ -181,7 +181,7 @@ static inline void set_page_refcounted(s
  */
 static inline bool folio_needs_release(struct folio *folio)
 {
-	struct address_space *mapping = folio->mapping;
+	struct address_space *mapping = folio_mapping(folio);
 
 	return folio_has_private(folio) ||
 		(mapping && mapping_release_always(mapping));
_

Patches currently in -mm which might be from dwysocha@xxxxxxxxxx are

mm-netfs-fscache-stop-read-optimisation-when-folio-removed-from-pagecache-fix.patch




[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux