From: Kefeng Wang <wangkefeng.wang@huawei.com>
To: "Huang, Ying" <ying.huang@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>, <willy@infradead.org>,
<linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>,
<david@redhat.com>, Zi Yan <ziy@nvidia.com>,
Mike Kravetz <mike.kravetz@oracle.com>, <hughd@google.com>
Subject: Re: [PATCH 1/6] sched/numa, mm: make numa migrate functions to take a folio
Date: Wed, 20 Sep 2023 15:57:58 +0800 [thread overview]
Message-ID: <db90339a-1ff8-44c1-93e3-9a6832c1fa0d@huawei.com> (raw)
In-Reply-To: <87ttrpwnmo.fsf@yhuang6-desk2.ccr.corp.intel.com>
On 2023/9/20 11:05, Huang, Ying wrote:
> Kefeng Wang <wangkefeng.wang@huawei.com> writes:
>
>> The cpuid(or access time) is stored in the head page for THP, so it is
>
> s/cpuid/cpupid/
Will fix.
>
>> safely to make should_numa_migrate_memory() and numa_hint_fault_latency()
>> to take a folio. This is in preparation for large folio numa balancing.
>>
>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
>> ---
>> include/linux/sched/numa_balancing.h | 4 ++--
>> kernel/sched/fair.c | 12 ++++++------
>> mm/mempolicy.c | 3 ++-
>> 3 files changed, 10 insertions(+), 9 deletions(-)
>>
>> diff --git a/include/linux/sched/numa_balancing.h b/include/linux/sched/numa_balancing.h
>> index 3988762efe15..a38528c28665 100644
>> --- a/include/linux/sched/numa_balancing.h
>> +++ b/include/linux/sched/numa_balancing.h
>> @@ -20,7 +20,7 @@ extern void task_numa_fault(int last_node, int node, int pages, int flags);
>> extern pid_t task_numa_group_id(struct task_struct *p);
>> extern void set_numabalancing_state(bool enabled);
>> extern void task_numa_free(struct task_struct *p, bool final);
>> -extern bool should_numa_migrate_memory(struct task_struct *p, struct page *page,
>> +extern bool should_numa_migrate_memory(struct task_struct *p, struct folio *folio,
>> int src_nid, int dst_cpu);
>> #else
>> static inline void task_numa_fault(int last_node, int node, int pages,
>> @@ -38,7 +38,7 @@ static inline void task_numa_free(struct task_struct *p, bool final)
>> {
>> }
>> static inline bool should_numa_migrate_memory(struct task_struct *p,
>> - struct page *page, int src_nid, int dst_cpu)
>> + struct folio *folio, int src_nid, int dst_cpu)
>> {
>> return true;
>> }
>> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
>> index cb225921bbca..683cc1e417d7 100644
>> --- a/kernel/sched/fair.c
>> +++ b/kernel/sched/fair.c
>> @@ -1722,12 +1722,12 @@ static bool pgdat_free_space_enough(struct pglist_data *pgdat)
>> * The smaller the hint page fault latency, the higher the possibility
>> * for the page to be hot.
>> */
>> -static int numa_hint_fault_latency(struct page *page)
>> +static int numa_hint_fault_latency(struct folio *folio)
>> {
>> int last_time, time;
>>
>> time = jiffies_to_msecs(jiffies);
>> - last_time = xchg_page_access_time(page, time);
>> + last_time = xchg_page_access_time(&folio->page, time);
>
> How about define xchg_folio_access_time() and folio_cpupid_xchg_last()?
>
Yes, like
page_cpupid_last()/xchg_page_access_time()/page_cpupid_xchg_last(),
we could do it later to change the caller to use a folio, and rename them.
> --
> Best Regards,
> Huang, Ying
>
next prev parent reply other threads:[~2023-09-20 7:58 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-18 10:32 [PATCH 0/6] mm: convert numa balancing functions to use " Kefeng Wang
2023-09-18 10:32 ` [PATCH 1/6] sched/numa, mm: make numa migrate functions to take " Kefeng Wang
2023-09-20 3:05 ` Huang, Ying
2023-09-20 7:57 ` Kefeng Wang [this message]
2023-09-18 10:32 ` [PATCH 2/6] mm: mempolicy: make mpol_misplaced() " Kefeng Wang
2023-09-18 10:32 ` [PATCH 3/6] mm: memory: make numa_migrate_prep() " Kefeng Wang
2023-09-18 10:32 ` [PATCH 4/6] mm: memory: use a folio in do_numa_page() Kefeng Wang
2023-09-18 10:32 ` [PATCH 5/6] mm: memory: add vm_normal_pmd_folio() Kefeng Wang
2023-09-20 3:12 ` Huang, Ying
2023-09-20 8:07 ` Kefeng Wang
2023-09-18 10:32 ` [PATCH 6/6] mm: huge_memory: use a folio in do_huge_pmd_numa_page() Kefeng Wang
2023-09-18 12:57 ` [PATCH 0/6] mm: convert numa balancing functions to use a folio Matthew Wilcox
2023-09-18 23:59 ` Kefeng Wang
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=db90339a-1ff8-44c1-93e3-9a6832c1fa0d@huawei.com \
--to=wangkefeng.wang@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mike.kravetz@oracle.com \
--cc=willy@infradead.org \
--cc=ying.huang@intel.com \
--cc=ziy@nvidia.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