From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 2F261335BCF for ; Mon, 15 Dec 2025 17:16:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765818994; cv=none; b=ltZGzcMZY1IrTqlvDood9HMFQZ+Sc3SPT3rwZaW7S+NZ3GUIlh2lALV0Gm+awiumWby8fRZfE8vjkVBIzxJtsXqMypWanxhKkzilCubq+BPbtMaEy6X+3JF/SaAo1B3UiEPJY8KI4CvRgG0U/SUjXc6qZCRMtTq+ZMNWGAQeETc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765818994; c=relaxed/simple; bh=dkdZNqq2FkFuJEXrW9W6YulDPMnWfnjaqSgQIVAyx1c=; h=Date:To:From:Subject:Message-Id; b=Ly4L3HWY73MtemT65Lb5+FBb+cuRi3d5lLFQY8/+63+D1+J/keyWqmIZr7TS57exc8VcOt87OdNXZyKrNqFxFmlnLu2sZZTR+n2Lf8/rbVL3F/D0wy5t5r79ZNoBSMtzAeQXbGpYnDz6ieLl1T3/Y68jEfCl3MaEpec8z+lfrXg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=ZliVCwM7; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="ZliVCwM7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 902BFC4CEF5; Mon, 15 Dec 2025 17:16:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1765818993; bh=dkdZNqq2FkFuJEXrW9W6YulDPMnWfnjaqSgQIVAyx1c=; h=Date:To:From:Subject:From; b=ZliVCwM7nvWnjKLOkNKlX0TaukkbvUequxTH6KLvDuntOT2ESSXn7wXJHsegPC/OK qCpAiF1lORkPjw/n3u+j1LBtV+ouOu38w+Isk3lHnblo2MZ7gTCLwN5FmsZa5J149B eio7tihrsnwLvyocSqmSmqqFfns6VVlWblxau+Pw= Date: Mon, 15 Dec 2025 09:16:33 -0800 To: mm-commits@vger.kernel.org,yeoreum.yun@arm.com,will@kernel.org,venkat88@linux.ibm.com,vbabka@suse.cz,tglx@linutronix.de,surenb@google.com,ryan.roberts@arm.com,rppt@kernel.org,ritesh.list@gmail.com,peterz@infradead.org,npiggin@gmail.com,mpe@ellerman.id.au,mingo@redhat.com,mhocko@suse.com,maddy@linux.ibm.com,lorenzo.stoakes@oracle.com,liam.howlett@oracle.com,jgross@suse.com,jannh@google.com,hpa@zytor.com,dwmw2@infradead.org,david@redhat.com,david@kernel.org,davem@davemloft.net,christophe.leroy@csgroup.eu,catalin.marinas@arm.com,bp@alien8.de,boris.ostrovsky@oracle.com,anshuman.khandual@arm.com,andreas@gaisler.com,agordeev@linux.ibm.com,kevin.brodsky@arm.com,akpm@linux-foundation.org From: Andrew Morton Subject: + mm-clarify-lazy_mmu-sleeping-constraints.patch added to mm-new branch Message-Id: <20251215171633.902BFC4CEF5@smtp.kernel.org> Precedence: bulk X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: The patch titled Subject: mm: clarify lazy_mmu sleeping constraints has been added to the -mm mm-new branch. Its filename is mm-clarify-lazy_mmu-sleeping-constraints.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-clarify-lazy_mmu-sleeping-constraints.patch This patch will later appear in the mm-new branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Note, mm-new is a provisional staging ground for work-in-progress patches, and acceptance into mm-new is a notification for others take notice and to finish up reviews. Please do not hesitate to respond to review feedback and post updated versions to replace or incrementally fixup patches in mm-new. Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Kevin Brodsky Subject: mm: clarify lazy_mmu sleeping constraints Date: Mon, 15 Dec 2025 15:03:14 +0000 The lazy MMU mode documentation makes clear that an implementation should not assume that preemption is disabled or any lock is held upon entry to the mode; however it says nothing about what code using the lazy MMU interface should expect. In practice sleeping is forbidden (for generic code) while the lazy MMU mode is active: say it explicitly. Link: https://lkml.kernel.org/r/20251215150323.2218608-6-kevin.brodsky@arm.com Signed-off-by: Kevin Brodsky Reviewed-by: Yeoreum Yun Cc: Alexander Gordeev Cc: Andreas Larsson Cc: Anshuman Khandual Cc: Borislav Betkov Cc: Boris Ostrovsky Cc: Catalin Marinas Cc: Christophe Leroy Cc: David Hildenbrand Cc: David Hildenbrand (Red Hat) Cc: David S. Miller Cc: David Woodhouse Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Jann Horn Cc: Juegren Gross Cc: Liam Howlett Cc: Lorenzo Stoakes Cc: Madhavan Srinivasan Cc: Michael Ellerman Cc: Michal Hocko Cc: Mike Rapoport Cc: Nicholas Piggin Cc: Peter Zijlstra Cc: Ritesh Harjani (IBM) Cc: Ryan Roberts Cc: Suren Baghdasaryan Cc: Thomas Gleinxer Cc: Venkat Rao Bagalkote Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton --- include/linux/pgtable.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) --- a/include/linux/pgtable.h~mm-clarify-lazy_mmu-sleeping-constraints +++ a/include/linux/pgtable.h @@ -225,11 +225,15 @@ static inline int pmd_dirty(pmd_t pmd) * up to date. * * In the general case, no lock is guaranteed to be held between entry and exit - * of the lazy mode. So the implementation must assume preemption may be enabled - * and cpu migration is possible; it must take steps to be robust against this. - * (In practice, for user PTE updates, the appropriate page table lock(s) are - * held, but for kernel PTE updates, no lock is held). Nesting is not permitted - * and the mode cannot be used in interrupt context. + * of the lazy mode. (In practice, for user PTE updates, the appropriate page + * table lock(s) are held, but for kernel PTE updates, no lock is held). + * The implementation must therefore assume preemption may be enabled upon + * entry to the mode and cpu migration is possible; it must take steps to be + * robust against this. An implementation may handle this by disabling + * preemption, as a consequence generic code may not sleep while the lazy MMU + * mode is active. + * + * Nesting is not permitted and the mode cannot be used in interrupt context. */ #ifndef __HAVE_ARCH_ENTER_LAZY_MMU_MODE static inline void arch_enter_lazy_mmu_mode(void) {} _ Patches currently in -mm which might be from kevin.brodsky@arm.com are x86-xen-simplify-flush_lazy_mmu.patch powerpc-mm-implement-arch_flush_lazy_mmu_mode.patch sparc-mm-implement-arch_flush_lazy_mmu_mode.patch mm-clarify-lazy_mmu-sleeping-constraints.patch mm-introduce-config_arch_has_lazy_mmu_mode.patch mm-introduce-generic-lazy_mmu-helpers.patch mm-bail-out-of-lazy_mmu_mode_-in-interrupt-context.patch mm-enable-lazy_mmu-sections-to-nest.patch arm64-mm-replace-tif_lazy_mmu-with-is_lazy_mmu_mode_active.patch powerpc-mm-replace-batch-active-with-is_lazy_mmu_mode_active.patch sparc-mm-replace-batch-active-with-is_lazy_mmu_mode_active.patch x86-xen-use-lazy_mmu_state-when-context-switching.patch mm-add-basic-tests-for-lazy_mmu.patch