lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <da7eff7c-ba42-4152-9186-14021befe5f1@huawei.com>
Date: Sat, 20 Jul 2024 15:50:01 +0800
From: Kefeng Wang <wangkefeng.wang@...wei.com>
To: Zi Yan <ziy@...dia.com>, Andrew Morton <akpm@...ux-foundation.org>,
	<linux-mm@...ck.org>
CC: David Hildenbrand <david@...hat.com>, "Huang, Ying"
	<ying.huang@...el.com>, Baolin Wang <baolin.wang@...ux.alibaba.com>,
	<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] memory tiering: introduce folio_has_cpupid() check



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@...dia.com>
> Reviewed-by: "Huang, Ying" <ying.huang@...el.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?


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