Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp57622rwb; Wed, 18 Jan 2023 14:06:04 -0800 (PST) X-Google-Smtp-Source: AMrXdXtFCsijj3lG5jBA/UBpIyLag92XnhcgfykI2FG4rvEbfN/5/AbnO+DJTEEJu8rWGrNP+/vD X-Received: by 2002:a62:27c6:0:b0:58d:8ea0:ce31 with SMTP id n189-20020a6227c6000000b0058d8ea0ce31mr7945780pfn.27.1674079564218; Wed, 18 Jan 2023 14:06:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674079564; cv=none; d=google.com; s=arc-20160816; b=QxMNFybM67sqJaYxZ5SW/HSQDtH7bBadgIJpWZlaIhXKL5qVDYosZcV5oztNdx6+Qw VQckceGlwLZUnSVE/Lolf4ZGWqrlbGrOdXruRvHTDoGBPkCTQ49lGQiOiGsnLillZA5h HcfyWe8j7YA+VownaVa+iloGuTRFt1TParTlcJcd1y5zggQ6fUPEbxYnet1n8XO2UGfd GytJ8OKS8ZWZqXtpieFrvgTJaHzRPyR0xwYJXeV1NluuG8cN+Q9yke+kOVaZ8SWIiSOG EFzJNYgYkVf+mEeLKVYA8+/jH0vIXFq3722W1FmlNMh4b3jFceW9DGDfyS2naeLRwkPa N97g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=M600VK+Yiu4nd7HJ/UqqIXTrBc2sxX4QZyVOHBhaXRA=; b=S18Y+Nyq4SLxiM7CHcruSEAjXVhefHTTi4p2RcHtIQ2M/8V24GP7Zyil3ctcE8obTX JQ6zhj8s3kpWRVTrC0Qr0dkzGHKHCz5AiUg2II/BtKAik07jeFOdokx4A9oKGX8GgZlV sLofzUzY1DRQCsTZe3STBsfqxinkmC2iLTKgpm1j7/gCgCYJsho/nI1GuijwwAshSX8R +psR1n1x5YqA0GYM4Ftn8pUVc22LbIQNjCN8mLVGO71Fu7/SeV8UcXeSOHfDyy6LYYPU c5ufAE1tMD2yKhddmTxdIhEILbM4kiQLUd3vI2mVo3qJWCjmW0VeCUYc+tB2ydoO1uD1 yLwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Y4+8hZ5D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bk13-20020a056a02028d00b004b2709233b1si32418855pgb.197.2023.01.18.14.05.59; Wed, 18 Jan 2023 14:06:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Y4+8hZ5D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230326AbjARVwA (ORCPT + 44 others); Wed, 18 Jan 2023 16:52:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231288AbjARVvr (ORCPT ); Wed, 18 Jan 2023 16:51:47 -0500 Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB64763080 for ; Wed, 18 Jan 2023 13:51:43 -0800 (PST) Received: by mail-pg1-x52f.google.com with SMTP id 78so25575623pgb.8 for ; Wed, 18 Jan 2023 13:51:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=M600VK+Yiu4nd7HJ/UqqIXTrBc2sxX4QZyVOHBhaXRA=; b=Y4+8hZ5DDjqkJ26aK8BCB6UiclO4FhYJK0GsPfWQNSgnYcootRhOLV4O9sMJiUEHrN uwsYzDzzx15pgNj/O40ddXSq3mGJtofOCvlhzJRlu11tRQATHY6bcpcAQAlvUYoDqJLl Z48II8dKreJuvqbKESyfX9FjS4D79tO3vJUsLAsVDq0Jx9c17SSh6TkDxcfsONB10xee 1eddHcDZf7qNpGhw/BllSNCEgGWjvuk2FSrtSvK/hXYEq3uBr3LcSDj2L68IGnOqSANS 8WNO5u7sbErtrdfIWYhYZvV0cCVReXtz5X3HjhTj3JqtyzLRB50cLvNmVZ5qdeucK2nr DDhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=M600VK+Yiu4nd7HJ/UqqIXTrBc2sxX4QZyVOHBhaXRA=; b=MxC4/lX6fI1aO0GaEFlH1so9P7GhtWrVE0SncSX/wkhVr5xHOebfIUJmqqcnXxwox4 fSCyfYnhpuhT3vO4YyD94tT3yPI8+GHSwfK2oHxn6gcxQZi8J5DHL9MqEn1cODUI9biV Nnq70YC5AUSIRyaN4tdGgPnnS/e99uwGAiIza1f2vV+iZzLYF+czXNnPGqO1zqJyf4Ya dDlzNMF9vKOzx7c2RRnl5Ru6S72l9GmhHxens20ZyIjPKVpvwOeI/cqZrtkq3odh6ZbU 5KPF3M5/k9RpdLHE85ZL+voXBwawzrMSh3bOR6ani4E8mVea37KhJcXIebloTfu3ue20 FPQg== X-Gm-Message-State: AFqh2krAhUkQ557R9ORkkHRek5+/NYZLL9EJvpdbXA8yo9gWGUxNErfe L86YsHcO9PCcZ/2B9OETlwY= X-Received: by 2002:a62:1556:0:b0:58b:c9db:c015 with SMTP id 83-20020a621556000000b0058bc9dbc015mr9937270pfv.30.1674078703262; Wed, 18 Jan 2023 13:51:43 -0800 (PST) Received: from smtpclient.apple (c-24-6-216-183.hsd1.ca.comcast.net. [24.6.216.183]) by smtp.gmail.com with ESMTPSA id w65-20020a623044000000b0056c349f5c70sm22529550pfw.79.2023.01.18.13.51.41 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Jan 2023 13:51:42 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.300.101.1.3\)) Subject: Re: [PATCH 3/3] mm/uffd: Detect pgtable allocation failures From: Nadav Amit In-Reply-To: Date: Wed, 18 Jan 2023 13:51:30 -0800 Cc: David Hildenbrand , Linux-MM , kernel list , Mike Kravetz , Muchun Song , Andrea Arcangeli , James Houghton , Axel Rasmussen , Andrew Morton Content-Transfer-Encoding: quoted-printable Message-Id: <832F027A-3778-4670-BED6-1222FA905F13@gmail.com> References: <20230104225207.1066932-1-peterx@redhat.com> <20230104225207.1066932-4-peterx@redhat.com> To: Peter Xu X-Mailer: Apple Mail (2.3731.300.101.1.3) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sorry for the late response. >> Yes, I propose it as an optional flag for UFFD-WP. >> Anyhow, I believe the UFFD-WP as implemented now is not efficient and >> should=E2=80=99ve been vectored to allow one TLB shootdown for many >> non-consecutive pages. >=20 > Agreed. Would providing a vector of ranges help too for a few uffd = ioctls? >=20 > I'm also curious whether you're still actively developing (or running) = your > iouring series. So I finished building a prototype some time ago, and one of the = benefits was in reducing memory reclamation time. Unfortunately, MGLRU then came = and took away a lot of the benefit. A colleague of mine had a slightly different use-case, so I gave him the code and he showed interest in upstreaming it. After some probing, it = turns out he decided he is not into the effort of upstreaming it. I can = upstream the vectored WP once I write some tests. >>=20 >> I am not sure what the best way to detect that a page is write-pinned >> reliably. My point was that if a change is already carried to >> write-protect mechanisms, then this issue should be considered. = Because >> otherwise, many use-cases of uffd-wp would encounter implementation >> issues. >>=20 >> I will not =E2=80=9Ckill=E2=80=9D myself over it now, but I think it = worth consideration. >=20 > The current interface change is small and limited only to the extra = -ENOMEM > retval with memory pressures (personally I don't really know how to = trigger > this, as I never succeeded myself even with memory pressure..). What = you > said does sound like a new area to explore, and I think it's fine to = change > the interface again. Understood. Thanks and sorry again for the late response, Nadav=