Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2916067ybv; Mon, 24 Feb 2020 14:20:20 -0800 (PST) X-Google-Smtp-Source: APXvYqx6kDhLZ4jQd4y5nyY8MOmCfOH3YfBCc6y0HkGEzn18w4o5Qosu7eB6pvlTapcRPUh8ps++ X-Received: by 2002:a9d:7509:: with SMTP id r9mr40046249otk.270.1582582820254; Mon, 24 Feb 2020 14:20:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582582820; cv=none; d=google.com; s=arc-20160816; b=qjAdDoShv4eVKUfQ5yyONLY3EJvzYB5d21i5KqnhG7bdL/6m0zWZuL79v8ElVUgQlA QTKiZ8fpUnpVg5XAXLZItPMUd9f6pCrniOQjN0Eom026Nr8RMIj/7WSTEUTQkybwCcS/ dpAt/4avKDSpUGKwQFF06aziVqu+4120l7oZj7m3B9gsyuDbjbIeXL47RSDdkvOzTq4N rTpaOv42Ms8ATInRYNxKYqhXH4fK2vEOQfTVy/ApeBjG03e9Z8SgVofoICtqtCQSOhL/ dOywbIEEyfh+qsFZfORxdTT9183j2GPh3SlzpYyEKH69QQBhbccjatUJetbwknPmax4f tB3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Ua04IHV/ut+warGhjtTc9FaMw6Bd0KLfUZB1G7Gfy5Q=; b=WUvswitBzkr8vyEdo9tYaBP7zBA69NBGZCtng+cb8J+KWkt5kAn6kqsJfD4A5JGBPR 2Z/UY5dR78yeUNYa4sqHliNStAzideJiKRQ1HXEO/cICQbFhIhFlAZUHcKFVMZEoRv0E 9utuuaXLUhfi7MoO50LfecnfvZIp8V66IQNlElePNtHABp5jHrfYFTe5fdXkMJrCrj7K wKJOWfHHYwjb0cwgdxO1ZaJX2S+y8O4ke7YRALtCNdIWUS5vfKoVBJ7qr2Mzi/4Mv7yQ GnnmVqZCqHPniBBFqE2OGwnAaWLK+1uerpiQ0Fo44C0bTJ9RW//dgXIFxQar8ErpATEc XdzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=ElTkCgl3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 7si5727378oij.29.2020.02.24.14.20.07; Mon, 24 Feb 2020 14:20:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=ElTkCgl3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727996AbgBXWTs (ORCPT + 99 others); Mon, 24 Feb 2020 17:19:48 -0500 Received: from mail-ed1-f67.google.com ([209.85.208.67]:43098 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726651AbgBXWTr (ORCPT ); Mon, 24 Feb 2020 17:19:47 -0500 Received: by mail-ed1-f67.google.com with SMTP id dc19so13806937edb.10 for ; Mon, 24 Feb 2020 14:19:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Ua04IHV/ut+warGhjtTc9FaMw6Bd0KLfUZB1G7Gfy5Q=; b=ElTkCgl31gTmXuIVqXl/uPaWGalYNpP+qRWjSoF43DlMSMCKC+/cickD9VJi+HW9vS stai2Vrem28ry4B9BhC8qkINuTx4zxYCZ4PdQfuoOkmReszGllzOPpNEYYLazhf7GJiq wYPvn2CW4vjLZ5FQ5ISPxpeav1N9/ta9w8lbw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Ua04IHV/ut+warGhjtTc9FaMw6Bd0KLfUZB1G7Gfy5Q=; b=fyMLDCBgql8Rp/Y8RIB6iK1Yq/wKuzFiDuzQjaJ/NnN8aZZxVnjMhWSALJd34RN4mw JsKRLKgwPsI8SU/vMmHa3ysFo4Qon7SobJtMxYXO+7+mlmSC8ORt36y65wdQ/wz4qr/u DlDRmrRf/AhkXL+/J6R+MNmNH1Rzntp8vVDx/ymUsg6Wuy1qwTMfWihVQW/imhk6RcFk 751Jqq6JWVWxKa9O0jDhuU20bSmzTxkzOQDr9aYoTvTQ4My9SB6exDuG8j76OnfShHVW cnh2cXWmZq4BLAq58OxVMiAoqXe4eO/WVVPjxs09S46a2fdhL4ozMH7WEu1+gUL6Lrti ygoQ== X-Gm-Message-State: APjAAAVq/yIoYQ49IsZ+QmVHt6nU3LD/cvmvxonK+C8KCMA9I6k3n7Zx jIXPjfLAfo/QrVLL4eNIQLX+8jvx7mU= X-Received: by 2002:a17:906:d0d1:: with SMTP id bq17mr49722875ejb.55.1582582785492; Mon, 24 Feb 2020 14:19:45 -0800 (PST) Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com. [209.85.221.54]) by smtp.gmail.com with ESMTPSA id dc5sm1093425edb.61.2020.02.24.14.19.45 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 24 Feb 2020 14:19:45 -0800 (PST) Received: by mail-wr1-f54.google.com with SMTP id m16so12279133wrx.11 for ; Mon, 24 Feb 2020 14:19:45 -0800 (PST) X-Received: by 2002:a2e:9d92:: with SMTP id c18mr11413148ljj.265.1582582387885; Mon, 24 Feb 2020 14:13:07 -0800 (PST) MIME-Version: 1.0 References: <20200205123216.GO12867@shao2-debian> <20200205125804.GM14879@hirez.programming.kicks-ass.net> <20200221080325.GA67807@shbuild999.sh.intel.com> <20200221132048.GE652992@krava> <20200223141147.GA53531@shbuild999.sh.intel.com> <20200224003301.GA5061@shbuild999.sh.intel.com> <20200224021915.GC5061@shbuild999.sh.intel.com> <87a757znqd.fsf@x220.int.ebiederm.org> <8736azzlwq.fsf@x220.int.ebiederm.org> In-Reply-To: <8736azzlwq.fsf@x220.int.ebiederm.org> From: Linus Torvalds Date: Mon, 24 Feb 2020 14:12:51 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [LKP] Re: [perf/x86] 81ec3f3c4c: will-it-scale.per_process_ops -5.5% regression To: "Eric W. Biederman" Cc: Feng Tang , Oleg Nesterov , Jiri Olsa , Peter Zijlstra , kernel test robot , Ingo Molnar , Vince Weaver , Jiri Olsa , Alexander Shishkin , Arnaldo Carvalho de Melo , Arnaldo Carvalho de Melo , "Naveen N. Rao" , Ravi Bangoria , Stephane Eranian , Thomas Gleixner , LKML , lkp@lists.01.org, andi.kleen@intel.com, "Huang, Ying" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 24, 2020 at 2:02 PM Eric W. Biederman wrote: > > Other than scratching my head about why are we optimizing neither do I. You can see the background on lore https://lore.kernel.org/lkml/20200205123216.GO12867@shao2-debian/ and the thread about the largely unexplained regression there. I had a wild handwaving theory on what's going on in https://lore.kernel.org/lkml/CAHk-=wjkSb1OkiCSn_fzf2v7A=K0bNsUEeQa+06XMhTO+oQUaA@mail.gmail.com/ but yes, the contention only happens once you have a lot of cores. That said, I suspect it actually improves performance on that microbenchmark even without the contention - just not as noticeably. I'm running a kernel with the patch right now, but I wasn't going to boot back into an old kernel just to test that. I was hoping that the kernel test robot people would just check it out. > It would help to have a comment somewhere in the code or the commit > message that says the issue is contetion under load. Note that even without the contention, on that "send a lot of signals" case it does avoid the second atomic op, and the profile really does look better. That profile improvement I can see even on my own machine, and I see how the nasty CPU bug avoidance (the "verw" on the system call exit path) goes from 30% to 31% cost. And that increase in the relative cost of the "verw" on the profile must mean that the actual real code just improved in performance (even if I didn't actually time it). With the contention, you get that added odd extra regression that seems to depend on exact cacheline placement. So I think the patch improves performance (for this "lots of queued signals" case) in general, and I hope it will also then get rid of that contention regression. Linus