From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B5485348C7D for ; Thu, 16 Jul 2026 09:02:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784192536; cv=none; b=PYf0hW1RMNZK5KzY3VgdkwMHfSOMlwR6D7wL526GYLesZj22jQKgXcJBb9/SybEmRsdIs8q1gVnW+QKtAiXrck3xg6Eu8k+7durK0+E4QbeJKZgxmXKkwq2R4IZ2d42YC6Vo3DkLdVy72rXtFpz1BBvlse7l2CPC+8f+tLt4HrI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784192536; c=relaxed/simple; bh=273adRqpNJGWiAkYv0iF7+VezOzxA3GrGCQ0Tal6zq0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=KBPIJxRwyu+7+yiISfs+ilW+yoYETjkg6dDakUf7R9ajifhq/JnCnkVwaj9GEwReZRn729uQh3Tpg8s05X/LrY8CEuI8Pek85UUTd/Rwm6NVqpy3fvJKebs+9BoWV1k+LMTEJJpzEpjlg+52J+xn3lPW4zFLQ4UclJAPPz/d4qc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=pgdmTPPD; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="pgdmTPPD" Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DFFF5339; Thu, 16 Jul 2026 02:02:03 -0700 (PDT) Received: from [10.164.19.52] (unknown [10.164.19.52]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BEA063F7B4; Thu, 16 Jul 2026 02:02:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1784192528; bh=273adRqpNJGWiAkYv0iF7+VezOzxA3GrGCQ0Tal6zq0=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=pgdmTPPDUSO9QfFsTSjVBn22VKZ4cCNO7yUndaJz17tABZkZ0U6PUX817Veq+uckU aVAHIbjo3DaLrCE9QGLHeBAxQCl1wAz5t1Q5BKkNusfR+0/clvNq5aqo/RDzHQsYVr izHqXf+AhZBlD+o9OFq8ngntnzG+NwJsf/Ay50zg= Message-ID: <94727016-c2a9-42fa-ab3f-87661ff3e0d5@arm.com> Date: Thu, 16 Jul 2026 14:32:02 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] mm/khugepaged: use page_cache_sync_ra() directly To: Aditya Prakash Srivastava , Andrew Morton , David Hildenbrand , Lorenzo Stoakes Cc: Zi Yan , Baolin Wang , "Liam R . Howlett" , Nico Pache , Ryan Roberts , Barry Song , Lance Yang , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20260716083211.2688-1-aditya.ansh182@gmail.com> Content-Language: en-US From: Dev Jain In-Reply-To: <20260716083211.2688-1-aditya.ansh182@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 16/07/26 2:02 pm, 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 How exactly is this a legacy interface? > 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. I can see multiple callers of page_cache_sync_readahead. > > No functional change is introduced, as the logic and behavior > remain identical. > > Signed-off-by: Aditya Prakash Srivastava > --- > 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); > /* drain lru cache to help folio_isolate_lru() */ > lru_add_drain(); > folio = filemap_lock_folio(mapping, index);