Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp166519rwo; Tue, 1 Aug 2023 14:58:25 -0700 (PDT) X-Google-Smtp-Source: APBJJlELW44MpIQN0Frfw7asnYFyKbFtHyy3H3h2lCT6WprrZRHVL2vRRBzHc12KVmmCMkn9upuz X-Received: by 2002:a05:6a20:840a:b0:133:be9d:a8d3 with SMTP id c10-20020a056a20840a00b00133be9da8d3mr15453220pzd.14.1690927105199; Tue, 01 Aug 2023 14:58:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690927105; cv=none; d=google.com; s=arc-20160816; b=pn52LmQkPL2h6zTgezW80Kbk99XAQ5noXSkw32cR99TyYIZhwuIqSNmeZ/ho2iblXT ZnMeg8pcN2m7I8uDgMlQDMVU3MST6/DObWK5K5q+a1ELkylO8oSEtq7HZEIQMB9FPfXx a8m+xGzUEhAVbmD+0D5gSkSKe6qzXBTGNwMyrUhETIu2TJQ6+1f0nSPo3Mlhl0740K2F je6NED0/laQFRS3rc0x/fNNhEQnymV7gcKKe1ZrWT3bcdxasQrM6X6pQPAiBgh5z2Q/O y5gMt7IWPn2aXFbjZzeDcN6FsaTEiDw+v9PfptfMfkHMrWAvoan6zgD9XfTK6gp9/Cq+ 21Ww== 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=MXeNNNuvrp7+VHxvQXq6s6V+CxnvfhC2OBXKfNUDQhw=; fh=T7nPPyRHlw3B2lz6hhaiT9RGfNuVhdXLZjMsMHte8Ks=; b=IWmJ3l2Gj6kvJVPX2mXxUI+lxTSg3GIh+ek22VwF3+QxrudGaa57VXTss9Y9zDUHuy PS5OmkXneiYy6kyxYJ4K9A1BmdEGZYgTUCGhTLps4/kZLeGPNk2ajYPn0mQjO9K0HwiI Oelb2DiCNwFUcdFL+V9To6kvgt3GSEa4E9eCaz1G1xRxV9fNyMji0lRHw9NoKheSXMvS x6L6a8feirwizWknfOVnCVCGDxQ56U7INbA7xnw+4ttfltWpXgbvgbMlkGImRtVfE4iL boP4Pmt8KKQadfNwxUu5btfS7pnnWBvxNXFeTrFHWAJMUGwTkaXpsAgof3lOZjVgP6Lx 8Xyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=ik7XI1ru; 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 fb16-20020a056a002d9000b0068708a8e6c8si8538151pfb.122.2023.08.01.14.57.49; Tue, 01 Aug 2023 14:58: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=ik7XI1ru; 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 S229724AbjHAU3N (ORCPT + 99 others); Tue, 1 Aug 2023 16:29:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229669AbjHAU3M (ORCPT ); Tue, 1 Aug 2023 16:29:12 -0400 Received: from mail-yb1-xb2d.google.com (mail-yb1-xb2d.google.com [IPv6:2607:f8b0:4864:20::b2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63E0F127 for ; Tue, 1 Aug 2023 13:29:10 -0700 (PDT) Received: by mail-yb1-xb2d.google.com with SMTP id 3f1490d57ef6-d18566dc0c1so6387087276.0 for ; Tue, 01 Aug 2023 13:29:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1690921749; x=1691526549; 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=MXeNNNuvrp7+VHxvQXq6s6V+CxnvfhC2OBXKfNUDQhw=; b=ik7XI1ruE5Zqj9xue4GM0QDvoBivebS1U2K38G6kd1mdfJjkjlnkAesgMqGeIkbXX5 1jUBy8/DPyDNRgYE3D+dKOp0f4o62XSX9LXwz4CwLhBx/ZODVwcEZvCSgaemaCBTDfjR bP//Uzj0YhAg4mGakETi5/RI6RMha/Bl72+xXEXnNlEWQWSX/AEraeMY+g15ahH5W11M mBvLvDbvHwyXvKFeiU9SwH/Kdats8OpEDw8fWwCV4G8Gs3pmWACHOQiZj60QE4H2iHoh Ih3M4cXihRmCLHAOmRezIMHF3ic4Nzty6LAS+8e+mDhB1NubTK58OG76UeWdxt3DyWug a3gA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690921749; x=1691526549; 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=MXeNNNuvrp7+VHxvQXq6s6V+CxnvfhC2OBXKfNUDQhw=; b=iuBxx1pPgZCiwBWiCQ8+fIOsdax6XA2eXUBXxkDGkON0iqLAMsQo4nAqG6GHQqB7QI r2OUSKbS9+ibyH0SfQKebZx2w7mfVlqV4JKT8+vambaKAZK44B4NH8rSHRmzCP4st5Tf SZIeIAns6IVWk+ktDkHxBRsFf2JwLDuaVUeEHi1xRGFb4BcT+9yiUwpfIRd5I72zBd7H TLZATeWsf3BSSx+g7yX+kgGGavdtJ3pCKgPxhdc7VoVMJjfmG7ro4htYZBnHEz9BylH4 TEX7PzyYxMVXkEc/PAVQcZ9zmnv403pTKZXetL52i/mN6qOY+SCnyQCVzKtbX4tOZng1 UlvA== X-Gm-Message-State: ABy/qLZDfLxyXmAzkmed7TuwM5EBrVYRB4IesUBp7QuKX2i8jT8QI/Hr 6AEu+xHXI3ucbDKRUzG6NMPsF5fBw5WMnDIpwKJMCA== X-Received: by 2002:a25:455:0:b0:cad:347e:2c8f with SMTP id 82-20020a250455000000b00cad347e2c8fmr14278182ybe.39.1690921749289; Tue, 01 Aug 2023 13:29:09 -0700 (PDT) MIME-Version: 1.0 References: <20230731171233.1098105-1-surenb@google.com> <20230731171233.1098105-2-surenb@google.com> In-Reply-To: From: Suren Baghdasaryan Date: Tue, 1 Aug 2023 13:28:56 -0700 Message-ID: Subject: Re: [PATCH 1/6] mm: enable page walking API to lock vmas during the walk To: Linus Torvalds Cc: akpm@linux-foundation.org, jannh@google.com, willy@infradead.org, liam.howlett@oracle.com, david@redhat.com, peterx@redhat.com, ldufour@linux.ibm.com, vbabka@suse.cz, michel@lespinasse.org, jglisse@google.com, mhocko@suse.com, hannes@cmpxchg.org, dave@stgolabs.net, hughd@google.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, stable@vger.kernel.org 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_BLOCKED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 On Mon, Jul 31, 2023 at 1:24=E2=80=AFPM Suren Baghdasaryan wrote: > > On Mon, Jul 31, 2023 at 12:33=E2=80=AFPM Linus Torvalds > wrote: > > > > On Mon, 31 Jul 2023 at 12:31, Suren Baghdasaryan wr= ote: > > > > > > I got the idea but a couple of modifications, if I may. > > > > Ack, sounds sane to me. > > Ok, I'll wait for more feedback today and will post an update tomorrow. T= hanks! I have the new patchset ready but I see 3 places where we walk the pages after mmap_write_lock() while *I think* we can tolerate concurrent page faults (don't need to lock the vmas): s390_enable_sie() break_ksm() clear_refs_write() In all these walks we lock PTL when modifying the page table entries, that's why I think we can skip locking the vma but maybe I'm missing something? Could someone please check these 3 cases and confirm or deny my claim? Thanks, Suren. > > > > > Linus