From: Sidhartha Kumar <sidhartha.kumar@oracle.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
akpm@linux-foundation.org, vishal.moola@oracle.com,
muchun.song@linux.dev, david@redhat.com, osalvador@suse.de
Subject: Re: [PATCH] mm/hugetlb: mm/memory_hotplug: use a folio in scan_movable_pages()
Date: Wed, 29 May 2024 11:21:12 -0700 [thread overview]
Message-ID: <328386e6-7cb5-4571-97ae-23a6d266c1e5@oracle.com> (raw)
In-Reply-To: <ZlZfHNkWHxtpcXhO@casper.infradead.org>
On 5/28/24 3:47 PM, Matthew Wilcox wrote:
> On Tue, May 28, 2024 at 03:03:21PM -0700, Sidhartha Kumar wrote:
>> @@ -1761,9 +1762,9 @@ static int scan_movable_pages(unsigned long start, unsigned long end,
>> * cases false positives and negatives are possible. Calling
>> * code must deal with these scenarios.
>> */
>> - if (HPageMigratable(head))
>> + if (folio_test_hugetlb_migratable(folio))
>> goto found;
>> - skip = compound_nr(head) - (pfn - page_to_pfn(head));
>> + skip = folio_nr_pages(folio) - folio_page_idx(folio, page);
>> pfn += skip - 1;
>
> Isn't this an unnecessarily complicated way of writing:
>
> pfn |= folio_nr_pages(folio) - 1;
> ?
Because folio_nr_pages() is a power of 2, I agree this is simpler. I'll make
this change in a v2.
Thanks,
Sid
prev parent reply other threads:[~2024-05-29 18:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-28 22:03 Sidhartha Kumar
2024-05-28 22:47 ` Matthew Wilcox
2024-05-29 18:21 ` Sidhartha Kumar [this message]
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=328386e6-7cb5-4571-97ae-23a6d266c1e5@oracle.com \
--to=sidhartha.kumar@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=muchun.song@linux.dev \
--cc=osalvador@suse.de \
--cc=vishal.moola@oracle.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