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 913D4D116EC for ; Fri, 25 Oct 2024 05:12:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EA11D6B007B; Fri, 25 Oct 2024 01:12:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E506B6B0082; Fri, 25 Oct 2024 01:12:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D189F6B0085; Fri, 25 Oct 2024 01:12:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id B34936B007B for ; Fri, 25 Oct 2024 01:12:42 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 80B6CA0524 for ; Fri, 25 Oct 2024 05:12:07 +0000 (UTC) X-FDA: 82710953766.27.C492A0A Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) by imf25.hostedemail.com (Postfix) with ESMTP id E8443A000A for ; Fri, 25 Oct 2024 05:12:26 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=PGwgwj9f; spf=pass (imf25.hostedemail.com: domain of andrii.nakryiko@gmail.com designates 209.85.215.171 as permitted sender) smtp.mailfrom=andrii.nakryiko@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729833082; a=rsa-sha256; cv=none; b=PiwuYKi91ei1x/ceEYpGdTb0Mz8HcT41ND1uqXiLxLfkgILf2Rfjg+ocNdnP7758HR3v4H 5VA4IAgK1srdSyygkgqB8ZvywVczzjqhWsD2LdJgVF+vUTjlQB8YH68ztkgQeUeaezZuVX JhHyNckGUnUnlG0u1gSnolEli+ZZa8I= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=PGwgwj9f; spf=pass (imf25.hostedemail.com: domain of andrii.nakryiko@gmail.com designates 209.85.215.171 as permitted sender) smtp.mailfrom=andrii.nakryiko@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729833082; 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=/Tpkj435EOyN50vCRF2Ax6BCjnil4B9JArHmpZ92C68=; b=TclZsVNbzahSQGwltmpOTfx2tqQTcGaA87Qh6ovpROYn/Tg9X7DHcVFnXsC5+HA+Ha5bs0 ueeTLuupK0LCp9y+ie6/Fjan+8uYZuo3kl3c37VjtpdrlPbKj+i5W3J6cikvP7L+toW45D aFsCgjZ6hjMmQ6mD+AbXkJcBRltcbjc= Received: by mail-pg1-f171.google.com with SMTP id 41be03b00d2f7-7ed9c16f687so1130635a12.0 for ; Thu, 24 Oct 2024 22:12:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729833159; x=1730437959; darn=kvack.org; 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=/Tpkj435EOyN50vCRF2Ax6BCjnil4B9JArHmpZ92C68=; b=PGwgwj9fVZpu9JuBpBv4mlt2s52e8CnvljcfBfmXeDiVYngv9vM7vL5b9QayZZKukx 2OVPXsq30Z957RE9xpPkW0NIb2xG/XGFl23b4NzdHDaEIk41564epNvgJDc3vx6ol89d V6EDYtUCRXeIpVb7WCuwfyeDXYjDvyczHNDwVPOH8WV14Z/6BLJ0ne4qWatTES7tp8iA hJ1yf3EvXMTj1hVNVf0xVF5+Q3L31Sh0OsfFFJ1tR+GSF0HsZwYPrEDx29GWQVXbQMOD ktn9X6OhZ4ay706oFQv9ZFz0K4IWjBionQXDnRYvf8pm3Hc1LVmRx0/W6vE725otxftg dE0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729833159; x=1730437959; 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=/Tpkj435EOyN50vCRF2Ax6BCjnil4B9JArHmpZ92C68=; b=bJzSvTxPBmOoxyGBuwLwyGQ8whvjPTBFaOMIZBLTbQDt24wGEL9+VoyWV5gEvDAUVT sO97hb/EmLAwWYGRH4JWgC3d+KS0AAEioEFmgf12q3+JvL6HmCulXt5drymsbQqS8iCN NVaQhADWF3Bskr9qzg6NDpKXZqgAuYDmZ8sTQ9JyO5CpfiTkRYINi9niYCrc8E16aDOV ac2BuVsuNqU5iY51PpY788jWFqe7pF9871W1RVT3T73MbuOtLlXW7HcZ/8Ltt1FIXEAL 64Z9qjW3BelZ1aqVfwhqOVdSxnn5XZigWii9W+xGB+JKjdKMLlQd0vlqlRnNOG2dH+Ty c+IQ== X-Forwarded-Encrypted: i=1; AJvYcCU0eCasr7EoWulfSxXv+ID/j5jMCKmpizvSh604C1sGd4zIjQljXfAOQ5cmpHjSTPN5xF1GscEwnA==@kvack.org X-Gm-Message-State: AOJu0Yx/e3mIYD7FPJMcwgO0z/s6TQ6I8D2Y8EjJHF4pX6O3pUlgZAuJ wpUROYnPrytXdIiCGp1UJkQrDGF2M8C7yoKbeIFfqTU9cmT12mUkE0qvn6iiC9kZGtRF88DTlh+ F4o0zZFhn0FlhLWxMqKfg9VfO4QU= X-Google-Smtp-Source: AGHT+IEAk9YojetBkRLJe53COqtiLGEYhreTaZK/7pHC6B7uYCYlMywQUqjE4kFyEuwzJ2rYrbPOLuLkU41RwAyyzlk= X-Received: by 2002:a05:6a21:168e:b0:1d9:2a0e:971e with SMTP id adf61e73a8af0-1d978bb27c5mr8798561637.46.1729833159199; Thu, 24 Oct 2024 22:12:39 -0700 (PDT) MIME-Version: 1.0 References: <20241010205644.3831427-1-andrii@kernel.org> <20241010205644.3831427-2-andrii@kernel.org> <20241023201031.GF11151@noisy.programming.kicks-ass.net> <20241024095659.GD9767@noisy.programming.kicks-ass.net> In-Reply-To: From: Andrii Nakryiko Date: Thu, 24 Oct 2024 22:12:26 -0700 Message-ID: Subject: Re: [PATCH v3 tip/perf/core 1/4] mm: introduce mmap_lock_speculation_{start|end} To: Suren Baghdasaryan Cc: Peter Zijlstra , Andrii Nakryiko , linux-trace-kernel@vger.kernel.org, linux-mm@kvack.org, oleg@redhat.com, rostedt@goodmis.org, mhiramat@kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, jolsa@kernel.org, paulmck@kernel.org, willy@infradead.org, akpm@linux-foundation.org, mjguzik@gmail.com, brauner@kernel.org, jannh@google.com, mhocko@kernel.org, vbabka@suse.cz, shakeel.butt@linux.dev, hannes@cmpxchg.org, Liam.Howlett@oracle.com, lorenzo.stoakes@oracle.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Stat-Signature: dwzxsq8phcyo3g8hidw4oqpzg7gk5u7o X-Rspamd-Queue-Id: E8443A000A X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1729833146-965586 X-HE-Meta: U2FsdGVkX1+BWguNGcJOJ9W0G4ayOTDYrRfsQgTjClGeXitaals7BEvpSXrmtcbP50qDvsEhtXp9RIxfEPp7e6vaReO+RKTl3TE8qdw5WDtR3olRFy4w9HmVH6CX4BrgBL2ssskaQdFb4U5iO8aBb29rCULVq7u84Na+DTt28ov99KFS+ybBj+l2FWA6wOZAwSGR7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8iB5L3T1mTV56h4bYLiN60Ky4l7lqjGCpv+0eBs5gkAob5SBTYzu16HwvDAVYv/X0XhngaFXjG2D/FzmrrQHirdcAQKyjKIPbrr002/XorQJRxHHzP2XTZCKT29Kob4tJzU9jVfeCiZv3NcHjm8BS7jmOuJ/zEymKnjgEtZGJ0YMwf90QgMev4bhlrxDphq4v/XCvMthjKKocwCUpzbudEOCOOuWZeFqRt8qT9jgVArcf/Pxw5WlReBQiV8AnpTXhdQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000002, 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, Oct 24, 2024 at 4:33=E2=80=AFPM Suren Baghdasaryan wrote: > > On Thu, Oct 24, 2024 at 4:20=E2=80=AFPM Andrii Nakryiko > wrote: > > > > On Thu, Oct 24, 2024 at 2:04=E2=80=AFPM Suren Baghdasaryan wrote: > > > > > > On Thu, Oct 24, 2024 at 9:28=E2=80=AFAM Suren Baghdasaryan wrote: > > > > > > > > On Thu, Oct 24, 2024 at 2:57=E2=80=AFAM Peter Zijlstra wrote: > > > > > > > > > > On Wed, Oct 23, 2024 at 03:17:01PM -0700, Suren Baghdasaryan wrot= e: > > > > > > > > > > > > Or better yet, just use seqcount... > > > > > > > > > > > > Yeah, with these changes it does look a lot like seqcount now..= . > > > > > > I can take another stab at rewriting this using seqcount_t but = one > > > > > > issue that Jann was concerned about is the counter being int vs= long. > > > > > > seqcount_t uses unsigned, so I'm not sure how to address that i= f I > > > > > > were to use seqcount_t. Any suggestions how to address that bef= ore I > > > > > > move forward with a rewrite? > > > > > > > > > > So if that issue is real, it is not specific to this case. Specif= ically > > > > > preemptible seqcount will be similarly affected. So we should pro= bably > > > > > address that in the seqcount implementation. > > > > > > > > Sounds good. Let me try rewriting this patch using seqcount_t and I= 'll > > > > work with Jann on a separate patch to change seqcount_t. > > > > Thanks for the feedback! > > > > > > I posted the patchset to convert mm_lock_seq into seqcount_t and to > > > add speculative functions at > > > https://lore.kernel.org/all/20241024205231.1944747-1-surenb@google.co= m/. > > > > Thanks, Suren! Hopefully it can land soon! > > Would incorporating them into your patchset speed things up? If so, > feel free to include them into your series. I don't really think so. At this point the uprobe part is done (next revision has a comment style fix, that's all). So I'll just wait for your patches to be acked and applied, then I'll just do a trivial rebase. This will be easier for everyone at this point, IMO, to not couple them into a single patch set with two authors. Hopefully Peter will take those patches through tip/perf/core, though, so I don't have to wait for mm and tip trees to converge. > The only required change in your other patches is the renaming of > mmap_lock_speculation_start() to mmap_lock_speculation_begin(). Yep, no problem. > > > > > > > > > > > > > > >