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]
Date:   Fri, 13 May 2022 16:41:20 +0800
From:   Muchun Song <songmuchun@...edance.com>
To:     Mel Gorman <mgorman@...hsingularity.net>
Cc:     Nicolas Saenz Julienne <nsaenzju@...hat.com>,
        Marcelo Tosatti <mtosatti@...hat.com>,
        Vlastimil Babka <vbabka@...e.cz>,
        Michal Hocko <mhocko@...nel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Linux-MM <linux-mm@...ck.org>
Subject: Re: [PATCH 1/6] mm/page_alloc: Add page->buddy_list and
 page->pcp_list

On Mon, May 09, 2022 at 02:08:00PM +0100, Mel Gorman wrote:
> The page allocator uses page->lru for storing pages on either buddy or
> PCP lists. Create page->buddy_list and page->pcp_list as a union with
> page->lru. This is simply to clarify what type of list a page is on
> in the page allocator.
> 
> No functional change intended.
> 

Nice cleanup for me.

> Signed-off-by: Mel Gorman <mgorman@...hsingularity.net>
> ---
>  include/linux/mm_types.h |  5 +++++
>  mm/page_alloc.c          | 18 +++++++++---------
>  2 files changed, 14 insertions(+), 9 deletions(-)
> 
> diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
> index 8834e38c06a4..a2782e8af307 100644
> --- a/include/linux/mm_types.h
> +++ b/include/linux/mm_types.h
> @@ -87,6 +87,7 @@ struct page {
>  			 */
>  			union {
>  				struct list_head lru;
> +
>  				/* Or, for the Unevictable "LRU list" slot */
>  				struct {
>  					/* Always even, to negate PageTail */
> @@ -94,6 +95,10 @@ struct page {
>  					/* Count page's or folio's mlocks */
>  					unsigned int mlock_count;
>  				};
> +
> +				/* Or, free page */
> +				struct list_head buddy_list;
> +				struct list_head pcp_list;
>  			};

Since you have clarified "lru" member, should we go further?
Like union "index" to "pcp_migratetype" and "private" to "order"
since buddy allocator reuses "index" and "private" as well.
My initial idea is as follows, it is more clear for me, what
do you think?

diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index dbfd892ac96a..644349a5f901 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -107,6 +107,15 @@ struct page {
                         */
                        unsigned long private;
                };
+               struct {        /* pages manipulated by buddy allocator */
+                       union {
+                               struct list_head buddy_list;
+                               struct list_head pcp_list;
+                       };
+                       unsigned long mapping_pad;      /* Not used */
+                       unsigned long pcp_migratetype;
+                       unsigned long order;
+               };
                struct {        /* page_pool used by netstack */
                        /**
                         * @pp_magic: magic value to avoid recycling non

Powered by blists - more mailing lists