Linux RCU subsystem development
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Cc: Christoph Lameter <cl@linux.com>,
	David Rientjes <rientjes@google.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Pekka Enberg <penberg@kernel.org>,
	Roman Gushchin <roman.gushchin@linux.dev>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, rcu@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	patches@lists.linux.dev, netdev@vger.kernel.org,
	linux-doc@vger.kernel.org, Lorenzo Stoakes <lstoakes@gmail.com>
Subject: Re: [PATCH 4/7] mm, pagemap: remove SLOB and SLQB from comments and documentation
Date: Wed, 15 Mar 2023 12:05:55 +0100	[thread overview]
Message-ID: <bfacefe6-5852-3101-a016-3ee288a4e447@suse.cz> (raw)
In-Reply-To: <ZBAuBj0hgLK7Iqgy@localhost>

On 3/14/23 09:19, Hyeonggon Yoo wrote:
> On Fri, Mar 10, 2023 at 11:32:06AM +0100, Vlastimil Babka wrote:
>> SLOB has been removed and SLQB never merged, so remove their mentions
>> from comments and documentation of pagemap.
>> 
>> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
>> ---
>>  Documentation/admin-guide/mm/pagemap.rst | 6 +++---
>>  fs/proc/page.c                           | 5 ++---
>>  2 files changed, 5 insertions(+), 6 deletions(-)
>> 
>> diff --git a/Documentation/admin-guide/mm/pagemap.rst b/Documentation/admin-guide/mm/pagemap.rst
>> index b5f970dc91e7..bb4aa897a773 100644
>> --- a/Documentation/admin-guide/mm/pagemap.rst
>> +++ b/Documentation/admin-guide/mm/pagemap.rst
>> @@ -91,9 +91,9 @@ Short descriptions to the page flags
>>     The page is being locked for exclusive access, e.g. by undergoing read/write
>>     IO.
>>  7 - SLAB
>> -   The page is managed by the SLAB/SLOB/SLUB/SLQB kernel memory allocator.
>> -   When compound page is used, SLUB/SLQB will only set this flag on the head
>> -   page; SLOB will not flag it at all.
>> +   The page is managed by the SLAB/SLUB kernel memory allocator.
>> +   When compound page is used, either will only set this flag on the head
>> +   page..
>>  10 - BUDDY
>>      A free memory block managed by the buddy system allocator.
>>      The buddy system organizes free memory in blocks of various orders.
>> diff --git a/fs/proc/page.c b/fs/proc/page.c
>> index 6249c347809a..1356aeffd8dc 100644
>> --- a/fs/proc/page.c
>> +++ b/fs/proc/page.c
>> @@ -125,7 +125,7 @@ u64 stable_page_flags(struct page *page)
>>  	/*
>>  	 * pseudo flags for the well known (anonymous) memory mapped pages
>>  	 *
>> -	 * Note that page->_mapcount is overloaded in SLOB/SLUB/SLQB, so the
>> +	 * Note that page->_mapcount is overloaded in SLAB/SLUB, so the
> 
> SLUB does not overload _mapcount.

True, I overlooked that, thanks.

>>  	 * simple test in page_mapped() is not enough.
>>  	 */
>>  	if (!PageSlab(page) && page_mapped(page))
>> @@ -166,8 +166,7 @@ u64 stable_page_flags(struct page *page)
>>  
>>  	/*
>>  	 * Caveats on high order pages: page->_refcount will only be set
>> -	 * -1 on the head page; SLUB/SLQB do the same for PG_slab;
>> -	 * SLOB won't set PG_slab at all on compound pages.
>> +	 * -1 on the head page; SLAB/SLUB do the same for PG_slab;
> 
> I think this comment could be just saying that PG_buddy is only set on
> head page, not saying
> 
> _refcount is set to -1 on head page (is it even correct?)

It's not, that scheme is outdated. So I'll have it mention PG_buddy as you
suggest, but PG_slab also needs special care as it's not set on tail pages.
But I noticed the compound_head() is unnecessary as that's covered by
PageSlab() which is defined as PF_NO_TAIL. So the sum of modifications to
this patch:

diff --git a/Documentation/admin-guide/mm/pagemap.rst b/Documentation/admin-guide/mm/pagemap.rst
index bb4aa897a773..c8f380271cad 100644
--- a/Documentation/admin-guide/mm/pagemap.rst
+++ b/Documentation/admin-guide/mm/pagemap.rst
@@ -93,7 +93,7 @@ Short descriptions to the page flags
 7 - SLAB
    The page is managed by the SLAB/SLUB kernel memory allocator.
    When compound page is used, either will only set this flag on the head
-   page..
+   page.
 10 - BUDDY
     A free memory block managed by the buddy system allocator.
     The buddy system organizes free memory in blocks of various orders.
diff --git a/fs/proc/page.c b/fs/proc/page.c
index 1356aeffd8dc..195b077c0fac 100644
--- a/fs/proc/page.c
+++ b/fs/proc/page.c
@@ -125,7 +125,7 @@ u64 stable_page_flags(struct page *page)
 	/*
 	 * pseudo flags for the well known (anonymous) memory mapped pages
 	 *
-	 * Note that page->_mapcount is overloaded in SLAB/SLUB, so the
+	 * Note that page->_mapcount is overloaded in SLAB, so the
 	 * simple test in page_mapped() is not enough.
 	 */
 	if (!PageSlab(page) && page_mapped(page))
