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 4784B23A9BD for ; Tue, 23 Jun 2026 12:57:49 +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=1782219470; cv=none; b=X1qDtmYGssTRaZzzX87fPstMg5K+zhxWo7vf2mTuSsWw4RdSJrzCIzrRiu39MBplptANXAralP8elzPavTRZgU3meShYsF9b2ZFOBQkJVwuDLRykmqqD6lAwvsxSxPe7Wms7Wpb8K0E++QI86HDOdRG/vbjtajn+KiT4BubH6tw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782219470; c=relaxed/simple; bh=eMg9F/xqCrVT+AB0waVn//uqW7SETlXSJS0RCebrHew=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ElPCP6tN9HHTvDBVEDJwdqQkUwwQecTh6iRxGqQfe43E5I9xcNT/Bl3ExnnNxiV8D4ytJsUi4rX8fnLuKJ0b0iU8EXHSDe5v9EtjKc0hAwDqf5lovn9TIJJ0aUF++xQDJxZ6/pwLWCzs2eQWj7kACNftOiVageoaDGaqY7Si0w8= 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=eJOOzQXm; 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="eJOOzQXm" 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 EDBA61A25; Tue, 23 Jun 2026 05:57:43 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-01.blr.arm.com (cesw-amp-gbt-1s-m12830-01.blr.arm.com [10.164.195.31]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 847373F632; Tue, 23 Jun 2026 05:57:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1782219468; bh=eMg9F/xqCrVT+AB0waVn//uqW7SETlXSJS0RCebrHew=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eJOOzQXmgJSLiT61SaG2LjLNZLUitWzRxA1muWKM2EZSCE1df8lSz2OlcmfAMzU0j 4lvgi0vA/p9GzX7OQfEWjgXikDCkEBFtEFFlDYWprEoGNukqOssZe0jDrPZZV93Dmu ahRGPh8P/8+Jr+tfxIgZCraGbJVMKQ/9nLDfJYBc= From: Dev Jain To: akpm@linux-foundation.org, chrisl@kernel.org, kasong@tencent.com, liam@infradead.org, ljs@kernel.org Cc: Dev Jain , 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: [PATCH 2/2] mm/mprotect: drop 'sub' from batching context Date: Tue, 23 Jun 2026 12:57:22 +0000 Message-ID: <20260623125723.2503832-3-dev.jain@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260623125723.2503832-1-dev.jain@arm.com> References: <20260623125723.2503832-1-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-Transfer-Encoding: 8bit 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 --- 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