From: Baolin Wang <baolin.wang@linux.alibaba.com>
To: Oscar Salvador <osalvador@suse.de>
Cc: Byungchul Park <byungchul@sk.com>,
akpm@linux-foundation.org, ying.huang@intel.com,
hannes@cmpxchg.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, kernel_team@skhynix.com,
stable@vger.kernel.org
Subject: Re: [PATCH] mm/vmscan: Fix a bug calling wakeup_kswapd() with a wrong zone index
Date: Mon, 19 Feb 2024 17:54:36 +0800 [thread overview]
Message-ID: <f9ca3b97-002d-46b0-904b-c9b1859ee236@linux.alibaba.com> (raw)
In-Reply-To: <ZdMNGvUOWnNn9zDh@localhost.localdomain>
On 2024/2/19 16:11, Oscar Salvador wrote:
> On Mon, Feb 19, 2024 at 02:25:11PM +0800, Baolin Wang wrote:
>> This means that there is no memory on the target node? if so, we can add a
>> check at the beginning to avoid calling unnecessary
>> migrate_misplaced_folio().
>>
>> diff --git a/mm/memory.c b/mm/memory.c
>> index e95503d7544e..a64a1aac463f 100644
>> --- a/mm/memory.c
>> +++ b/mm/memory.c
>> @@ -5182,7 +5182,7 @@ static vm_fault_t do_numa_page(struct vm_fault *vmf)
>> else
>> last_cpupid = folio_last_cpupid(folio);
>> target_nid = numa_migrate_prep(folio, vma, vmf->address, nid,
>> &flags);
>> - if (target_nid == NUMA_NO_NODE) {
>> + if (target_nid == NUMA_NO_NODE || !node_state(target_nid, N_MEMORY))
>> {
>> folio_put(folio);
>> goto out_map;
>> }
>>
>> (similar changes for do_huge_pmd_numa_page())
>
> With the check in place from [1], numa_migrate_prep() will also return
> NUMA_NO_NODE, so no need for this one here.
>
> And I did not check, but I assume that do_huge_pmd_numa_page() also ends
> up calling numa_migrate_prep().
>
> [1] https://lore.kernel.org/lkml/20240219041920.1183-1-byungchul@sk.com/
Right. I missed this patch before. So with checking in
should_numa_migrate_memory(), I guess current changes in
numamigrate_isolate_folio() can also be dropped, it will never hit a
memoryless node after the patch [1], no?
next prev parent reply other threads:[~2024-02-19 9:54 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-16 11:15 Byungchul Park
2024-02-19 6:25 ` Baolin Wang
2024-02-19 6:31 ` Byungchul Park
2024-02-19 8:11 ` Oscar Salvador
2024-02-19 9:54 ` Baolin Wang [this message]
2024-02-20 3:42 ` Huang, Ying
2024-02-20 4:03 ` Byungchul Park
2024-02-20 5:29 ` Huang, Ying
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=f9ca3b97-002d-46b0-904b-c9b1859ee236@linux.alibaba.com \
--to=baolin.wang@linux.alibaba.com \
--cc=akpm@linux-foundation.org \
--cc=byungchul@sk.com \
--cc=hannes@cmpxchg.org \
--cc=kernel_team@skhynix.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=osalvador@suse.de \
--cc=stable@vger.kernel.org \
--cc=ying.huang@intel.com \
/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