The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Aditya Prakash Srivastava <aditya.ansh182@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Lorenzo Stoakes <ljs@kernel.org>
Cc: Zi Yan <ziy@nvidia.com>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	"Liam R . Howlett" <liam@infradead.org>,
	Nico Pache <npache@redhat.com>,
	Ryan Roberts <ryan.roberts@arm.com>, Dev Jain <dev.jain@arm.com>,
	Barry Song <baohua@kernel.org>, Lance Yang <lance.yang@linux.dev>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/khugepaged: use page_cache_sync_ra() directly
Date: Thu, 16 Jul 2026 11:08:29 +0200	[thread overview]
Message-ID: <768bb311-c500-4010-bdcb-c7ad4e179380@kernel.org> (raw)
In-Reply-To: <20260716083211.2688-1-aditya.ansh182@gmail.com>

On 7/16/26 10:32, Aditya Prakash Srivastava wrote:
> The static inline page_cache_sync_readahead() wrapper in pagemap.h
> is legacy and only wraps page_cache_sync_ra() after initializing
> a local readahead_control structure using DEFINE_READAHEAD.
> 
> Modernize the khugepaged readahead call by using page_cache_sync_ra()
> directly. This avoids the legacy wrapper and aligns the khugepaged
> readahead implementation with other subsystems in the kernel.
> 
> No functional change is introduced, as the logic and behavior
> remain identical.
> 
> Signed-off-by: Aditya Prakash Srivastava <aditya.ansh182@gmail.com>
> ---
>  mm/khugepaged.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/mm/khugepaged.c b/mm/khugepaged.c
> index 617bca76db49..2682b39401b2 100644
> --- a/mm/khugepaged.c
> +++ b/mm/khugepaged.c
> @@ -2331,10 +2331,10 @@ static enum scan_result collapse_file(struct mm_struct *mm, unsigned long addr,
>  			}
>  		} else {	/* !is_shmem */
>  			if (!folio || xa_is_value(folio)) {
> +				DEFINE_READAHEAD(ractl, file, &file->f_ra, mapping, index);
> +
>  				xas_unlock_irq(&xas);
> -				page_cache_sync_readahead(mapping, &file->f_ra,
> -							  file, index,
> -							  end - index);
> +				page_cache_sync_ra(&ractl, end - index);

The page_cache_sync_readahead() call nicely wraps these two things.

You are essentially duplicating code, no?

So I also miss the point.

-- 
Cheers,

David

  parent reply	other threads:[~2026-07-16  9:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-16  8:32 [PATCH] mm/khugepaged: use page_cache_sync_ra() directly Aditya Prakash Srivastava
2026-07-16  9:02 ` Dev Jain
2026-07-16  9:08 ` David Hildenbrand (Arm) [this message]
2026-07-16  9:11 ` Lorenzo Stoakes (ARM)
2026-07-16  9:16   ` Aditya Prakash Srivastava

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=768bb311-c500-4010-bdcb-c7ad4e179380@kernel.org \
    --to=david@kernel.org \
    --cc=aditya.ansh182@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=baohua@kernel.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=dev.jain@arm.com \
    --cc=lance.yang@linux.dev \
    --cc=liam@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=npache@redhat.com \
    --cc=ryan.roberts@arm.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