From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7AD1774BE1 for ; Tue, 23 Jun 2026 16:47:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782233257; cv=none; b=rVJBivreos9nLBZm6Fk1sQj7ncTi00CPphP7lxWlOqcZNOq3mnnbPruO+7NO96juN7WnDvpVcMXy8WlK2FEdC+TFLKMTr+TNl+WDMO+kqAFeezpUSM+pdFNdsQDeZDcSVyfF3s5pNkcyrz600od3NMTx/ff/n5XkwA1rnwkTOKU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782233257; c=relaxed/simple; bh=sjf7AfZpfjoZCU+9LCvWQQGxQTM//WcE9GyunG25r1g=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=sFA6aJn1a0iO3KKn6IHEvnqMdXzvSuB3dU0WcH9oGCKw0W5D9kFpmZ/3IJlyEq1Xb1BnlTo+Ae104C+KH7Tf9tw30j6RlY80mZdrKvuwlIH46yMxiG36UOL4/NJQHKzXXXusCfnLahykdD+FkRhZcFBEMmC6gVYEWr3ik1aGKsQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kfGK4fPV; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kfGK4fPV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2EFD21F00A3A; Tue, 23 Jun 2026 16:47:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1782233256; bh=Eg9fwmGWBiInLZvznATwa3S6/VkytEOc0wcDvtX3mn4=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=kfGK4fPVObU3c8XYpSAS4lf8gsRhzLRmgbOcHfgxApgvu55tyrCE8vJZT+R/Hpc0S jW9GbBH+4TloDgnu8VWzAVwpeArVAxKZaQwhb3G3ZxeOxARio7D9h6FI4h6Wlp/48q aEi8d+1j3T94AbFusHL2EO0JgR5JnQ46yaGWF+ZtYwNbAbBgCPQjFUrSmRjtkHl3m5 RkrQVqRUiuQCUtZjk+QaXvXou5beL2tiWXPrlsEVrqcz2/wW06fsx5VaDyLR2DVouq w/cCMsNDigm8u1zZUPcGdZYsk080DkT6U4R8T7O6Wq3AwFhwbdr3scdCFr2RaMv3L6 OvklbHQ73tPAw== Date: Tue, 23 Jun 2026 17:47:27 +0100 From: Lorenzo Stoakes To: Dev Jain Cc: akpm@linux-foundation.org, chrisl@kernel.org, kasong@tencent.com, liam@infradead.org, shikemeng@huaweicloud.com, nphamcs@gmail.com, baoquan.he@linux.dev, baohua@kernel.org, youngjun.park@lge.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, vbabka@kernel.org, jannh@google.com, pfalcato@suse.de, ryan.roberts@arm.com, anshuman.khandual@arm.com, david@kernel.org Subject: Re: [PATCH 2/2] mm/mprotect: drop 'sub' from batching context Message-ID: References: <20260623125723.2503832-1-dev.jain@arm.com> <20260623125723.2503832-3-dev.jain@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260623125723.2503832-3-dev.jain@arm.com> On Tue, Jun 23, 2026 at 12:57:22PM +0000, Dev Jain wrote: > Shorten the name of page_anon_exclusive_sub_batch by dropping the > "sub-batch" context - the function itself doesn't need this context. > Similarly, drop "sub" from sub_batch_idx, it is unnecessary and the > usage is clear enough. > > Signed-off-by: Dev Jain LGTM, so: Reviewed-by: Lorenzo Stoakes > --- > mm/mprotect.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/mm/mprotect.c b/mm/mprotect.c > index 9cbf932b028cf..c0f5ab74bee23 100644 > --- a/mm/mprotect.c > +++ b/mm/mprotect.c > @@ -143,7 +143,7 @@ static __always_inline void prot_commit_flush_ptes(struct vm_area_struct *vma, > * !PageAnonExclusive() pages, starting from start_idx. Caller must enforce > * that the ptes point to consecutive pages of the same anon large folio. > */ > -static __always_inline int page_anon_exclusive_sub_batch(int start_idx, int max_len, > +static __always_inline int page_anon_exclusive_batch(int start_idx, int max_len, > struct page *first_page, bool expected_anon_exclusive) > { > int idx; > @@ -174,16 +174,16 @@ static __always_inline void commit_anon_folio_batch(struct vm_area_struct *vma, > pte_t oldpte, pte_t ptent, int nr_ptes, struct mmu_gather *tlb) > { > bool expected_anon_exclusive; > - int sub_batch_idx = 0; > + int batch_idx = 0; > int len; > > while (nr_ptes) { > - expected_anon_exclusive = PageAnonExclusive(first_page + sub_batch_idx); > - len = page_anon_exclusive_sub_batch(sub_batch_idx, nr_ptes, > + expected_anon_exclusive = PageAnonExclusive(first_page + batch_idx); > + len = page_anon_exclusive_batch(batch_idx, nr_ptes, > first_page, expected_anon_exclusive); > prot_commit_flush_ptes(vma, addr, ptep, oldpte, ptent, len, > - sub_batch_idx, expected_anon_exclusive, tlb); > - sub_batch_idx += len; > + batch_idx, expected_anon_exclusive, tlb); > + batch_idx += len; > nr_ptes -= len; > } > } > -- > 2.43.0 >