From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id EAFB3C54EAA for ; Sat, 28 Jan 2023 00:00:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 376946B0071; Fri, 27 Jan 2023 19:00:32 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2FF3A6B0073; Fri, 27 Jan 2023 19:00:32 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 19FF56B0074; Fri, 27 Jan 2023 19:00:32 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 05C8C6B0071 for ; Fri, 27 Jan 2023 19:00:32 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id D33E31602F0 for ; Sat, 28 Jan 2023 00:00:31 +0000 (UTC) X-FDA: 80402251062.29.BC530CB Received: from mail-yb1-f180.google.com (mail-yb1-f180.google.com [209.85.219.180]) by imf29.hostedemail.com (Postfix) with ESMTP id 0A9F8120002 for ; Sat, 28 Jan 2023 00:00:28 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=ZI6mj7LM; spf=pass (imf29.hostedemail.com: domain of surenb@google.com designates 209.85.219.180 as permitted sender) smtp.mailfrom=surenb@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674864029; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=lijrLZpsXTwOwkkTPhsucO7YRqlZ4/gQhAOPSV+Ow1Y=; b=op7sIjnmGrjwPiy/sepudRjfMQkDY1irZug2g/260gdnxlChcn+K+WQcZgcevCIladqyl8 RkliPM16ayttSx3g2iUip+3mhnfU/97OSoGLwbg1LKUSahQiMt15DwGWyvhrgLj+9Q/3cd fKx1ODEjKzufOBgGOzTzphD02ukBMpQ= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=ZI6mj7LM; spf=pass (imf29.hostedemail.com: domain of surenb@google.com designates 209.85.219.180 as permitted sender) smtp.mailfrom=surenb@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674864029; a=rsa-sha256; cv=none; b=LgSxtFWbuUbb2kOUihkBEbaax9pWQzBkqfWLiXlOtwSix407EQRuySqviwH0LONgJh4oTD f9GtnMMfnDgqhPj+ys8wm6EvkugZPgZtbfi5/4/v7NXWrQG9h1IzOgDvsptKds8v83hpX5 AFiEeDG0v+bLWx0+hJLJzd7aSJZLA1M= Received: by mail-yb1-f180.google.com with SMTP id p141so7874936ybg.12 for ; Fri, 27 Jan 2023 16:00:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; 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=lijrLZpsXTwOwkkTPhsucO7YRqlZ4/gQhAOPSV+Ow1Y=; b=ZI6mj7LMKoNI/oOcrUtd9AUED9JuO6xGc225ZP5uALsCXRzd5tFQyZH9QfEgcc0bEJ 9MyRsCvVZhFftsPfxOsSdKAlZ9GqA6WUrV9aTPd04wtI360xfqHl28+MEAyKXCixyLSk v8GrgI9q5COmywhNxiEU2+JydvMvd/BUJNpQDFUYR03wciVHZjv2EuSHGsiQLe/irS5u RDJKdxaqaPSErbAgtbt4IW1KQBMdHVynCsJnp7XSUo4WFhOq1Cn2ildO86zTjyE4mi+d qY/TAAQK5YagCO/hba9UdT8QCqoflyP2AkBiQBN42R1sMEg9No3XOKucr14HB2VVZKdY RBZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=lijrLZpsXTwOwkkTPhsucO7YRqlZ4/gQhAOPSV+Ow1Y=; b=au8+pb4YzQDQ0wP13l0uM8Ugv+wyR4pLlNMot9g+ul53ZIkG2Zx7JRg7PnrOKJ1983 4AWtw/GCGzbm05k47q5he31BI+oGeJ/+YDUH+2R81KpAWr+DEq4rCBiJoKoAnWn1BCOH A8MTWNCvT6nomHX+K269QHlsPMKFIVhgTfR9JI+2Od3E6FiTMG3B06TOm9wFY5B16+PU nYxGT7HirYZy5NHP0UNlCsrFLza8R4Q17L8x1+uP1O0MsvbA3ONwQ0oLsMvp/n8Drf6g fZUN8EfCiIhmMeivSo6O2VX7rCUxuFI9Zh3yWIN23A/PzQTDcpVDqi9skduFfZ0LUWAx L6EA== X-Gm-Message-State: AFqh2kqjzMISCFu5W5apJZm+RH9dsICnWanwDvI6tLfg0w/zAk6VTtlq ktVCZxSIlMPjk7S7PROBRQwzPtTh88oWIqhhGw066Q== X-Google-Smtp-Source: AMrXdXt1DVl+V4XP4vcyqRZaRp4SMPhEnSli2MXcg6xWkpJvGYiDP4ZAV3sZnOd/WucpWORfIrnrxsVJGAKOMpQ5+cE= X-Received: by 2002:a25:9801:0:b0:7d5:b884:3617 with SMTP id a1-20020a259801000000b007d5b8843617mr3722360ybo.380.1674864027905; Fri, 27 Jan 2023 16:00:27 -0800 (PST) MIME-Version: 1.0 References: <20230127194110.533103-1-surenb@google.com> <20230127145138.8cc44bf00ebf289dffec0975@linux-foundation.org> In-Reply-To: From: Suren Baghdasaryan Date: Fri, 27 Jan 2023 16:00:16 -0800 Message-ID: Subject: Re: [PATCH v2 00/33] Per-VMA locks To: Matthew Wilcox Cc: Andrew Morton , michel@lespinasse.org, jglisse@google.com, mhocko@suse.com, vbabka@suse.cz, hannes@cmpxchg.org, mgorman@techsingularity.net, dave@stgolabs.net, liam.howlett@oracle.com, peterz@infradead.org, ldufour@linux.ibm.com, paulmck@kernel.org, mingo@redhat.com, will@kernel.org, luto@kernel.org, songliubraving@fb.com, peterx@redhat.com, david@redhat.com, dhowells@redhat.com, hughd@google.com, bigeasy@linutronix.de, kent.overstreet@linux.dev, punit.agrawal@bytedance.com, lstoakes@gmail.com, peterjung1337@gmail.com, rientjes@google.com, axelrasmussen@google.com, joelaf@google.com, minchan@google.com, rppt@kernel.org, jannh@google.com, shakeelb@google.com, tatashin@google.com, edumazet@google.com, gthelen@google.com, gurua@google.com, arjunroy@google.com, soheil@google.com, leewalsh@google.com, posk@google.com, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, x86@kernel.org, linux-kernel@vger.kernel.org, kernel-team@android.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 0A9F8120002 X-Rspam-User: X-Stat-Signature: ya91ab6ok4qzeiphn7fhqa33fokqyh7p X-HE-Tag: 1674864028-530192 X-HE-Meta: U2FsdGVkX18T2P921vFd2GUYZSMOj8iFWaUfzZN3d4uI6pzI9aRUnkrxtlt8m4Ul74HQ9iOONwECm7N17zl2fRclcQQOw64j2Xt9aJ66t82SBjGzEQboZaRa6OuCIVYndjy7lsq7VSeU/eV1WF9xmQqkSP99Pdepcvz/YrDPOtO5gYy+eUrT/DGRie9E4Zmms8E7M4wMC3b2zSkvPVlhc0hXOaZSO0rK9GFXkYxO5FtZymnfecmKW4qfciAAD4NwlCfTeLfdezFtXfV4PtvxRsL11AofIfrr+PbbDeDuMDLFzQAffOdTLTPDbK1D/SBnKutovz/f7D+Zf0zE22zNY3BX5Bm0fEELon55ZlJQ84yDXIoHlVxanjbNlkL87+bfEiH99cfJ1GhePb/zyfuwKDKUQSkeBblhUByfhFwsfhoZZw7CjPJu5bzyoGI0BVuKXYQREYMNZJgvfemAdKCv88sYqUL0oznEsbYtDaQ+CAmdwWMLSCJL4NT08Y+q6/jZwMktMcq+/K+nkDaJjqLDAPkrC7ZoG/pGaAtDygKDatU4F6b2jeswdlRHdGSpvX3v+K18QSDgmO8isnVphy/Pi+YRa+MGqSroaxdpfj6EOFhET0nebv0rTkQzHD/xreT+r33SyCSfdlRoMeUjgVyfZOLAAgd6nwj0isK4C/xDrRKkSaMKXdJllmtwhCfHfTst3IZbs3pepdyKv3amO5PObFbzgNYOSa51XGr40i5axRMJfNs01en7x/RF12WKPYjWnX3eBDGt5JFV5yeuXvMK0rInZhC26qdV9kwJ/uvCeZikuhsky2+lkUc1UN804+qO2+QdNZf4JWBwKEz0cbkx144uwEENvZPTZqBf/u+rLdnPB4nJK1ennZZnHPF8XFze8eRJ7mjHKPG41fi5FUXAbCMzMlrVfqpYzIMSu3/IQmwi4KzoNipFuh4JGaI8+gA2dTHMSw4RIrWmGkd4RVO xxLnNius 3wphn1thj3YDqDB2aR4Ef3CRPfakX4jlAi8eTWcYiPfqbY3K4rXg4geJXKSrqUPXtjjkxe6mpIicTK0DbxQ7R1zEMa0YmlEuBZxlHe9t8QjkINpseF7xUxZCd2eQfAKznp2nNER9yTpeKQdP4jzSDVlO69/xw8hsbCc2KU88hR/Yq3Pv7n4e4slDeBeUYE978haSpl7yvNOfGe4qJbT4gvpwNFX24rpEehp4BWUKY2tKOzIBIedOrOBMWZqHy3MiHYciiZ38HrCxPATAbbISDm/tllITgkuIJZNG9PuaG7L5xgtpdf1Jwq2kWrRxu0xgWucS8zdF6dR/EzeY= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Jan 27, 2023 at 3:26 PM Matthew Wilcox wrote: > > On Fri, Jan 27, 2023 at 02:51:38PM -0800, Andrew Morton wrote: > > On Fri, 27 Jan 2023 11:40:37 -0800 Suren Baghdasaryan wrote: > > > > > Per-vma locks idea that was discussed during SPF [1] discussion at LS= F/MM > > > last year [2], which concluded with suggestion that =E2=80=9Ca reader= /writer > > > semaphore could be put into the VMA itself; that would have the effec= t of > > > using the VMA as a sort of range lock. There would still be contentio= n at > > > the VMA level, but it would be an improvement.=E2=80=9D This patchset= implements > > > this suggested approach. > > > > I think I'll await reviewer/tester input for a while. Sure, I don't expect the review to be very quick considering the complexity, however I would appreciate any testing that can be done. > > > > > The patchset implements per-VMA locking only for anonymous pages whic= h > > > are not in swap and avoids userfaultfs as their implementation is mor= e > > > complex. Additional support for file-back page faults, swapped and us= er > > > pages can be added incrementally. > > > > This is a significant risk. How can we be confident that these as yet > > unimplemented parts are implementable and that the result will be good? > > They don't need to be implementable for this patchset to be evaluated > on its own terms. This patchset improves scalability for anon pages > without making file/swap/uffd pages worse (or if it does, I haven't > seen the benchmarks to prove it). Making it work for all kinds of page faults would require much more time. So, this incremental approach, when we tackle the mmap_lock scalability problem part-by-part seems more doable. Even with anonymous-only support, the patch shows considerable improvements. Therefore I would argue that the patch is viable even if it does not support the above-mentioned cases. > > That said, I'm confident that I have a good handle on how to make > file-backed page faults work under RCU. Looking forward to collaborating on that! Thanks, Suren.