linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Sidhartha Kumar <sidhartha.kumar@oracle.com>
To: SeongJae Park <sj@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	akpm@linux-foundation.org, willy@infradead.org, vbabka@suse.cz,
	jannh@google.com, pfalcato@suse.de, lorenzo.stoakes@oracle.com,
	Liam.Howlett@oracle.com
Subject: Re: [PATCH] mm/nommu: convert kobjsize() to folios
Date: Fri, 1 Aug 2025 16:17:45 -0400	[thread overview]
Message-ID: <23cfeef5-8e3e-4ac9-85e1-03571ec820b5@oracle.com> (raw)
In-Reply-To: <20250801193537.1149-1-sj@kernel.org>

On 8/1/25 3:35 PM, SeongJae Park wrote:
> On Thu, 31 Jul 2025 20:26:29 +0000 Sidhartha Kumar <sidhartha.kumar@oracle.com> wrote:
> 
>> Simple folio conversion to remove a user of PageSlab() and
>> PageCompound().
>>
>> Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
> 
> I have a trivial comment below, but since it is just a trivial one that I don't
> really care,
> 
> Reviewed-by: SeongJae Park <sj@kernel.org>
> 

>>   	/*
>> -	 * If it's not a compound page, see if we have a matching VMA
>> +	 * If it's not a compound folio, see if we have a matching VMA
> 
> Nit.  I think "a large folio" rather than "a compound folio" is more consistent
> and easier to read/understand.  No strong opinion, though.

I agree, "large folio" is used throughout the kernel rather than 
compound folio. I'll send a v2 with this change.

Thanks,
Sid

> 
>>   	 * region. This test is intentionally done in reverse order,
>>   	 * so if there's no VMA, we still fall through and hand back
>> -	 * PAGE_SIZE for 0-order pages.
>> +	 * PAGE_SIZE for 0-order folios.
>>   	 */
>> -	if (!PageCompound(page)) {
>> +	if (!folio_test_large(folio)) {
>>   		struct vm_area_struct *vma;
>>   
>>   		vma = find_vma(current->mm, (unsigned long)objp);
>> @@ -100,7 +100,7 @@ unsigned int kobjsize(const void *objp)
>>   	 * The ksize() function is only guaranteed to work for pointers
>>   	 * returned by kmalloc(). So handle arbitrary pointers here.
>>   	 */
>> -	return page_size(page);
>> +	return folio_size(folio);
>>   }
>>   
>>   void vfree(const void *addr)
>> -- 
>> 2.43.0
> 
> 
> Thanks,
> SJ



      reply	other threads:[~2025-08-01 20:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-31 20:26 [PATCH] mm/nommu: convert kobjsize() to folios Sidhartha Kumar
2025-08-01 19:35 ` SeongJae Park
2025-08-01 20:17   ` Sidhartha Kumar [this message]

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=23cfeef5-8e3e-4ac9-85e1-03571ec820b5@oracle.com \
    --to=sidhartha.kumar@oracle.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=jannh@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=pfalcato@suse.de \
    --cc=sj@kernel.org \
    --cc=vbabka@suse.cz \
    --cc=willy@infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).