From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A3109F45A19 for ; Sat, 11 Apr 2026 09:31:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CB8506B0089; Sat, 11 Apr 2026 05:31:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C69706B008A; Sat, 11 Apr 2026 05:31:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B58276B0092; Sat, 11 Apr 2026 05:31:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id A615F6B0089 for ; Sat, 11 Apr 2026 05:31:15 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 01103BB201 for ; Sat, 11 Apr 2026 09:31:14 +0000 (UTC) X-FDA: 84645756510.08.5F7EAA0 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf01.hostedemail.com (Postfix) with ESMTP id 9D16240008 for ; Sat, 11 Apr 2026 09:31:12 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=kGS7zkSa; spf=pass (imf01.hostedemail.com: domain of agordeev@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=agordeev@linux.ibm.com; dmarc=pass (policy=none) header.from=ibm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1775899872; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=9G+pDRpTep5hohlw1RQ3G2oELAA0/tYq61fSBJHTJzs=; b=Bips8rdsDt/MoCFNDtw1MRpdqqIRkLo98E0HR7FzgwHBsTzJV+jx94rb7VQTp7rJxG++2E WdZP9Zp+PC4VDY078Usyl413KB5Mb3roAZzb8OCO3Htdg5SgrU4lOV+KUB4ZU2zOzcmUYU 9MXWsNOn4++bIj2VOxLoDDAxgUTu5Qo= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=kGS7zkSa; spf=pass (imf01.hostedemail.com: domain of agordeev@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=agordeev@linux.ibm.com; dmarc=pass (policy=none) header.from=ibm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1775899872; a=rsa-sha256; cv=none; b=mIW5eOvSY8j+oJoAuId8vUkwgYQ847R/etJNq6xfiLPl2ApwRyx08HALmpSCsLoHUE4sBX Z8I56SP5u4Xc4nNIStQrylfnMTYXRd5L7zGJH9KYHG8cP33d8BWm7f8ttO4BeP00i3hl++ +gcHY5YdqBQFw0/w6KArQk6SthK9jdI= Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63B0O5Hg2272213; Sat, 11 Apr 2026 09:31:07 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to; s=pp1; bh=9G+pDRpTep5hohlw1RQ3G2oELAA0/t Yq61fSBJHTJzs=; b=kGS7zkSacYLmsLvFUysSFGicCBlyAlKL6HMymldPK6w75G VcCjRmM4uewiyfHKAMNmPCEazXh5fTUiYwrQdSDYg+TwNoCNr09NsMyD0AM2DUQ4 LOgiHaUFTxSRrZoqpggKzqxS/r9zKNgCKaSWQJNY32x6WH2MPc/G+qJdH3lIvkE2 JfcUe8KLLE85S0C9Ek0Ho7m7/klN2k0UTSVUegwqxvvCmqKbT27YeqbzugYsXQkx WKAjcOetA6NmYn62/rSOnMAOynieiS6rBqD+GMn16N5nXQOgVyBsh7gzN5R4KoB5 L0NYtX9MpaMOUZg0RmS4y1eZmjSVsmbMRobYWvgw== Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4dfbqk90h2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 11 Apr 2026 09:31:07 +0000 (GMT) Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 63B6XKvY014352; Sat, 11 Apr 2026 09:31:06 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 4dcmg54069-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 11 Apr 2026 09:31:06 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 63B9V25q7471396 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 11 Apr 2026 09:31:02 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 692F720043; Sat, 11 Apr 2026 09:31:02 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BDF742004B; Sat, 11 Apr 2026 09:31:01 +0000 (GMT) Received: from li-008a6a4c-3549-11b2-a85c-c5cc2836eea2.ibm.com (unknown [9.87.145.235]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTPS; Sat, 11 Apr 2026 09:31:01 +0000 (GMT) Date: Sat, 11 Apr 2026 11:31:00 +0200 From: Alexander Gordeev To: Kevin Brodsky Cc: "David Hildenbrand (Arm)" , Andrew Morton , Gerald Schaefer , Heiko Carstens , Christian Borntraeger , Vasily Gorbik , linux-s390@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 1/2] mm: make lazy MMU mode context-aware Message-ID: <630ce949-2f9c-43ce-9641-b9a4dc729323-agordeev@linux.ibm.com> References: <44dd86c0-1845-4dd9-b4b4-2cef6d1c6357@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-TM-AS-GCONF: 00 X-Authority-Analysis: v=2.4 cv=I+9Vgtgg c=1 sm=1 tr=0 ts=69da14db cx=c_pps a=aDMHemPKRhS1OARIsFnwRA==:117 a=aDMHemPKRhS1OARIsFnwRA==:17 a=kj9zAlcOel0A:10 a=A5OVakUREuEA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=Y2IxJ9c9Rs8Kov3niI8_:22 a=yduxpkpoCOskwDA0OgQA:9 a=CjuIK1q_8ugA:10 X-Proofpoint-GUID: IpQDT1z9kXrFLsUX7rBCljXm228ZAGrk X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDExMDA3MyBTYWx0ZWRfXxR1CxwqzwPcr aZDOICop81ytS8lVHRni5D3pfDTevXM07MQHpoT0etrTHGeNCpVvGOAori/j9bWeExaGIjmvVjj +byeKj3m97zAAHwHPR7oAyp0kc8VotW+aNEn/aaMrsnZSNJIOxjNYoPuEs30TjDxW5jvfvSo4y/ JRaTa6D3jeeUBrLlAefULj/lYoAu+kbprJe5YJBKhnUaPz+L3ZVTe7mX+7Am1bVw4WDBkh5kdXD UDmTyO2AgZ7A91iiwqDhY9JbkGzmSRIBMfBY2sH5UtFojid4awog5X5Gi5vcYe6o4FfSx0WgyBf q8dYcMl1YZyxYrrkPaN3oklKx1j3fqOOfNrFSWydF52GhHe2i5Y4wS+CVnfcWwy4Mzz3CwLPQb5 p8GFfPvoc3xrV+BMKWRdKxY9jtdcb6fi0CvO3/XDVePQDvKSA9osZ9UtSDe4UuVN75yT4BeZO9R UMxMp2vwMmOGDexwMHg== X-Proofpoint-ORIG-GUID: IpQDT1z9kXrFLsUX7rBCljXm228ZAGrk X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-11_02,2026-04-09_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 bulkscore=0 suspectscore=0 adultscore=0 lowpriorityscore=0 spamscore=0 malwarescore=0 clxscore=1015 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604010000 definitions=main-2604110073 X-Rspam-User: X-Rspamd-Queue-Id: 9D16240008 X-Stat-Signature: wi3ai6ju18oszob13b8xrjh6xwq43hx5 X-Rspamd-Server: rspam06 X-HE-Tag: 1775899872-854937 X-HE-Meta: U2FsdGVkX19crYACmC2G8K4CBk6uLtH3lUI+i9rcUsZ/qgoKAzUU+aKyUZErXFHd6aebewoFd0SFALpLit2iWqBj299HZLO+3b1u8NYSAbYNZR8vQ/TC1Vw4dV3u+zDj+dBsWFOYkfJKJCvMaJ2u0o4cWGL/dbPcWWbruZnBnPIwjUXT77WaHSFtXDTjrkEopDrN/WFQ5o95O4QeffaEvgJc6MaEFuFippNijEWYFB7DQ20uhNMWf2SUbd3nPrXjBK582QmWDvGxiDPGtQ1NMTP953bRjIzzqYlh0aUnANGOVYxZAKFqZH+Beg6rLcO2djZzV8skgGy50m112Gx9vcGJFt1+LCoWYjp0xlMF6xBA6oHG007buDl8QeJBXlT6IT85q4EA8zKbOXJS8/sKg1kw1jw3mPLtiOi0/wY+pnBT6AttA56yIhVbgznjyhiCkNUpXdtTd+WogqwdkMH6rZZnRTzxWaR8149fQO28kGdfnfMG6u33Z8aFXOyNcsJR9TcpT3U8gv3NzOGh35CrPQsP52WLElRce4AInYXiewUXgoR3j+VYa1Hwy1NBn3JiSEKhSzmpFPLa1L4oA3D/+G3iF3uSVT4v5m8XBgj6IA6f3WNo5ay/+ba+izw8hzptKGya0FggGzgovRvCl/dQLv0VVAg22mTjFBKOQWkRLily57jCdQNeqFJDASvaNqKw+wZLAdCX/KuuVuffAMMwfv9lRMR8BMEVEWi1QrBsNed9RLZcjvgCZqbKtFLQFgTOW6qi9O9gFE6doQ0EG6hRtVUErGpM0GhBA/iWU+R8pBU2DkjGqjmwNFEOUMem7mr0TrLFriviyHHc6WdzagCVd/BSshYLwkSPmUV7chWm38sD2zHCVH9+I6nqoc1ZiQuNBzXzUz9nYngt2iHGHf/XoVFIQ3Zk5JtUiHN/E0VXDXcBvLlYH6T1TQ8bJPrOCHAfg2N7o64fjalpAG/XqHp 0b8iAlG9 R+UtPoSZiOOQd1DVhenxsC22E8Q3eytHgq5BgUQ1GJwYSfaXNSV83fbpmyCKqZoWvyfTLBqFFfFJt+kWSKpoMmKK2HETvS+pIgz46qX7udsNzeOclV0ySlcqa1V03Pwg2JK2i27SwwEY4CyE/xMBvj+Fiyg8MvXT2IsNjADNEmkCw23ZE/cmHcWvWexW4D4fe+7k1AsNJbmvd8wug48LcS9vxTZPr2angejObgjzjqtLLoQqZvSVnXP4b1mgEvGJR6SSglSeQjWtV1u1VOYO+m87DjhQidsgasg2RPb/dgmICske5ZkDKcEI60Q== Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Tue, Mar 31, 2026 at 04:15:23PM +0200, Kevin Brodsky wrote: > On 25/03/2026 17:20, Alexander Gordeev wrote: > > On Wed, Mar 25, 2026 at 10:55:23AM +0100, David Hildenbrand (Arm) wrote: > > > > Hi David, > > > >>> +/** > >>> + * lazy_mmu_mode_enable_pte() - Enable the lazy MMU mode with parameters > >> You have to be a lot clearer about implications. For example, what > >> happens if we would bail out and not process all ptes? What are the > >> exact semantics. > > The only implication is "only this address/PTE range could be updated > > and that range may span one page table at most". > > > > Whether all or portion of PTEs were actually updated is not defined, > > just like in case of lazy_mmu_mode_enable_pte(). > > > > Makes sense? > > I also feel that the comment needs to be much more specific. From a > brief glance at patch 2, it seems that __ipte_batch_set_pte() assumes > that all PTEs processed after this function is called are contiguous. No, this is actually not the case. __ipte_batch_set_pte() just sets ceilings for later processing. The PTEs within the range could be updated in any order and not necessarily all of them. > This should be documented. Will do. > > I will also change arch_enter_lazy_mmu_mode_pte() to > > arch_enter_lazy_mmu_mode_for_pte_range() then. > > Makes sense. The interface looks reasonable to me with this new name. > > One more comment though: in previous discussions you mentioned the need > for arch_{pause,resume} hooks, is that no longer necessary simply > because {pause,resume} are not used on the paths where you make use of > the new enable function? Yes. I did implement arch_pause|resume_lazy_mmu_mode() for a custom KASAN sanitizer to catch direct PTE dereferences - ones that bypass ptep_get()/set_pte() in lazy mode. But that code is not upstreamed and therefore there is no need to introduce the hooks just right now. > - Kevin Thanks for the review, Kevin!