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 16036E77188 for ; Fri, 20 Dec 2024 15:22:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9D3BE6B0089; Fri, 20 Dec 2024 10:22:33 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 983DB6B008A; Fri, 20 Dec 2024 10:22:33 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8241D6B008C; Fri, 20 Dec 2024 10:22:33 -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 631496B0089 for ; Fri, 20 Dec 2024 10:22:33 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 180ABAF5FF for ; Fri, 20 Dec 2024 15:22:33 +0000 (UTC) X-FDA: 82915702506.03.8C7A7CD Received: from mail-qt1-f169.google.com (mail-qt1-f169.google.com [209.85.160.169]) by imf04.hostedemail.com (Postfix) with ESMTP id 5B07A40008 for ; Fri, 20 Dec 2024 15:21:55 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=rgIAqrrK; spf=pass (imf04.hostedemail.com: domain of surenb@google.com designates 209.85.160.169 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=1734708135; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=1yYQ5IMlzE4FUjVthfIAEmcqYzlgRwV98EC6OT0t+fs=; b=dq6+8S8sO0CNmgPdJeE57wmq988hUczJNtmf+6JZSuKEPvLRFYW0rZZNiBZMKy8vhtjLrX 1kauNoxOqDStfAw+QZGzxrKJ+7PFBde8AA3qFmFvRW9VE63z8gTKYG5KpHtwG00LY9ScGH n6nxAytPm2WVKoKyH+9/BDTWUgCpl4c= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734708135; a=rsa-sha256; cv=none; b=4S4BmSS6fpPAu2dvg+x6svkpiYVSYK2JxiZ44yE16lUJFZbD6Q8iASyLGQN0lZCdYrJ0rC wWEytmWHiM88FM/WIt9uO1JqY5J3/ZgFTCSxhFq8FIZiHnNmjaFmraqgF8kP/5GocKVH5d 66lzIv64bh6eS9z//SNW7865l3hfJck= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=rgIAqrrK; spf=pass (imf04.hostedemail.com: domain of surenb@google.com designates 209.85.160.169 as permitted sender) smtp.mailfrom=surenb@google.com; dmarc=pass (policy=reject) header.from=google.com Received: by mail-qt1-f169.google.com with SMTP id d75a77b69052e-4679b5c66d0so241241cf.1 for ; Fri, 20 Dec 2024 07:22:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1734708150; x=1735312950; darn=kvack.org; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=1yYQ5IMlzE4FUjVthfIAEmcqYzlgRwV98EC6OT0t+fs=; b=rgIAqrrKWMnDfI7CC047pS0n9NpwAw+u3FvkuWYL86i/9jMNr6244jqc1sRcHQi6ti BWuffV6mTuxzfKJAnyT3b/C9Tba/vZWggAMuIg7IeWd/4x4jyp21orFNzFjrPWRH5NKp 5UIenRg1zCp+/5o+4OlZAfgxxjEBGkcXYX7fcVlPH2sVsQYZKQ/vf0zVJ+pJ7cFo0c1y zh3nvnFd7VCW6B1dnCr8kv0FG9uZSykQJDLVR9MFz2kNiUpOmy1Lglg9UFmXVZs3LDtL xauIUrhmxVGRCilLjt5m1e8DF1X8KJDwHsO7tJQrtlj5T3/67adpYe25nITs5d/hhhHh x0Jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734708150; x=1735312950; h=content-transfer-encoding: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=1yYQ5IMlzE4FUjVthfIAEmcqYzlgRwV98EC6OT0t+fs=; b=vUXccbo1gaum2zDmFId9PRi6PM2XeXtFX6KVW2Cqjux3VvnSfByTW3V7f/B3omRnHO RV0I/aUSistb4JYDy4JPLX2WhlYzMIpci+xbVYaDa+Vs3z5wuC/5s8ts49doLdqMi0gy nljgmo9TYlNRi8JwX5Blhgjqk1wRVGE+h6u+cK68XCeDMKdYcae/hcY6Dl6ZM4+6iRR3 2u/Qn0is8ROb4T3jzQNquRj8I2Qq6Ucsdlsb1tlViMeZWwEd5fxsCZHeDKZPJ7Cs0Lgr KtbB9zPYoUJDsVSLDN0olZ+KYmJ4CoI9Co17Lt4S2shc5xKyBNNn2EOfEgGt3lZL77fG MSMg== X-Forwarded-Encrypted: i=1; AJvYcCUuYsI6A0Jt8pMdRs8WiPPF96cJEG/23C38TIZ6QqsH0t4Wteuj3TwgC22KhF7Ki/1d5mEJYgping==@kvack.org X-Gm-Message-State: AOJu0YxFyjrBmMF2fDwByVGM759XX5INUOUqihwEQ/4nWsfq+imSdzvl NbweKj80erjIdh0c267hcWeZt+k2/MWGsmp8Ck4lhKFYMUxOJXJlNf3WF3MhwkuZAowz94NhCIH l6bI2mN2V2BZg5Who5Y9ij5WVRJ2NEXX5eFmS X-Gm-Gg: ASbGncvs3xJLns4smZu8RX14/QTBWVa4lBo/fqZ2FDFMaKDDMS8cUriAtyvwgR1aa2/ rkLCk97zaUpo/FFlEDajyPrAkX4fpZydV4LbLnw== X-Google-Smtp-Source: AGHT+IFJtKo5TVNvYi7n6XmCnMcs0WZraKFr8gh4VP8l/6sPF0vIFqXPdSYPsO3Dx4n+pwrydFyeCae0NR2udaLRcBs= X-Received: by 2002:a05:622a:120d:b0:466:9660:18a2 with SMTP id d75a77b69052e-46a4a8f1193mr3551431cf.16.1734708150159; Fri, 20 Dec 2024 07:22:30 -0800 (PST) MIME-Version: 1.0 References: <20241219091334.GC26551@noisy.programming.kicks-ass.net> <20241219112011.GA34942@noisy.programming.kicks-ass.net> <20241219174235.GD26279@noisy.programming.kicks-ass.net> <20241219184642.GF26279@noisy.programming.kicks-ass.net> <6nck2rfwcytqdinsavmewytgcca43mldlczmao3zztrpr5v2ci@4xn6nwp6tcih> In-Reply-To: <6nck2rfwcytqdinsavmewytgcca43mldlczmao3zztrpr5v2ci@4xn6nwp6tcih> From: Suren Baghdasaryan Date: Fri, 20 Dec 2024 07:22:18 -0800 Message-ID: Subject: Re: [PATCH v6 10/16] mm: replace vm_lock and detached flag with a reference count To: "Liam R. Howlett" , Peter Zijlstra , Suren Baghdasaryan , akpm@linux-foundation.org, willy@infradead.org, lorenzo.stoakes@oracle.com, mhocko@suse.com, vbabka@suse.cz, hannes@cmpxchg.org, mjguzik@gmail.com, oliver.sang@intel.com, mgorman@techsingularity.net, david@redhat.com, peterx@redhat.com, oleg@redhat.com, dave@stgolabs.net, paulmck@kernel.org, brauner@kernel.org, dhowells@redhat.com, hdanton@sina.com, hughd@google.com, lokeshgidra@google.com, minchan@google.com, jannh@google.com, shakeel.butt@linux.dev, souravpanda@google.com, pasha.tatashin@soleen.com, klarasmodin@gmail.com, corbet@lwn.net, linux-doc@vger.kernel.org, linux-mm@kvack.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: rspam10 X-Rspamd-Queue-Id: 5B07A40008 X-Stat-Signature: w36h39h4dmdtrxh4uqegkawmjkei36xa X-Rspam-User: X-HE-Tag: 1734708115-567913 X-HE-Meta: U2FsdGVkX1+eXr/vQ/jR7WZpiVGVytpWBbUbas2p5dDW7cBBkszk33W8N0HkdsS+vORsV+5trs06PkYZm9za9pODMkecLhPsBsMArdFbio4NFrZmruLBdNf+LTW1hunDkUq0H5Gi3hHTbav1JCZ99t5zfvciseR8nDmTZEl1KTf4qYmO0rDSfc3esfWuJox3DvoWFwvGf5196Tqw7PmKeQxwob1BDelllSBmuMN+1c6Et5Y4AtARzgydgZdFs0ON5+isZdBVJmrVfm+2HtmxJodjUDRrSkfz9A4T7CSNMMOBNLzBd04WFRhgGh90h+Z0b0ZHp988Zd17mHsR3ZmRdm+y3nUBfinvPms3RT/KrUwvknOLF07p4MX7cW1qzwhYe74jg5SDT9q/mKOn0sxZCylvz8rhMApLpBGusXa8wgls9n9oeQzxyohK9cMFeQAorThJPDJyHozOfLQ15u6Z/NZinuiApqQ52+XAg/IHuSSUIkJl+LxAsawvRKPa3AhGnwQELowhU5yFH+Ed4OfAcum0I2QuwCNk9KMRyJkpHOcLQsZSdTT9VxBnz4qLQLWWFisAjqIlg9/7dh4PSz6flUV6PJNP4AN/CrO3VMqwjogXkV8+8vz9K8MfXcjGPX62TLy5eQXU9MKQ6+DMabfX45a+9umGMCElPQE0fi4PT1dtk9+cW8Bw1WFp7ESH9d0DfiQYOcFmlVza7lQ4nbnJQ1LdrPcDatahYYr+vvwF5E1UhopXHFSEfNEcCn7uGrtNYBqTljrTratvwwb7Rhj6akCmsDboYaS4aNvAamq0wMTxo0ASBk61c7OUAU+my+N1hATFiawaVHfGN8Q/b3Bg6UGiHgJutgsMHBCfGIfSfoFIjBMLH+E+QLe5YDou2QU25LONTUq3xUi6XznQ7qM4xD/BYPUvLmwytt/3VStwkEL9eD1hB6t/w9DmvD4LYx+YXUQPMakYhAqtZHACypv 4FDR1TrN IIhWHX05/QbaNmfp+p34vYf8sx2iaq+vEZ0oXZUhWKCPTPycCJpZVMoR10h1GJBpVm39mp0xRS/CbhJIuqu3vELdso9VE4UT/KXjXob+nDYbMPE6BULKvNIQ4puFjGGxWa91YpFYnntewHS+RYTs8TDJ55aC69uKYvMXYjwDppsWNmXGSM+/gd890w77Dl/QoqwwDi9JAD1QeQA3dXnNOxcD/o9xc9k6/6dhfZaxAY7wr4YXWJWa+j9ZBs7T34NQHyMxPVzX44PDubxFFkaeP51OQBElNojZLaO0Jxh6pxalZkGRoFh8PJnk4CdjkLi08YUOc X-Bogosity: Ham, tests=bogofilter, spamicity=0.079751, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Thu, Dec 19, 2024 at 10:55=E2=80=AFAM Liam R. Howlett wrote: > > * Peter Zijlstra [241219 13:47]: > > On Thu, Dec 19, 2024 at 01:18:23PM -0500, Liam R. Howlett wrote: > > > > > > For RCU lookups only the mas tree matters -- and its left present t= here. > > > > > > > > If you really want to block RCU readers, I would suggest punching a= hole > > > > in the mm_mt. All the traditional code won't notice anyway, this is= all > > > > with mmap_lock held for writing. > > > > > > We don't want to block all rcu readers, we want to block the rcu read= ers > > > that would see the problem - that is, anyone trying to read a particu= lar > > > area. > > > > > > Right now we can page fault in unpopulated vmas while writing other v= mas > > > to the tree. We are also moving more users to rcu reading to use the > > > vmas they need without waiting on writes to finish. > > > > > > Maybe I don't understand your suggestion, but I would think punching = a > > > hole would lose this advantage? > > > > My suggestion was to remove the range stuck in mas_detach from mm_mt. > > That is exactly the affected range, no? > > Yes. > > But then looping over the vmas will show a gap where there should not be > a gap. > > If we stop rcu readers entirely we lose the advantage. > > This is exactly the issue that the locking dance was working around :) Sorry for not participating in the discussion, folks. I'm down with a terrible flu and my brain is not working well. I'll catch up once I get better. >