From: Zi Yan <ziy@nvidia.com>
To: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, David Hildenbrand <david@redhat.com>,
"Huang, Ying" <ying.huang@intel.com>,
Baolin Wang <baolin.wang@linux.alibaba.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] memory tiering: introduce folio_has_cpupid() check
Date: Sat, 20 Jul 2024 09:47:15 -0400 [thread overview]
Message-ID: <C1584B11-84DA-4BF8-9FA2-75867B709F7A@nvidia.com> (raw)
In-Reply-To: <da7eff7c-ba42-4152-9186-14021befe5f1@huawei.com>
[-- Attachment #1: Type: text/plain, Size: 1550 bytes --]
On 20 Jul 2024, at 3:50, Kefeng Wang wrote:
> On 2024/7/19 22:43, Zi Yan wrote:
>> Instead of open coded check for if memory tiering mode is on and a folio
>> is in the top tier memory, use a function to encapsulate the check.
>>
>> Signed-off-by: Zi Yan <ziy@nvidia.com>
>> Reviewed-by: "Huang, Ying" <ying.huang@intel.com>
>> ---
>> include/linux/memory-tiers.h | 8 ++++++++
>> kernel/sched/fair.c | 3 +--
>> mm/huge_memory.c | 6 ++----
>> mm/memory-tiers.c | 17 +++++++++++++++++
>> mm/memory.c | 3 +--
>> mm/mprotect.c | 3 +--
>> 6 files changed, 30 insertions(+), 10 deletions(-)
>>
>> diff --git a/include/linux/memory-tiers.h b/include/linux/memory-tiers.h
>> index 0dc0cf2863e2..10c127d461c4 100644
>> --- a/include/linux/memory-tiers.h
>> +++ b/include/linux/memory-tiers.h
>> @@ -73,6 +73,10 @@ static inline bool node_is_toptier(int node)
>> }
>> #endif
>> +
>> +bool folio_has_cpupid(struct folio *folio);
>> +
>> +
>> #else
>> #define numa_demotion_enabled false
>> @@ -151,5 +155,9 @@ static inline struct memory_dev_type *mt_find_alloc_memory_type(int adist,
>> static inline void mt_put_memory_types(struct list_head *memory_types)
>> {
>> }
>> +static inline bool folio_has_cpupid(struct folio *folio)
>> +{
>> + return true;
>> +}
>
> Maybe better to move into mm.h since most folio_foo_cpupid()s are there?
Sounds good to me. Will do that in the next version.
--
Best Regards,
Yan, Zi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 854 bytes --]
next prev parent reply other threads:[~2024-07-20 13:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-19 14:43 [PATCH 1/2] memory tiering: read last_cpupid correctly in do_huge_pmd_numa_page() Zi Yan
2024-07-19 14:43 ` [PATCH 2/2] memory tiering: introduce folio_has_cpupid() check Zi Yan
2024-07-20 7:50 ` Kefeng Wang
2024-07-20 13:47 ` Zi Yan [this message]
2024-07-20 8:11 ` [PATCH 1/2] memory tiering: read last_cpupid correctly in do_huge_pmd_numa_page() Kefeng Wang
2024-07-20 12:36 ` Zi Yan
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=C1584B11-84DA-4BF8-9FA2-75867B709F7A@nvidia.com \
--to=ziy@nvidia.com \
--cc=akpm@linux-foundation.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=david@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=wangkefeng.wang@huawei.com \
--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