Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp19958038rwd; Wed, 28 Jun 2023 17:28:25 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6/KjBoeltR2SVY5a6/u77wiEIv3azmrt10Ya1qgid3zzUXRzTQhe01CBHtS1UGIkGQvPGW X-Received: by 2002:a17:90b:1b52:b0:262:fbb4:1a with SMTP id nv18-20020a17090b1b5200b00262fbb4001amr7935951pjb.20.1687998505681; Wed, 28 Jun 2023 17:28:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687998505; cv=none; d=google.com; s=arc-20160816; b=QMsLS+4aRlolAwupdeLLg2ITFvi375hDNOdB2y16X/KA9O52XwJU8dSUuuZJ1bdUwa SramrnoOGPOKAvej/1rogBmdHkla7/cxq9wh9kG+AmhSTvNVBL68V0a0G47eb+s6b7Pq 4SDOSgNUbmAT9L5wC/fic0NsS6nXa+3K/R9Hw/+x0WLXNqgDHig6zHWHxQx81DAdsUe+ 8gd34X9rUgLtCuQfcOZxi/zARLC01smZTQDuP3Em9DtoaMpoKL8e6ecmPAHXdB9g3JA1 +29l4eN9vpLbKP2Lvl731YC1CFGnVuFf4LbVG7l64O3GqdH4KklbNsAoi/GAob3hMjVZ D3sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=nOCwhEjJx8m3P+uqoutMCex7br6Ar+jNddvYlIlOyow=; fh=AqulJRHISBOAIcIpbI+DW0fnVYrI/ky+Zsza1VlaGkM=; b=jcDSj00AfgJtAe4+kNwsuOMZIWTA1AK0OKO/TWESONmWhDr7yhZjsEAAxIY6ycNf9W ur7Fbsg1w0U8H8m0yDSpZVn3n6u4qU99GDbrICOWgyjVG/wmGrMcdhY6vGSl0GfOrJ7T B+ibK0sXAAKTEj+VdMMFuCdGzK3MOltTtXKMAUVVJjAFjEDRgSSU/Y7KJPWRgOrCGvmx VMY1wn0bZa7sInVI9nmj/BhvAQbyUZHAn6VixhXyN0MmRDNt38Bk1ys9nA5lkeYUbzFM pmgaEOXe8VQNwVlnHucSSxSIVvGuETlsx24nHOQwO1OsDeBlj+xkgBuMRtoa4qsHgdjh CZYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=wgd1l0e6; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n2-20020a635c42000000b00548e140a1a4si9745787pgm.644.2023.06.28.17.28.11; Wed, 28 Jun 2023 17:28:25 -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=@google.com header.s=20221208 header.b=wgd1l0e6; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232141AbjF2ATt (ORCPT + 99 others); Wed, 28 Jun 2023 20:19:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232174AbjF2ATo (ORCPT ); Wed, 28 Jun 2023 20:19:44 -0400 Received: from mail-yb1-xb2e.google.com (mail-yb1-xb2e.google.com [IPv6:2607:f8b0:4864:20::b2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31C1E1FE8 for ; Wed, 28 Jun 2023 17:19:43 -0700 (PDT) Received: by mail-yb1-xb2e.google.com with SMTP id 3f1490d57ef6-c01e1c0402cso113784276.0 for ; Wed, 28 Jun 2023 17:19:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1687997982; x=1690589982; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=nOCwhEjJx8m3P+uqoutMCex7br6Ar+jNddvYlIlOyow=; b=wgd1l0e6NxvG1GpXVymBS3uJ69Blzs9EFo6/MXhliF4battkWVspUOPLIdzzMHC5Ro gmsdw6hUkihqQ6GKX7nQ9twqe/F2drQsF9cpTryOoHtP02Onh8YYQcZux8Elx7c4f+Qg xLz9w9Cs+QIy9HaZxfzyURb19BfFZLJDK1yiY/55vUdpd1tzKyzK6xXaIXHhxaUpwd0O wzKEmbCXND8r1t/DXs0B2Xx/6Pe040lmSb1blovGw5fbxhjQ8Vh+K3vy2YkVsyjfCcCT 1oI4MrQjAQrsogmH4762py+PmEOhXhI3ocL06hr9MALERuHQVGcbr7T8bSNL3gUV/JBj EovA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687997982; x=1690589982; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nOCwhEjJx8m3P+uqoutMCex7br6Ar+jNddvYlIlOyow=; b=g8bS+U38v313JGUV6TTEqDiCV+NyYWqbZhtMieyrEiJGO9kzVslg14LtbMh47TkNaO yAYsFH3VepTMA0HCVfJMsLriHB6rlNt36S7Q5yxnxxiF0u0vJ5fqFMhPipsH0jjMXEos qTcb99vC3D/ODP/3L2G+JHNIZozCJuQmByYD6POMaYfCOncm7yzJJjPjpSgGc4FhDttv 99THIg/KRh7SFEPeXgg3Wfb4cqOItdDxbT3BDmksh4BKk8oGJK5n2jbOmJ1YSBQCDJre ud1lp+9SOEU0h9XhrvrKzcpDoFdInRhI/ha4hUJZCQkZn9Z5kW0kSN61zKJmabvm/U09 aMPA== X-Gm-Message-State: AC+VfDzhX8fzrWPC35i/ficcFb2N8krRrRtdaRZVv8oyNNJZ2pi9mVNK AYkz9yfDMNN1Z/DwYfZtvwbw41LhjQ8xMAcpvwzeMQ== X-Received: by 2002:a25:37d6:0:b0:c1e:f730:6856 with SMTP id e205-20020a2537d6000000b00c1ef7306856mr8608614yba.27.1687997982159; Wed, 28 Jun 2023 17:19:42 -0700 (PDT) MIME-Version: 1.0 References: <20230628172529.744839-1-surenb@google.com> <20230628172529.744839-7-surenb@google.com> In-Reply-To: From: Suren Baghdasaryan Date: Wed, 28 Jun 2023 17:19:31 -0700 Message-ID: Subject: Re: [PATCH v5 6/6] mm: handle userfaults under VMA lock To: Peter Xu 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable 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 On Wed, Jun 28, 2023 at 10:32=E2=80=AFAM Peter Xu wrote= : > > 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. IIUC FAULT_FLAG_RETRY_NOWAIT comes into play in this patchset only in the context of uffds, therefore that check seems to be needed when we enable per-VMA lock uffd support, which is this patch. Does that make sense? > > Acked-by: Peter Xu Thanks! > > Thanks! > > -- > Peter Xu >