From: David Hildenbrand <david@redhat.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Oliver Sang <oliver.sang@intel.com>,
Matthew Wilcox <willy@infradead.org>,
oe-lkp@lists.linux.dev, lkp@intel.com,
Linux Memory Management List <linux-mm@kvack.org>,
linux-kernel@vger.kernel.org
Subject: Re: [linux-next:master] [mm] bbcbf2a3f0: kernel_BUG_at_mm/memory.c
Date: Thu, 21 Dec 2023 23:07:21 +0100 [thread overview]
Message-ID: <6a8f2110-fa91-4c10-9eae-88315309a6e3@redhat.com> (raw)
In-Reply-To: <20231221135833.92b8b2a97b28ad0545977f6c@linux-foundation.org>
On 21.12.23 22:58, Andrew Morton wrote:
> On Thu, 21 Dec 2023 12:32:04 +0100 David Hildenbrand <david@redhat.com> wrote:
>
>> On 21.12.23 12:23, Oliver Sang wrote:
>>> hi, Andrew Morton,
>>>
>>> On Wed, Dec 20, 2023 at 02:11:35PM -0800, Andrew Morton wrote:
>>>> On Tue, 19 Dec 2023 23:46:50 +0800 kernel test robot <oliver.sang@intel.com> wrote:
>>>>
>>>>>
>>>>>
>>>>> Hello,
>>>>>
>>>>> kernel test robot noticed "kernel_BUG_at_mm/memory.c" on:
>>>>>
>>>>> commit: bbcbf2a3f05f74f9d268eab57abbdce6a65a94ad ("mm: convert ksm_might_need_to_copy() to work on folios")
>>>>
>>>> I assume this is a bisection result, so it's quite repeatable?
>>>
>>> yes, we bisect to this commit, it's quite repeatable:
>>>
>>> ddd06bb63d9793ce bbcbf2a3f05f74f9d268eab57ab
>>> ---------------- ---------------------------
>>> fail:runs %reproduction fail:runs
>>> | | |
>>> :6 100% 6:6 dmesg.Kernel_panic-not_syncing:Fatal_exception
>>> :6 100% 6:6 dmesg.RIP:do_swap_page
>>> :6 100% 6:6 dmesg.invalid_opcode:#[##]
>>> :6 100% 6:6 dmesg.kernel_BUG_at_mm/memory.c
>>>
>>>
>>
>> Can you try with the snipped I sent? Please let me know if you need a
>> full patch for testing purposes.
>
> I think a full patch would be better, please.
>
From b82e309096abde6c0f24bba50a281e8d3855c132 Mon Sep 17 00:00:00 2001
From: David Hildenbrand <david@redhat.com>
Date: Thu, 21 Dec 2023 23:04:30 +0100
Subject: [PATCH] Fixup: mm: convert ksm_might_need_to_copy() to work on folios
We must only adjust the page if the folio changed. Otherwise, if we
had a large folio in the swapcache and the folio didn't change, we'd
suddenly change the page to-be-mapped.
Reported-by: kernel test robot <oliver.sang@intel.com>
Closes: https://lore.kernel.org/oe-lkp/202312192319.fa8f5709-oliver.sang@intel.com
Signed-off-by: David Hildenbrand <david@redhat.com>
---
mm/memory.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/mm/memory.c b/mm/memory.c
index 149f779910fd5..2f9668d357f5c 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -3952,7 +3952,8 @@ vm_fault_t do_swap_page(struct vm_fault *vmf)
folio = swapcache;
goto out_page;
}
- page = folio_page(folio, 0);
+ if (folio != swapcache)
+ page = folio_page(folio, 0);
/*
* If we want to map a page that's in the swapcache writable, we
--
2.43.0
--
Cheers,
David / dhildenb
next prev parent reply other threads:[~2023-12-21 22:07 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-19 15:46 kernel test robot
2023-12-20 22:11 ` Andrew Morton
2023-12-20 22:29 ` David Hildenbrand
2023-12-21 11:23 ` Oliver Sang
2023-12-21 11:32 ` David Hildenbrand
2023-12-21 21:58 ` Andrew Morton
2023-12-21 22:07 ` David Hildenbrand [this message]
2023-12-21 22:13 ` Matthew Wilcox
2023-12-21 22:14 ` David Hildenbrand
2023-12-22 8:13 ` Oliver Sang
2023-12-22 9:38 ` David Hildenbrand
2023-12-21 2:56 ` Aithal, Srikanth
2023-12-21 4:30 ` Matthew Wilcox
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=6a8f2110-fa91-4c10-9eae-88315309a6e3@redhat.com \
--to=david@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.com \
--cc=oe-lkp@lists.linux.dev \
--cc=oliver.sang@intel.com \
--cc=willy@infradead.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