Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp41741rwd; Mon, 12 Jun 2023 09:51:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5KxgTd1eJlpOWMO9Ivf9LrooA6MFIzMmFo9M/kB+S1Sd6qny9xTfz/RF0PmKcNLYEFbdU/ X-Received: by 2002:a05:6a00:218c:b0:65b:38b2:8d4b with SMTP id h12-20020a056a00218c00b0065b38b28d4bmr12059897pfi.29.1686588680750; Mon, 12 Jun 2023 09:51:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686588680; cv=none; d=google.com; s=arc-20160816; b=rPN9LU8ktPCjaomqmNgO+3Bc7q2syvPAfjoMhUbui7cEBVuXoooOCCHTs/nhH+xaPM 9NKEYbzsQihg7htsWCLMChTX6zHKrm5ljyJMp3BhQQN1rbK4ORTEW/DX0pJsqQhi3yW6 PVabOoUXVz7LsiqwuFYDEIDjlVwAYNPv+Sg+pzAcLZ/NbQswE6ayIhqWe7GJT924n+I1 kX+FAH1bRJHqcjXGMgTrKXtfP8t0lJBdQVWXb00tg64QeBFyyh4tmQjFZ/UDLi23Gk9w nzW3Vut2hCBKC/G2r7Jw26vnWJPQnDvtYgXaqL7VhFdqWYfxOlvfpduwvYryvxEvKKrB eqGA== 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=krHnCQ5CZRMKrSb8ha+/q1/CNtxY7fdiNeyXa88Ch7U=; b=UC39fLUV25J+LEYx6dTXo16XE9SgHWe50DOzBS21DjTFQZyE20zHAiJj+VMz/m+Xmk /dXZh2fp+kNBpjhsvCOSdJOyL8esmPsNStKmg+Cxhh+xXXXyvYlEYr5bdZLv0OMM13pL oTaFFWOwQCHu3RPNm9OlwTxn41ztR/EW0KPf0bp+dNl9llSh1SxdwdzPUdN9ryZocLTA 58N6JmKL6IAurxgwXJGwMSAFNky/agMZ16y+Nc3H9F/6oxY1N1m1oSraCKn8VOirmiV4 vFredcyoXO5/TRwgeG7lu6VcpRANv7B123DcsH+Xf77mDPfJnXtcYYM81sosri7qx6tm xuew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=z3EBHkgl; 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 v188-20020a6261c5000000b00643ba887601si6965103pfb.307.2023.06.12.09.51.05; Mon, 12 Jun 2023 09:51:20 -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=z3EBHkgl; 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 S229519AbjFLQJZ (ORCPT + 99 others); Mon, 12 Jun 2023 12:09:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229454AbjFLQJS (ORCPT ); Mon, 12 Jun 2023 12:09:18 -0400 Received: from mail-oo1-xc33.google.com (mail-oo1-xc33.google.com [IPv6:2607:f8b0:4864:20::c33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDA1B187 for ; Mon, 12 Jun 2023 09:09:17 -0700 (PDT) Received: by mail-oo1-xc33.google.com with SMTP id 006d021491bc7-55b2fb308bbso2339310eaf.1 for ; Mon, 12 Jun 2023 09:09:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1686586157; x=1689178157; 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=krHnCQ5CZRMKrSb8ha+/q1/CNtxY7fdiNeyXa88Ch7U=; b=z3EBHkglWnm5rnLT98HaYaM+oGWcCAOyxvug81oE2bBZpjVKxBgN29HUk1J+lwiLiZ HsDVo1ETVzGu1HECjVIGZHpZCo21qG7E2DidskRGb9L67JJFLSKyZl45k4uZssKrn2K0 22ddrL24eEE9G4l8BbFRK+rUzlepuWNLezx5wqPj6QgDytdO1RvOQUV8oYgoVtfucW9M bVrdjiGepr6ge7nbMw65RIYrDhIRac6HeFNdCeJMiaea2G8vm0olD15rTk/lWCWaqa7L dnQq8z6sBAw12YOiMmgwwo7FThPlMXhO0rreAEAlcVOsqt8UuSWBug+vF4r8zpSiVX0I c2Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686586157; x=1689178157; 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=krHnCQ5CZRMKrSb8ha+/q1/CNtxY7fdiNeyXa88Ch7U=; b=kkw5DrrRXSI+Vg0tmLR2yQwa39/rogrG6X/URH9lbEAmi9RI/1xz1rvWYQtZ76TWJQ 2dD+rl8HnYAsJLVsz/m7zE4F25EV9ywze3gdDlyZjUK+dg6fVrgksNoqh4X+WjslcBLT vNuB/3P5Vk7X142OjKt62na05OQ6w9XZ2yDGNeK6GtNji9ke//W6DuBniBbatYn02sfP HXaDtLAJfIHwxbbARqZx4G2ABgEDYXqub269EqncqfVZOXvVzauSUzdJ+WfBJrUQ1gIA kuDf7NL4Mvr6cNmnNy8YXhLKS6FBcvuPVkKerNDhtrpwvyOYhEhGMP+/WUTqjGbhplRO ipcg== X-Gm-Message-State: AC+VfDyFKiLxcE+DJJnUdrVqTQTq3yRVWO45aPVv398VT1YhAAhYhKRS oWEOrq9eX/ETQf+QPSkagaDaFZhky52cRxwBBlCSNA== X-Received: by 2002:a05:6359:ba3:b0:12b:d6bf:7ac8 with SMTP id gf35-20020a0563590ba300b0012bd6bf7ac8mr635970rwb.29.1686586156856; Mon, 12 Jun 2023 09:09:16 -0700 (PDT) MIME-Version: 1.0 References: <20230609005158.2421285-1-surenb@google.com> <20230609005158.2421285-3-surenb@google.com> In-Reply-To: From: Suren Baghdasaryan Date: Mon, 12 Jun 2023 09:09:06 -0700 Message-ID: Subject: Re: [PATCH v2 2/6] mm: handle swap page faults under VMA lock if page is uncontended To: Peter Xu Cc: Matthew Wilcox , akpm@linux-foundation.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 Mon, Jun 12, 2023 at 6:59=E2=80=AFAM Peter Xu wrote: > > On Fri, Jun 09, 2023 at 03:34:34PM -0700, Suren Baghdasaryan wrote: > > On Fri, Jun 9, 2023 at 1:45=E2=80=AFPM Peter Xu wro= te: > > > > > > On Fri, Jun 09, 2023 at 09:35:49PM +0100, Matthew Wilcox wrote: > > > > On Fri, Jun 09, 2023 at 04:25:42PM -0400, Peter Xu wrote: > > > > > > bool __folio_lock_or_retry(struct folio *folio, struct mm_stru= ct *mm, > > > > > > unsigned int flags) > > > > > > { > > > > > > + /* Can't do this if not holding mmap_lock */ > > > > > > + if (flags & FAULT_FLAG_VMA_LOCK) > > > > > > + return false; > > > > > > > > > > If here what we need is the page lock, can we just conditionally = release > > > > > either mmap lock or vma lock depending on FAULT_FLAG_VMA_LOCK? > > > > > > > > See patch 5 ... > > > > > > Just reaching.. :) > > > > > > Why not in one shot, then? > > > > I like small incremental changes, but I can squash them if that helps > > in having a complete picture. > > Yes that'll be appreciated. IMHO keeping changing semantics of > FAULT_FLAG_VMA_LOCK for the folio lock function in the same small series = is > confusing. Ack. Thanks for the feedback! > > -- > Peter Xu > > -- > To unsubscribe from this group and stop receiving emails from it, send an= email to kernel-team+unsubscribe@android.com. >