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 B36A4D1038E for ; Thu, 24 Oct 2024 23:33:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9F1036B0082; Thu, 24 Oct 2024 19:33:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9A0566B0083; Thu, 24 Oct 2024 19:33:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 88F566B0085; Thu, 24 Oct 2024 19:33:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 6B0206B0082 for ; Thu, 24 Oct 2024 19:33:17 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 71C6D160175 for ; Thu, 24 Oct 2024 23:32:55 +0000 (UTC) X-FDA: 82710098268.07.5FA44E2 Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) by imf27.hostedemail.com (Postfix) with ESMTP id 1D0B040008 for ; Thu, 24 Oct 2024 23:32:55 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=Nrjl5Qe4; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf27.hostedemail.com: domain of surenb@google.com designates 209.85.160.175 as permitted sender) smtp.mailfrom=surenb@google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729812743; a=rsa-sha256; cv=none; b=Xy3TV5qm9zK7p4hPg1ykds4aNxiw/4fEc5r4BefusO/C46JU2cAAfuEaecWg1IE5rANENp EPmTwFJYhR1K8wQxEIt3JRSZA/d3bGPTz+hH8r3Er1dMV0S4gvEYQTWEETIj0Zfj6MnhBI y4IRdokA/ClUJwdfxUByYOdnqA1ILe4= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=Nrjl5Qe4; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf27.hostedemail.com: domain of surenb@google.com designates 209.85.160.175 as permitted sender) smtp.mailfrom=surenb@google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729812743; 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=vmsuMNCTMsnSpAb3EIoplVmMWZi2viZaThCOjLNdh50=; b=D01KQ3FCtY5Q0GHHImDbg2HNCEWjMOqrCOPa+HOD8eRufiXfmqrCpbO66TvySft4oaFv1l /CLNHeC0F5/ULOfQzX03R6lyhAs99sMpUgxRbMgoBIv/X85fwK2gd3gv55AKGqB1LIQmg0 wbVh3o+FEFNk94eChfplbINdmuwmqRw= Received: by mail-qt1-f175.google.com with SMTP id d75a77b69052e-460a8d1a9b7so73241cf.1 for ; Thu, 24 Oct 2024 16:33:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1729812794; x=1730417594; 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=vmsuMNCTMsnSpAb3EIoplVmMWZi2viZaThCOjLNdh50=; b=Nrjl5Qe4ruguQyUCBYwCIcsPnYCYfo58uTd3gpNciLMP0Z2jZUsCn8qxsYeB+EVMOb ARC8ZiyhxTIluYX+P/Dpj89nFGYQurD+dleV8AgNAvnwLmhNz/JSuu31AhjTnltNv/9o 6MkqEyURKz+F+l6Q+PebFDkFUjn+1gIRy/PESqzmhK2q3yWWfXC8eUQz6NqgCw2KIks4 rYURqkDWtNNFmIAD0UAQC+wwx1vxPgxiVfsCs5o/q4lebb9pCcNyncpYJPkIFVqC2cej 5CwzG53dblDhmnxhPH8LzLohh+3YWnkBoinxrJPY8NC2s07R8wPUnNiNAQWUgH5ixT2E MgtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729812794; x=1730417594; 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=vmsuMNCTMsnSpAb3EIoplVmMWZi2viZaThCOjLNdh50=; b=hYF8BgPk0+YhVQ9Z0UXwh963azg0usangMQ0L6l120uWjHN4mSUdQklLTQ6gQ1+qkv XILOL8bhGAClad2ziTCLT6So4JsVkmfvYmv/gf+ETSUN+4/d7D9FfvcX1JkGImTFLoQw V7Nvytf6XYj2klVyd4w3XVUnnuf0msJB95eY7Xt8kFPvTV4w9MjzFSmaZzQOFz22FLo7 Iu32tm9Vian5bVwGmEjPpzHYRK4cj5r/SVVzIx/JtFzv329BeQ1fjhb5AIh65gWzI9fb OPR2M78dX2vykF8LSQBOnt8tiRkGyqkins+bsgOiJpeur7sWICqBYrG4tiWCpFC0x96L 3NIA== X-Forwarded-Encrypted: i=1; AJvYcCWduwiQ4M/5KZEaLTqj92aUJWdn7moqJu8Cg8nqb278hhMKDmkfkaPvhFEcsNGFf++V7Ji8x/f99g==@kvack.org X-Gm-Message-State: AOJu0YxbpwCDcxtfyudW4mf6YQNKedZw0oUr4fhPG0y/Tu9aX1S3ripc cMTsTCCaw8rpCrRgzVfdxHdahcL2VjbZ1OpGZMAHb3BHnCZkTsaIgHj7ARlSenHwMO7GbcLHhcl FXBfu0bzAUzST3RmCzXexoDGuExJOIcZLA6Go X-Google-Smtp-Source: AGHT+IEW2JMaWRvxKfmcu8sr08V97Ij3HhW3jaebS9MGMkSOQxIgxXNcePp71xFUudebLmPyfGSMJ3WTInWv/8QJhg8= X-Received: by 2002:a05:622a:548e:b0:460:8444:d017 with SMTP id d75a77b69052e-461306e214bmr542231cf.27.1729812794080; Thu, 24 Oct 2024 16:33:14 -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: Suren Baghdasaryan Date: Thu, 24 Oct 2024 16:33:01 -0700 Message-ID: Subject: Re: [PATCH v3 tip/perf/core 1/4] mm: introduce mmap_lock_speculation_{start|end} To: Andrii Nakryiko 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-Rspam-User: X-Rspamd-Queue-Id: 1D0B040008 X-Rspamd-Server: rspam01 X-Stat-Signature: o9xpn845hscg7jscb3mtpd6yk18f7n89 X-HE-Tag: 1729812775-193649 X-HE-Meta: U2FsdGVkX195o+oV3mcplJTUMhNzMIyavbI/H6kb1I/YjnyRbNkIbrFP1H637lLMVimAIbdp5OgzpeWCHeZKt4I+kyx4dZlX8uVJ3y2zRTT8Sdd9aOys/7q+FPiOx1fowVOm3zCHE2iF7XuK3SoBpprZDm1olpGxEH8+fZxbz3WQyl6jDMW9KFexfdj7lzgwsJgLNUlu2j/Z+XydcPB9z0ijgdxQAnyMGyHthUd5CvotQGGxVb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v73PVJHO1Ewd0Rz1z9rBVfCMv3cxLkAVuIwflQxieKEtSbeyIUO2QNy90xPmyrJj/BsmRs+LIqeghWg93aKxeiy4pyPbmjFTu46qwxRP/anZ8XOfo1htvxvVf2 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000169, 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: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 wrote: > > > > > > > > > > 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 on= e > > > > > issue that Jann was concerned about is the counter being int vs l= ong. > > > > > seqcount_t uses unsigned, so I'm not sure how to address that if = I > > > > > were to use seqcount_t. Any suggestions how to address that befor= e I > > > > > move forward with a rewrite? > > > > > > > > So if that issue is real, it is not specific to this case. Specific= ally > > > > preemptible seqcount will be similarly affected. So we should proba= bly > > > > address that in the seqcount implementation. > > > > > > Sounds good. Let me try rewriting this patch using seqcount_t and I'l= l > > > 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.com/= . > > 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. The only required change in your other patches is the renaming of mmap_lock_speculation_start() to mmap_lock_speculation_begin(). > > > > > > > > > >