From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794846537; b=KQ09ocaezY3AJdfGQ3Xvgb9+DM9Ob+mC0uk7Rh5p1amX4GSYhdmDP+eN2O0jxE1S3RE0 NqgtTwGasZbHLcDHv7bDbWD6Mw5xFXGsMw3g5B6q92Gb8BIcviJZVQuTjKMetvMo9OvPp 5/USJsOURJWhtxlfoQbtAhbrjUlTH/xaGYlVB3OT7G0xkfn6cy5ZJr5UF0dbINGu1KgZ2 1W9Pv7KNWUhuVRQWC7UGmNkG89vhv5kinreUjm5T+6CQYfTL8zziKSzA2UlQnXkCe2kbK YyXALgoiCHp7vMxSAGufrUCrifI2MJiN414ZC253eL8H/fjYBO5XwmZyi+b2+v5i5Gw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794846537; h=Received:DKIM-Signature:Received:Received:X-ME-Sender:X-ME-Received: X-ME-Proxy-Cause:X-ME-Proxy:Feedback-ID:Received:Date:From:To:Cc: Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; bh=s77Wh0jGQ82biYhvC+IxcW28aNcho8DkaL0D/lxzBTs=; b=lH/7ST74HSpa6Xc5lDDe4BtMlg90ick30LznatpJ/85+Ttvhm8toZNpmTPv+vSftOtE7 HDH/F1WgxlAU5F5IIZ62DG0ExblXvI02DUTY/EIEsrSdyNt1YYtdlEetlTFWwRuPTGkGq wQyWhxHTkwVhUs/2lY9mTE4kWDD/A0JAKCVTOZ4O6mD3OIAzX2+X8A9efBOAfaL/jDnqO V4Bn56LoP/02sVDK5cFzOY9inKaLa3HSo/W+o/LJC4Nj1jubanKH9x8UzZWfU0NqzPtq7 Mxx3Kra5u1IJ8XbZ6RFy+3T4p6gf9Mr24kjnN0IaHNtN3ljtFkjJsbGekAzD+S7JQaA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=R+N7uJ6C; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8043C606A33A for ; Mon, 16 Nov 2026 16:28:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=R+N7uJ6C Received: by smtp.kernel.org (Postfix) with ESMTPSA id DBA3E1F000CA; Mon, 16 Nov 2026 16:28:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794846537; bh=s77Wh0jGQ82biYhvC+IxcW28aNcho8DkaL0D/lxzBTs=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=R+N7uJ6CVs7b5bWLMF4HnzoLO2LD3Gsadk9Q37GaxnC848Fialp//dIbuRkDUCgaP aQLGRf+iUMwkA1qeX19lVqO+GIfs1vkymtf6T+8Bc1XHVH2IkaLVd4L+sxwEeKpRQb CMA2S4lKD0R34zuXEQsbcmN203yfwTUtVTFyjYR4BWPx7Pmf/GNM2sa9WZnf+W3ArL HwPuwbXUKwVXtYnn5ptTo1HSyFb7wGGG6HFHbfJnHSgKEW5+bowJHGm+lBs0yy6HaN Z8IHFh2FpZi3j34C/z7o95PnzAjKAuVw/WX6t1IbTNLZ57rP2/HElwkHc7OKhkxfln Hg08yRHrwVL+A== Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfauth.ams.internal (Postfix) with ESMTP id A3AA4198003A; Mon, 16 Nov 2026 11:28:51 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Mon, 16 Nov 2026 11:28:54 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTEHeSQUqRY1YhiGAt9xbok3Cz6xVJ5Xo3cfdcttzCYoRzXc8WXErePFu68Wle087D hXsQKfmFrb/APDBx0g1pr2Aa+HutXDgbWTbRTP7Oo4JH2epfiwmDtil9XvIHCmQRToNqD0 H37WvBxy3jdygoEsZvmgMNfREfThGuE+f1/fQTxm/5o0v3LXAV6tA0KFr/8qm28SqLjKBC JIvQB7db13NmMEUQ6uicY6Wj1U2YPutN0ED61sQdotiWYJBY0erPuQxPjQAoZZKOHKEm1P CcSCuYQ79IWhDlSdDxsyaZJRWpg89Aij3uhmqBQtQttevR3Vm1wzASR/0SeNIObM2C2xnc RDA/5KFfa/eqjJkob8y6n3L2MsOHrmPlrRpVfQC4I7oC2NWb+2vU7DYstulbXClianeZvN hz6SpjO39Ug9ZQ9ldDmdTx8WrmCVG8/XGh2O8iMUMjsenDS7ogCZBAcLKOfGb5lwwV4BOy xMJxsm6FAEssW8JYs7csY51OzSNtNcNJf32P8O8w4Z+WCEbU1IgN4oDHIoGGPUqMaHSrpt WLylfruposUCDi1TPyDRkd3nHjmwduhDPEk6w0SUmiEfAuaYkx/jakAsxrW6kCFoaSF4NB GAlj9jnGsaNPLN0GfrTeUoHX6ZQNuRsSpHF4/7fYdpsUtSsVlNp6gigN1Y9g X-ME-Proxy: Feedback-ID: i10464835:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 16 Nov 2026 11:28:50 -0500 (EST) Date: Mon, 16 Nov 2026 16:28:49 +0000 From: "Kiryl Shutsemau (Meta)" To: "Jose A. Perez de Azpillaga" Cc: Andrew Morton , Mike Rapoport , David Hildenbrand , Jonathan Corbet , Peter Xu , "Liam R. Howlett" , Vlastimil Babka , Suren Baghdasaryan , Michal Hocko , Shuah Khan , Randy Dunlap , linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Tal Zussman , Linus Torvalds Subject: Re: [PATCH v2] Documentation/userfaultfd: document RWP behavior when the PTE is dropped Message-ID: References: <20261116101004.15322-1-azpijr@gmail.com> X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261116101004.15322-1-azpijr@gmail.com> On Mon, Nov 16, 2026 at 11:09:56AM +0100, Jose A. Perez de Azpillaga wrote: > +The registration is fixed, but the tracking mode is not: a context that > +switches to sync mode with ``UFFDIO_SET_MODE``, as the workflow below does, > +needs the sync registration. This has a cost in async mode, because minor > +faults are always synchronous: an access that takes a minor fault blocks > +until the handler resolves it, even while RWP faults are resolved by the > +kernel. Nitpick, and my fault: I said in v1 that the registration is fixed. It is not. UFFDIO_REGISTER on an already registered range with the same context can add or drop MISSING and MINOR; only dropping WP or RWP needs an unregister first. So the cost in async mode is optional: the VMM can add MINOR before it switches to sync and drop it after it switches back. Maybe something like: The registration does not follow the tracking mode: a context that switches to sync mode with ``UFFDIO_SET_MODE``, as the workflow below does, needs ``UFFDIO_REGISTER_MODE_MINOR`` while it is in sync mode. Minor faults are always synchronous, so keeping it registered makes them block in async mode as well. Re-registering the range to add ``UFFDIO_REGISTER_MODE_MINOR`` before switching to sync, and to drop it after switching back, avoids that. The example can stay as it is. Otherwise: Reviewed-by: Kiryl Shutsemau (Meta) -- Kiryl Shutsemau / Kirill A. Shutemov