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 60B833368B6 for ; Thu, 5 Mar 2026 05:31:57 +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=1772688719; cv=none; b=Pm2l6a/PYrgAODq39xlD2aBOJ8Q2Z0wGgR4LFVeY7YadKFFmMHh5FJjufAvpaVYDMfYDllgabajLchX/hndZm6NDYGsv4ofgHAe2Y9OMUZzpu9diWwF7FWtIsShN+cwzNPcW1SPsnCg6WOPBdcz1lt3d2HJ6JpMGzBbQUkLDCKw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772688719; c=relaxed/simple; bh=1kwIsbA+O/e3Qy0qDpYExcIl1vcK2X7WFAn2xt3mVFc=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=OfcXknHaAcjQDwehb5c0Jf1Hplf52d0L3W8QUJixpYVEnPp6ofuoIUcfEeKa8zUPbkGgpd9dVieNngpVF7GQZ5ge2sYu+XkM7PfBC/2SaDjPg28q2e3XNe7XHF73JCKPxJAfItDcir2NXUJYesdmSyFnP4MK8Btzpg+cNLqwDm8= 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; 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 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 31811339; Wed, 4 Mar 2026 21:31:50 -0800 (PST) Received: from ergosum.cambridge.arm.com (ergosum.cambridge.arm.com [10.1.196.45]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id D66E43F694; Wed, 4 Mar 2026 21:31:54 -0800 (PST) From: Anshuman Khandual To: linux-arm-kernel@lists.infradead.org Cc: Anshuman Khandual , Catalin Marinas , Will Deacon , Ryan Roberts , David Hildenbrand , Yang Shi , Christoph Lameter , linux-kernel@vger.kernel.org Subject: [PATCH V4 0/2] arm64/mm: Enable batched TLB flush in unmap_hotplug_range() Date: Thu, 5 Mar 2026 05:31:45 +0000 Message-Id: <20260305053148.3765710-1-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.30.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This series enables batched TLB flush in unmap_hotplug_range() which avoids individual page TLB flush for potential CONT blocks in linear mapping while also improving performance due to range based TLB operation along with less synchronization barrier instructions. It also now rejects memory removal that might split a leaf entry in kernel mapping, which would have otherwise required re-structuring using the break before make (BBM) semantics. But kernel cannot tolerate BBM, so remapping to fine grained leaves would not be possible on systems without BBML2_NOABORT. This series applies on 7.0-rc2 and tested on KVM guest. Changes in V4: Accommodated all comments from David H - Dropped 'size' in can_unmap_without_split() - Added BUILD_BUG_ON() for SPARSEMEM_VMEMMAP in can_unmap_without_split() - Added unified comment in addr_splits_kernel_leaf() - Replaced ALIGNED_DOWN() with IS_ALIGNED() - Dropped all PXX_SIZE comments in addr_splits_kernel_leaf() - Dropped the comment in unmap_hotplug_range() - Dropped the comments about TLB flush being essential for freeing memory - Replaced the comments regarding CONT blocks - Replaced the comments as unmap_hotplug_range() flushes TLB for !free_mapped - Dropped "Fixes:" and "Closes:" tag from [PATCH 2/2], added "Link:" instead Changes in V3: https://lore.kernel.org/all/20260224062423.972404-1-anshuman.khandual@arm.com/ - Fixed some typos in the commit message for [PATCH 2/2] - Dropped copying stable@vger.kernel.org per Ryan Changes in V2: https://lore.kernel.org/all/20260203130348.612150-1-anshuman.khandual@arm.com/ - Renamed split_kernel_leaf_boundary() as addr_splits_kernel_leaf() - Dropped pte_valid()/pmd_leaf() before checking pte_cont()/pmd_cont() - Changed and dropped variables in can_unmap_without_split() - Moved can_unmap_without_split() after boot memory check - Renamed 'prevent_bootmem' as 'prevent_memory' across the board - Updated commit message in both patches Changes in V1: - https://lore.kernel.org/all/20260202042617.504183-1-anshuman.khandual@arm.com/ Cc: Catalin Marinas Cc: Will Deacon Cc: Ryan Roberts Cc: David Hildenbrand Cc: Yang Shi Cc: Christoph Lameter Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Anshuman Khandual (2): arm64/mm: Enable batched TLB flush in unmap_hotplug_range() arm64/mm: Reject memory removal that splits a kernel leaf mapping arch/arm64/mm/mmu.c | 170 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 148 insertions(+), 22 deletions(-) -- 2.30.2