Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp19540413rwd; Wed, 28 Jun 2023 10:36:24 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5z46W1XW3Knv77HYTKta3nUEtcqglLLQ7lJvPPytHDSrQBvMVXl3Uyd6kEAxxEQq/nT4iX X-Received: by 2002:a05:6402:2c2:b0:51d:b81a:1e84 with SMTP id b2-20020a05640202c200b0051db81a1e84mr2650558edx.27.1687973784650; Wed, 28 Jun 2023 10:36:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687973784; cv=none; d=google.com; s=arc-20160816; b=o9roEw+oFjof1CghKD9Yn8XP1lZlWaMK6E0gN1V2dasW7Gofh0SLPQUXVuAvCAofKf vgtEYRUCra6s0Je0pngZGSX+JPmvHCavKqCewg1C7ucEVvH0chcv5GUlrMpSvTrWzzjl Y0hOP5r9vstqqZkFwB9O7g9t2laJvpqWj8+0wtSZCb6V69cnx8stknKNgC7Mvc7VJi85 yNIQcEsmqw0czyoVF49UCDfPCmtJEmW8c5YDn61cFx8+Vg+nQszqqlruU+0YZET10TIp hQqi/vX3jSIQc4NyvsnNSwyUpfp8Izg7FvqGhkY2aoRm9H1GB/MRRZIwq2C57GKqDOs5 Kvyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=J0S2qMu17h8mlXEB7YzGyxzD+O5lnlad32j3R4zdlCU=; fh=3DtDjy+qm2mKxT4PhD9WTKRbZFmgjURJ5LyxQ0kcJ64=; b=x8FuCloQDpGXq1cBsVwGKIFW3rXoRhRW/vnmYZ4U5kSaLLzEPXGi+q60doqLiOdGf6 hgP2Jo4kCwolzZz2hfm0uFQEfekhdFCXobtE5tjVt9Y+fpTiUlOYbSMLJ3D11hnQbQ5P e3koBudv8HTUlKt46pLZLMG0VxbL3sOaLrwcVUPfcqWNpyc/HVWT3pGRsjUGtJPQYegk wtR36SPb3R8X3szdWmXg71jWyAJYQw+izUXjNcZd+LPaYz0fcmwRqZiOAobtgpdZW2lO IATSEdOnZSwRtiY9ok5Oib6+oWOK1JjU+a8vHYvnGx09DhXSNUtQlbluDHlreAgLMEQr bcew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dR1Tn1bv; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a24-20020aa7cf18000000b0051d9b4a95b8si3486731edy.262.2023.06.28.10.35.58; Wed, 28 Jun 2023 10:36:24 -0700 (PDT) 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=@redhat.com header.s=mimecast20190719 header.b=dR1Tn1bv; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230496AbjF1RdD (ORCPT + 99 others); Wed, 28 Jun 2023 13:33:03 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:51481 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230425AbjF1Rc7 (ORCPT ); Wed, 28 Jun 2023 13:32:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687973529; 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: in-reply-to:in-reply-to:references:references; bh=J0S2qMu17h8mlXEB7YzGyxzD+O5lnlad32j3R4zdlCU=; b=dR1Tn1bv3hkJfFTjmlgHYyRIsQE2sJbTVqk36WYoxqF+HjofjIe+lfkntJAKXkCyGW/gZe efoUIpD4HnxJvR/dfceeQ2JC0b3XpAqNbahJC2O0mAFvCP7CK7MxD+fpYwf2zuMZr/mTSu 1Q579Vw/raHwlZtC/pL/VOvflp48m5E= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-315-NjNbOOpCPTaosrWwCRcszw-1; Wed, 28 Jun 2023 13:32:07 -0400 X-MC-Unique: NjNbOOpCPTaosrWwCRcszw-1 Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-40234d83032so251261cf.1 for ; Wed, 28 Jun 2023 10:32:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687973527; x=1690565527; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=J0S2qMu17h8mlXEB7YzGyxzD+O5lnlad32j3R4zdlCU=; b=fgcKoTBljJ6jaILWZnX0xoQ183NAE2hUs3YrNcUIKaOFiyAJtrX4ix86QHkYGWiGTZ lM/7oquofXfLxgLLaSD7zqDCTvczPBtPMd4U8HcNPJx93A0VXZUOsKAX6b0rMqW1LGVE OTYGC0o19IQCW5cdqmvY23nY8Dyy1DLzKHNp8fx/ykP8vlfMiuRZC+GvkuYHZgJGL4ek juswwqNaupVni0H2eXNMM7k7oZOiWZdMoBNPOZoT9oDiuCQ5vNiG5Hd4zA4s/tCLvMQq KAXlYCGDaVhjEpof7dKq+KqUgKpSCEcM5aotQCOZEUWPzZ7Q8fryy2LZ7ZXXjkWgKPrH PdVA== X-Gm-Message-State: AC+VfDxP/nc8oHxbZ89+8cUKHKry7EtBEKk629pL/n06iHDyn5FzLfK4 q0V7H8yID7xP9gAHfUIIxzaBbUUr0jJstNdE38GcMPEalX55uN/ijo/eIqgCxaOTKRH+OgIGs4x eKGhFnoyaidV4+V73AbAEGXk8 X-Received: by 2002:a05:622a:1811:b0:3fd:eb2f:8627 with SMTP id t17-20020a05622a181100b003fdeb2f8627mr39939253qtc.6.1687973526685; Wed, 28 Jun 2023 10:32:06 -0700 (PDT) X-Received: by 2002:a05:622a:1811:b0:3fd:eb2f:8627 with SMTP id t17-20020a05622a181100b003fdeb2f8627mr39939221qtc.6.1687973526431; Wed, 28 Jun 2023 10:32:06 -0700 (PDT) Received: from x1n (cpe5c7695f3aee0-cm5c7695f3aede.cpe.net.cable.rogers.com. [99.254.144.39]) by smtp.gmail.com with ESMTPSA id l25-20020ac848d9000000b003f7369c7302sm6095196qtr.89.2023.06.28.10.32.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jun 2023 10:32:06 -0700 (PDT) Date: Wed, 28 Jun 2023 13:32:04 -0400 From: Peter Xu To: Suren Baghdasaryan Cc: akpm@linux-foundation.org, willy@infradead.org, hannes@cmpxchg.org, mhocko@suse.com, josef@toxicpanda.com, jack@suse.cz, ldufour@linux.ibm.com, laurent.dufour@fr.ibm.com, michel@lespinasse.org, liam.howlett@oracle.com, jglisse@google.com, vbabka@suse.cz, minchan@google.com, dave@stgolabs.net, punit.agrawal@bytedance.com, lstoakes@gmail.com, hdanton@sina.com, apopple@nvidia.com, ying.huang@intel.com, david@redhat.com, yuzhao@google.com, dhowells@redhat.com, hughd@google.com, viro@zeniv.linux.org.uk, brauner@kernel.org, pasha.tatashin@soleen.com, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@android.com Subject: Re: [PATCH v5 6/6] mm: handle userfaults under VMA lock Message-ID: References: <20230628172529.744839-1-surenb@google.com> <20230628172529.744839-7-surenb@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230628172529.744839-7-surenb@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 28, 2023 at 10:25:29AM -0700, Suren Baghdasaryan wrote: > Enable handle_userfault to operate under VMA lock by releasing VMA lock > instead of mmap_lock and retrying. Note that FAULT_FLAG_RETRY_NOWAIT > should never be used when handling faults under per-VMA lock protection > because that would break the assumption that lock is dropped on retry. > > Signed-off-by: Suren Baghdasaryan Maybe the sanitize_fault_flags() changes suite more in patch 3, but not a big deal I guess. Acked-by: Peter Xu Thanks! -- Peter Xu