@@ -165,8 +165,8 @@ u64 stable_page_flags(struct page *page)
 
 
 	/*
-	 * Caveats on high order pages: page->_refcount will only be set
-	 * -1 on the head page; SLAB/SLUB do the same for PG_slab;
+	 * Caveats on high order pages: PG_buddy and PG_slab will only be set
+	 * on the head page.
 	 */
 	if (PageBuddy(page))
 		u |= 1 << KPF_BUDDY;
@@ -184,7 +184,7 @@ u64 stable_page_flags(struct page *page)
 	u |= kpf_copy_bit(k, KPF_LOCKED,	PG_locked);
 
 	u |= kpf_copy_bit(k, KPF_SLAB,		PG_slab);
-	if (PageTail(page) && PageSlab(compound_head(page)))
+	if (PageTail(page) && PageSlab(page))
 		u |= 1 << KPF_SLAB;
 
 	u |= kpf_copy_bit(k, KPF_ERROR,		PG_error);




  reply	other threads:[~2023-03-15 11:06 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-10 10:32 [PATCH 0/7] remove SLOB and allow kfree() with kmem_cache_alloc() Vlastimil Babka
2023-03-10 10:32 ` [PATCH 1/7] mm/slob: remove CONFIG_SLOB Vlastimil Babka
2023-03-14  7:18   ` Hyeonggon Yoo
2023-03-14 22:11   ` Lorenzo Stoakes
2023-03-10 10:32 ` [PATCH 2/7] net: skbuff: remove SLOB-specific ifdefs Vlastimil Babka
2023-03-10 10:32 ` [PATCH 3/7] mm, page_flags: remove PG_slob_free Vlastimil Babka
2023-03-14  7:25   ` Hyeonggon Yoo
2023-03-14 22:12   ` Lorenzo Stoakes
2023-03-10 10:32 ` [PATCH 4/7] mm, pagemap: remove SLOB and SLQB from comments and documentation Vlastimil Babka
2023-03-14  8:19   ` Hyeonggon Yoo
2023-03-15 11:05     ` Vlastimil Babka [this message]
2023-03-14 22:16   ` Lorenzo Stoakes
2023-03-10 10:32 ` [PATCH 5/7] mm/slab: remove CONFIG_SLOB code from slab common code Vlastimil Babka
2023-03-14  9:28   ` Hyeonggon Yoo
2023-03-14 22:16     ` Lorenzo Stoakes
2023-03-10 10:32 ` [PATCH 6/7] mm/slob: remove slob.c Vlastimil Babka
2023-03-14  9:34   ` Hyeonggon Yoo
2023-03-14 22:18   ` Lorenzo Stoakes
2023-03-15  2:54   ` Roman Gushchin
2023-03-10 10:32 ` [PATCH 7/7] mm/slab: document kfree() as allowed for kmem_cache_alloc() objects Vlastimil Babka
2023-03-12  9:59   ` Mike Rapoport
2023-03-15 13:38     ` Vlastimil Babka
2023-03-15 14:50       ` Mike Rapoport
2023-03-11  1:00 ` [PATCH 0/7] remove SLOB and allow kfree() with kmem_cache_alloc() Jakub Kicinski
2023-03-12  9:51 ` Mike Rapoport
2023-03-13 16:31   ` Steven Rostedt
2023-03-13 18:00     ` Mike Rapoport
2023-03-15 13:53     ` Vlastimil Babka
2023-03-15 14:20       ` Steven Rostedt
2023-03-15 14:22         ` Vlastimil Babka
2023-03-13 16:36   ` Vlastimil Babka
2023-03-14 22:10     ` Lorenzo Stoakes
2023-03-15 13:40       ` Vlastimil Babka

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=bfacefe6-5852-3101-a016-3ee288a4e447@suse.cz \
    --to=vbabka@suse.cz \
    --cc=42.hyeyoo@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lstoakes@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=patches@lists.linux.dev \
    --cc=penberg@kernel.org \
    --cc=rcu@vger.kernel.org \
    --cc=rientjes@google.com \
    --cc=roman.gushchin@linux.dev \
    /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