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]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4C987C282C5 for ; Mon, 3 Mar 2025 10:30:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C1CA46B008C; Mon, 3 Mar 2025 05:30:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BA4DE6B0093; Mon, 3 Mar 2025 05:30:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9F7246B0095; Mon, 3 Mar 2025 05:30:15 -0500 (EST) 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 7BAB16B008C for ; Mon, 3 Mar 2025 05:30:15 -0500 (EST) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 9975F1A0698 for ; Mon, 3 Mar 2025 10:30:14 +0000 (UTC) X-FDA: 83179869948.07.DEED390 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf22.hostedemail.com (Postfix) with ESMTP id 469F9C0009 for ; Mon, 3 Mar 2025 10:30:12 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="U//YYVgI"; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf22.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1740997812; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=XrsGCGG9AtfSViD3RsQm+eGPnJF4uoft9nYq0L+9jdk=; b=Gmq63FPEzCHB92S8lcEgeccdKoLzOKE6K0mOr3VaOrJVs6LMx+J0Odvip/cYeALWUpGnJV rwyeCx4ZQGPTZ/4TC57Iit28FK9S1PPZDBVti9GzCO4jWTjQvZqBGegEAC/124VKXCg21b j+ItBLfFyRcXKBbywg0pq6njNWIj4n0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1740997812; a=rsa-sha256; cv=none; b=dNuWAgQv/6cswiuomCGU7epYdj1IhnaA63vIg+8FRRLIE7zrQe0HogbS1YxzUPyHSAFxpx m1zvR62+vnsZhEoAGKX9UEMexuj3ajyNpFN+2S/tvbQZYMoOwA8RJMT41jLb0vGntTq02h xSBVhun5Un4PN21SIA20M9WiRUN3HdA= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="U//YYVgI"; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf22.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1740997811; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=XrsGCGG9AtfSViD3RsQm+eGPnJF4uoft9nYq0L+9jdk=; b=U//YYVgIC/i9tCAVRzxbclP+t+L5qVJfRCw/dKtWbb6EMV2D1NXKFSPw4//qfZhFLp4Gh1 L2UWH9jzHpUJV26E6JU60K5nYRMXiUm/MlqdQWnE9GuGSJPsb7KSuva6/QMfZ0l2l7fOhp oeh5SFfrXW7i4d+Lr+pxx053D9xKKe0= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-372-SGluVNIdNGWLipHpTpknXg-1; Mon, 03 Mar 2025 05:30:05 -0500 X-MC-Unique: SGluVNIdNGWLipHpTpknXg-1 X-Mimecast-MFC-AGG-ID: SGluVNIdNGWLipHpTpknXg_1740997804 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-3910034500eso576164f8f.1 for ; Mon, 03 Mar 2025 02:30:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740997804; x=1741602604; h=content-transfer-encoding:in-reply-to:organization:autocrypt :content-language:from:references:cc:to:subject:user-agent :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=XrsGCGG9AtfSViD3RsQm+eGPnJF4uoft9nYq0L+9jdk=; b=Z6otDJhvbcBYQnr9X1tTR0D4+BnYjPZyqsdc7oYzK1G9kop6TfYroujH25KBWs8+4x +m7i8WDOvG58FRGNRuSa1SFV/TccsHf7io8YeDah+1dcIn6pNQv8frUgVNv+32jd35NW L9AT0H0Y7isHP3bLNXgoph667BIgLdOi0GIn9hX5P4bt5RKH6B1rTYaeJYgOOqSmIK2J xWSzkZcmM/TAC2H3WZKpWT7BDOwyOWKjuvuUnvCYgtDrP3jQ0vu5sq/0+TTR6LPwjGvZ qqP1rEAJZgStBHPOzfN2pYb3efHBThV9Avy/N34bjmC9mZCwaOY/NC7nvh8pVrFR5Quz A3FA== X-Gm-Message-State: AOJu0YzBEThh/AVRn5MT8i+Ocx8ir8iH3wxhvfXfbpZA8lYy0gP+Ld9y g9io8j9mWpGOJgs7rQKvswf+3X1dQHCpnxeYAZz3Zjrj/XSwmrAKe9mGzjcPmLmEYeVN36ojvgA 2vnrvS+rncIKyaVdDrpzKezhWSfCPY27SYwafdsqwURMtCbhk X-Gm-Gg: ASbGncsVeoTzDIO7Fhg75AIwJOl75KIemN3FqzN9Lv8CXTIsQaXZVVQ0pM3IE6me5XV TBd+mctT4yBXF3YFo76oS+rA5Gbw+T8hqftrfXUlC32qcbJ/aCy0QPlydRif/BCkw+a7PrLQ42l I86xVJjfv8qXnUnEWbdwl8y99qXkUnh7EkFVKcgUctsHCXh+flfj52zL8roBcw9lm8GP2kSqTGe pByFl+Tq1PZvbLp+RQdZ01cv2Tva2h7koaPKpeC0qjVH4EXx06+xEjkziv7waHoBFfBtUvD2WBe 9xD6FD+PEu4v3r/vv+Bn+4rNmqQ985aDXcLs9N8EKahf/O3lsKp74Xpmigb7PYn44jN1C6m8lHi tSyncVZsGGXJacsi5GkDyRKi9M5FwNphdk4RS0YJG4io= X-Received: by 2002:a05:6000:186f:b0:390:fbba:e64e with SMTP id ffacd0b85a97d-390fbbb1cc2mr7331365f8f.38.1740997804364; Mon, 03 Mar 2025 02:30:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IFHoLAZ6fEWXVIxhxcXtWWYyuOPAHrr7D24c6RFsAPg6NR1E/hXM+QKIu4+7Y0Ej8r5W1JDdQ== X-Received: by 2002:a05:6000:186f:b0:390:fbba:e64e with SMTP id ffacd0b85a97d-390fbbb1cc2mr7331318f8f.38.1740997803893; Mon, 03 Mar 2025 02:30:03 -0800 (PST) Received: from ?IPV6:2003:cb:c734:9600:af27:4326:a216:2bfb? (p200300cbc7349600af274326a2162bfb.dip0.t-ipconnect.de. [2003:cb:c734:9600:af27:4326:a216:2bfb]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-390e47b7b6asm14383034f8f.51.2025.03.03.02.30.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 03 Mar 2025 02:30:03 -0800 (PST) Message-ID: <34388e5d-f9d1-4d29-a0e0-202a9fad345f@redhat.com> Date: Mon, 3 Mar 2025 11:30:02 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 1/4] mm: Fix lazy mmu docs and usage To: Ryan Roberts , Andrew Morton , "David S. Miller" , Andreas Larsson , Juergen Gross , Boris Ostrovsky , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , "Matthew Wilcox (Oracle)" , Catalin Marinas Cc: linux-mm@kvack.org, sparclinux@vger.kernel.org, xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org References: <20250302145555.3236789-1-ryan.roberts@arm.com> <20250302145555.3236789-2-ryan.roberts@arm.com> <5418a661-dbd0-46e9-8ef7-b1c5a34acce3@redhat.com> <1ff509c7-187b-4e43-b266-db8ada33b9a2@arm.com> From: David Hildenbrand Autocrypt: addr=david@redhat.com; keydata= xsFNBFXLn5EBEAC+zYvAFJxCBY9Tr1xZgcESmxVNI/0ffzE/ZQOiHJl6mGkmA1R7/uUpiCjJ dBrn+lhhOYjjNefFQou6478faXE6o2AhmebqT4KiQoUQFV4R7y1KMEKoSyy8hQaK1umALTdL QZLQMzNE74ap+GDK0wnacPQFpcG1AE9RMq3aeErY5tujekBS32jfC/7AnH7I0v1v1TbbK3Gp XNeiN4QroO+5qaSr0ID2sz5jtBLRb15RMre27E1ImpaIv2Jw8NJgW0k/D1RyKCwaTsgRdwuK Kx/Y91XuSBdz0uOyU/S8kM1+ag0wvsGlpBVxRR/xw/E8M7TEwuCZQArqqTCmkG6HGcXFT0V9 PXFNNgV5jXMQRwU0O/ztJIQqsE5LsUomE//bLwzj9IVsaQpKDqW6TAPjcdBDPLHvriq7kGjt WhVhdl0qEYB8lkBEU7V2Yb+SYhmhpDrti9Fq1EsmhiHSkxJcGREoMK/63r9WLZYI3+4W2rAc UucZa4OT27U5ZISjNg3Ev0rxU5UH2/pT4wJCfxwocmqaRr6UYmrtZmND89X0KigoFD/XSeVv jwBRNjPAubK9/k5NoRrYqztM9W6sJqrH8+UWZ1Idd/DdmogJh0gNC0+N42Za9yBRURfIdKSb B3JfpUqcWwE7vUaYrHG1nw54pLUo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ImzTDLX9S4g/8 kC4HRcclk8hpyhY2jKGluZO0awwTIMgVEzmTyBphDg/Gx7dZU1Xf8HFuE+UZ5UDHDTnwgv7E th6RC9+WrhDNspZ9fJjKWRbveQgUFCpe1sa77LAw+XFrKmBHXp9ZVIe90RMe2tRL06BGiRZr jPrnvUsUUsjRoRNJjKKA/REq+sAnhkNPPZ/NNMjaZ5b8Tovi8C0tmxiCHaQYqj7G2rgnT0kt WNyWQQ== Organization: Red Hat In-Reply-To: <1ff509c7-187b-4e43-b266-db8ada33b9a2@arm.com> X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: zx3ikY4I6A-Cw9lkacLSE9Zfoom9JExIW_QL2WyP0As_1740997804 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 469F9C0009 X-Stat-Signature: qrzc74c6x5ph4k5ysx67k4fc6oi5dh13 X-HE-Tag: 1740997812-129260 X-HE-Meta: U2FsdGVkX19T25M/NMaD163/fc5rEd38WIE2/uGMBIJAlWcUsXeWQDsY3WOfWIItLOwfMQw8EHX26u9rGwke0ywppEG2ckvx9zz+fDURBaZaA14jbNSm4+0RBs6Kv5zYv652HbOMiT7nRvBvQrRHyji9vNofcFXWy+z4r/XSqaLwlb0GYg+MQH7s3svyfWU2DeQnSpVGuqzCUfEL1WrDuOgDbidrkMFvvIzDwQP0RBio+tDua4bH/+nOya6zzxEZQn4g4upVQiA1zL8LcU7J3HTM4IRKJ/8vcsx4W6Ro7OGUqo6dZJrf0gCpRXklW2HVnlPb2mFKE1t5qgf77TbzS2GmqjBIgplZAqBKy8M3I5DFd8qG/ltLv+hWnIpeN9PSI/4j1DHj0gIY1wZaad7E5Dlvntr5R5YppQ6CfNdrWBcE9ris8hIVaoMhY7ZKbhc6gnJsuZllg9SDkxhg/ppkpQ4x03qDZTrEiBjWo1z3N4J3QghHfOOmWZA+GtLTlp3glZjt1pgj+A03d2xF04jaNhVkDTXUbfvXfBY1i/CFOGBRPEMsx23XuMBstBeC5IvVa7SOAHbW/COeksdREeOIQbgoMeyIgJACAUoBVCRqjitbeR+k1jEx/amyVRyNR3/Ny7fhxl/Ox4BuVLHaqioWWC2L6Ejs+BloUF7Q408/vncvnmedDZqA5iCNVlgTWtCHhncyhpcxn+BSnBh6lzcTX91u54JfJcvZMTxcUGEOsISaOJDBlAGDDrsZe80GVEpdt8V4mrgd7HdKzFwNRpac3Xu2vqQybSAiRP3tPmM5Znn+1pUGIatE8uzVUzNfvUfRIq5DSvv9dOHzI1th36h2da1tgZE92yYeBea5TWPyeJnjR3NxH3UfAsGx75bS4JXi0xPmp+tLCMRc3QgNm0gmjhGI91JOI3gvC/fRowixyRPqtS0zublq1r9oBcRPlaxopYOld4Jq7RTXRPuGMtu fAhKh4B5 SBOdI/KY+acwfHoLT9KK/jTgFkqtxHmoJFfHksdVJP+YPgYcDAtX3HGkMQtlryYrj1FBeYAbDtcPIuxU4rLYR5KRPYZdRJgA8Z4Jgj9wQe2IATUJbQ8WpZuJhm5VYeGaVV6T37mcPQ85vf54cxoOiE87ryhCHjYIzTEvAMbU4ekeCr25MMvqKogi7PS/P+wWPbPrDvM8dr+Hcisz6vrBv6ajdHXZy16ZblODltK93XIL5HjAdPKRSvKne/C8Ho5VMesJI8bLuQ67LU5rJXq5b+W008xLMvYrVuVzpf4JIKNEWLkAiLph8R6DXBzvkEyGY4PmpCr97SbCGQ5leJu2xAqrSRCcVSG54lGVjoOjMBgT2oaqHUKEWBNRWQlI2Eh+0EgTuDZd3ln8Msj4b+B8O6j4Y2eIAB5rL92Cw6hCQRjF8gMA= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On 03.03.25 11:22, Ryan Roberts wrote: > On 03/03/2025 08:52, David Hildenbrand wrote: >> On 03.03.25 09:49, David Hildenbrand wrote: >>> On 02.03.25 15:55, Ryan Roberts wrote: >>>> The docs, implementations and use of arch_[enter|leave]_lazy_mmu_mode() >>>> is a bit of a mess (to put it politely). There are a number of issues >>>> related to nesting of lazy mmu regions and confusion over whether the >>>> task, when in a lazy mmu region, is preemptible or not. Fix all the >>>> issues relating to the core-mm. Follow up commits will fix the >>>> arch-specific implementations. 3 arches implement lazy mmu; powerpc, >>>> sparc and x86. >>>> >>>> When arch_[enter|leave]_lazy_mmu_mode() was first introduced by commit >>>> 6606c3e0da53 ("[PATCH] paravirt: lazy mmu mode hooks.patch"), it was >>>> expected that lazy mmu regions would never nest and that the appropriate >>>> page table lock(s) would be held while in the region, thus ensuring the >>>> region is non-preemptible. Additionally lazy mmu regions were only used >>>> during manipulation of user mappings. >>>> >>>> Commit 38e0edb15bd0 ("mm/apply_to_range: call pte function with lazy >>>> updates") started invoking the lazy mmu mode in apply_to_pte_range(), >>>> which is used for both user and kernel mappings. For kernel mappings the >>>> region is no longer protected by any lock so there is no longer any >>>> guarantee about non-preemptibility. Additionally, for RT configs, the >>>> holding the PTL only implies no CPU migration, it doesn't prevent >>>> preemption. >>>> >>>> Commit bcc6cc832573 ("mm: add default definition of set_ptes()") added >>>> arch_[enter|leave]_lazy_mmu_mode() to the default implementation of >>>> set_ptes(), used by x86. So after this commit, lazy mmu regions can be >>>> nested. Additionally commit 1a10a44dfc1d ("sparc64: implement the new >>>> page table range API") and commit 9fee28baa601 ("powerpc: implement the >>>> new page table range API") did the same for the sparc and powerpc >>>> set_ptes() overrides. >>>> >>>> powerpc couldn't deal with preemption so avoids it in commit >>>> b9ef323ea168 ("powerpc/64s: Disable preemption in hash lazy mmu mode"), >>>> which explicitly disables preemption for the whole region in its >>>> implementation. x86 can support preemption (or at least it could until >>>> it tried to add support nesting; more on this below). Sparc looks to be >>>> totally broken in the face of preemption, as far as I can tell. >>>> >>>> powewrpc can't deal with nesting, so avoids it in commit 47b8def9358c >>>> ("powerpc/mm: Avoid calling arch_enter/leave_lazy_mmu() in set_ptes"), >>>> which removes the lazy mmu calls from its implementation of set_ptes(). >>>> x86 attempted to support nesting in commit 49147beb0ccb ("x86/xen: allow >>>> nesting of same lazy mode") but as far as I can tell, this breaks its >>>> support for preemption. >>>> >>>> In short, it's all a mess; the semantics for >>>> arch_[enter|leave]_lazy_mmu_mode() are not clearly defined and as a >>>> result the implementations all have different expectations, sticking >>>> plasters and bugs. >>>> >>>> arm64 is aiming to start using these hooks, so let's clean everything up >>>> before adding an arm64 implementation. Update the documentation to state >>>> that lazy mmu regions can never be nested, must not be called in >>>> interrupt context and preemption may or may not be enabled for the >>>> duration of the region. >>>> >>>> Additionally, update the way arch_[enter|leave]_lazy_mmu_mode() is >>>> called in pagemap_scan_pmd_entry() to follow the normal pattern of >>>> holding the ptl for user space mappings. As a result the scope is >>>> reduced to only the pte table, but that's where most of the performance >>>> win is. While I believe there wasn't technically a bug here, the >>>> original scope made it easier to accidentally nest or, worse, >>>> accidentally call something like kmap() which would expect an immediate >>>> mode pte modification but it would end up deferred. >>>> >>>> arch-specific fixes to conform to the new spec will proceed this one. >>>> >>>> These issues were spotted by code review and I have no evidence of >>>> issues being reported in the wild. >>>> >>> >>> All looking good to me! >>> >>> Acked-by: David Hildenbrand >>> >> >> ... but I do wonder if the set_ptes change should be split from the pagemap change. > > So set_ptes + docs changes in one patch, and pagemap change in another? I can do > that. Yes. > > I didn't actually cc stable on these, I'm wondering if I should do that? Perhaps > for all patches except the pagemap change? That would make sense to me. CC stable likely doesn't hurt here. (although I wonder if anybody cares about stable on sparc :)) -- Cheers, David / dhildenb