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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09BC1C433ED for ; Fri, 23 Apr 2021 07:44:46 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 687DF6105A for ; Fri, 23 Apr 2021 07:44:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 687DF6105A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=containers-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 190B84059A; Fri, 23 Apr 2021 07:44:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id w5d6LFMM68fx; Fri, 23 Apr 2021 07:44:43 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp4.osuosl.org (Postfix) with ESMTP id 8417840578; Fri, 23 Apr 2021 07:44:43 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 5D90AC000E; Fri, 23 Apr 2021 07:44:43 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 7642EC000B for ; Fri, 23 Apr 2021 07:44:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 4ED3B40578 for ; Fri, 23 Apr 2021 07:44:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Y12U_xFVXCBn for ; Fri, 23 Apr 2021 07:44:39 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp4.osuosl.org (Postfix) with ESMTPS id 7327D4055A for ; Fri, 23 Apr 2021 07:44:38 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 21391613D7; Fri, 23 Apr 2021 07:44:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619163877; bh=8vt7fJFKJyNLj4TruaKcfoqK87/dNszJK3KYc+h7llo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XPM/BW3NJ38gXdx4kC9XLRyu4R5onNo/Wqm16A+sHhEqALBFN8UtvF30xiKtpAM69 ruMjG+OEgzQ7mzSaFmYzUb8nMNl91VX/734G4IMxS4r2Aym+1c+LknRsdHLVGoaS9J poN1lAeOZGP8dhfk81DMMpSp/vslj2BBRMtB1ZuUxTcx3KttlMPWsWZqfW15JERhqO 82TsZKYZAZXIh4n1KLo7G4q15+De1OCt7xrNyey9VubMs0vDbWnS7DSSg7ufwoniPq 0nlLbQuBnDVtXl3hK+j4sTazgBAMy+V+bMZaBJRHktnJHXg5VTrWshmxd/3oPM6y99 YfuILgFmKfsyA== Date: Fri, 23 Apr 2021 09:44:31 +0200 From: Alexey Gladkov To: Oliver Sang Subject: Re: 08ed4efad6: stress-ng.sigsegv.ops_per_sec -41.9% regression Message-ID: <20210423074431.7ob6aqasome2zjbk@example.org> References: <7abe5ab608c61fc2363ba458bea21cf9a4a64588.1617814298.git.gladkov.alexey@gmail.com> <20210408083026.GE1696@xsang-OptiPlex-9020> <20210423024722.GA13968@xsang-OptiPlex-9020> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210423024722.GA13968@xsang-OptiPlex-9020> Cc: Jens Axboe , Feng Tang , 0day robot , Kernel Hardening , Linux Containers , Jann Horn , LKML , Oleg Nesterov , Linux-MM , lkp@lists.01.org, "Eric W. Biederman" , "Huang, Ying" , Andrew Morton , zhengjun.xing@intel.com, Linus Torvalds , Christian Brauner , Kees Cook X-BeenThere: containers@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux Containers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: containers-bounces@lists.linux-foundation.org Sender: "Containers" T24gRnJpLCBBcHIgMjMsIDIwMjEgYXQgMTA6NDc6MjJBTSArMDgwMCwgT2xpdmVyIFNhbmcgd3Jv dGU6Cj4gaGksIEVyaWMsCj4gCj4gT24gVGh1LCBBcHIgMDgsIDIwMjEgYXQgMDE6NDQ6NDNQTSAt MDUwMCwgRXJpYyBXLiBCaWVkZXJtYW4gd3JvdGU6Cj4gPiBMaW51cyBUb3J2YWxkcyA8dG9ydmFs ZHNAbGludXgtZm91bmRhdGlvbi5vcmc+IHdyaXRlczoKPiA+IAo+ID4gPiBPbiBUaHUsIEFwciA4 LCAyMDIxIGF0IDE6MzIgQU0ga2VybmVsIHRlc3Qgcm9ib3QgPG9saXZlci5zYW5nQGludGVsLmNv bT4gd3JvdGU6Cj4gPiA+Pgo+ID4gPj4gRllJLCB3ZSBub3RpY2VkIGEgLTQxLjklIHJlZ3Jlc3Np b24gb2Ygc3RyZXNzLW5nLn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RydWN0IHVjb3VudHMuICBBcyB0aGlzIGlzIGEgc3luY2hyb25v dXMgc2lnbmFsIHdlIGNvdWxkCj4gPiBza2lwIHRoZSBzaWdwZW5kaW5nIGluY3JlbWVudCwgc2tp cCB0aGUgc2lnbmFsIHF1ZXVlIGVudGlyZWx5LCBhbmQKPiA+IGRlbGl2ZXIgdGhlIHNpZ25hbCB0 byB1c2VyLXNwYWNlIGltbWVkaWF0ZWx5LiAgVGhlIHJlbW92YWwgb2YgYWxsIGNhY2hlCj4gPiBw aW5nIHBvbmdzIG1pZ2h0IG1ha2UgaXQgd29ydGggaXQuCj4gPiAKPiA+IFRoZXJlIGlzIGFsc28g VGhvbWFzIEdsZWl4bmVyJ3MgcmVjZW50IG9wdGltaXphdGlvbiB0byBjYWNoZSBvbmUKPiA+IHNp Z3F1ZXVlIGVudHJ5IHBlciB0YXNrIHRvIGdpdmUgbW9yZSBwcmVkaWN0YWJsZSBiZWhhdmlvci4g IFRoYXQKPiA+IHdvdWxkIHJlbW92ZSB0aGUgY29zdCBvZiB0aGUgYWxsb2NhdGlvbi4KPiA+IAo+ ID4gRXJpYwo+IAoKLS0gClJncmRzLCBsZWdpb24KCl9fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fCkNvbnRhaW5lcnMgbWFpbGluZyBsaXN0CkNvbnRhaW5lcnNA bGlzdHMubGludXgtZm91bmRhdGlvbi5vcmcKaHR0cHM6Ly9saXN0cy5saW51eGZvdW5kYXRpb24u b3JnL21haWxtYW4vbGlzdGluZm8vY29udGFpbmVycw== 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 X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C07BC433B4 for ; Fri, 23 Apr 2021 07:44:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0B88D613B0 for ; Fri, 23 Apr 2021 07:44:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241172AbhDWHpO (ORCPT ); Fri, 23 Apr 2021 03:45:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:49018 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbhDWHpN (ORCPT ); Fri, 23 Apr 2021 03:45:13 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 21391613D7; Fri, 23 Apr 2021 07:44:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619163877; bh=8vt7fJFKJyNLj4TruaKcfoqK87/dNszJK3KYc+h7llo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XPM/BW3NJ38gXdx4kC9XLRyu4R5onNo/Wqm16A+sHhEqALBFN8UtvF30xiKtpAM69 ruMjG+OEgzQ7mzSaFmYzUb8nMNl91VX/734G4IMxS4r2Aym+1c+LknRsdHLVGoaS9J poN1lAeOZGP8dhfk81DMMpSp/vslj2BBRMtB1ZuUxTcx3KttlMPWsWZqfW15JERhqO 82TsZKYZAZXIh4n1KLo7G4q15+De1OCt7xrNyey9VubMs0vDbWnS7DSSg7ufwoniPq 0nlLbQuBnDVtXl3hK+j4sTazgBAMy+V+bMZaBJRHktnJHXg5VTrWshmxd/3oPM6y99 YfuILgFmKfsyA== Date: Fri, 23 Apr 2021 09:44:31 +0200 From: Alexey Gladkov To: Oliver Sang Cc: "Eric W. Biederman" , Linus Torvalds , Alexey Gladkov , 0day robot , LKML , lkp@lists.01.org, "Huang, Ying" , Feng Tang , zhengjun.xing@intel.com, Kernel Hardening , Linux Containers , Linux-MM , Andrew Morton , Christian Brauner , Jann Horn , Jens Axboe , Kees Cook , Oleg Nesterov Subject: Re: 08ed4efad6: stress-ng.sigsegv.ops_per_sec -41.9% regression Message-ID: <20210423074431.7ob6aqasome2zjbk@example.org> References: <7abe5ab608c61fc2363ba458bea21cf9a4a64588.1617814298.git.gladkov.alexey@gmail.com> <20210408083026.GE1696@xsang-OptiPlex-9020> <20210423024722.GA13968@xsang-OptiPlex-9020> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210423024722.GA13968@xsang-OptiPlex-9020> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 23, 2021 at 10:47:22AM +0800, Oliver Sang wrote: > hi, Eric, > > On Thu, Apr 08, 2021 at 01:44:43PM -0500, Eric W. Biederman wrote: > > Linus Torvalds writes: > > > > > On Thu, Apr 8, 2021 at 1:32 AM kernel test robot wrote: > > >> > > >> FYI, we noticed a -41.9% regression of stress-ng.sigsegv.ops_per_sec due to commit > > >> 08ed4efad684 ("[PATCH v10 6/9] Reimplement RLIMIT_SIGPENDING on top of ucounts") > > > > > > Ouch. > > > > We were cautiously optimistic when no test problems showed up from > > the last posting that there was nothing to look at here. > > > > Unfortunately it looks like the bots just missed the last posting. > > this report is upon v10. do you have newer version which hope bot test? Yes. I posted a new version of this patch set. I would be very grateful if you could test it. https://lore.kernel.org/lkml/cover.1619094428.git.legion@kernel.org/ > please be noted, sorry to say, due to various reasons, it will be a > big challenge for us to capture each version of a patch set. > > e.g. we didn't make out a similar performance regression for > v8/v9 version of this one.. > > > > > So it seems we are finally pretty much at correct code in need > > of performance tuning. > > > > > I *think* this test may be testing "send so many signals that it > > > triggers the signal queue overflow case". > > > > > > And I *think* that the performance degradation may be due to lots of > > > unnecessary allocations, because ity looks like that commit changes > > > __sigqueue_alloc() to do > > > > > > struct sigqueue *q = kmem_cache_alloc(sigqueue_cachep, flags); > > > > > > *before* checking the signal limit, and then if the signal limit was > > > exceeded, it will just be free'd instead. > > > > > > The old code would check the signal count against RLIMIT_SIGPENDING > > > *first*, and if there were m ore pending signals then it wouldn't do > > > anything at all (including not incrementing that expensive atomic > > > count). > > > > This is an interesting test in a lot of ways as it is testing the > > synchronous signal delivery path caused by an exception. The test > > is either executing *ptr = 0 (where ptr points to a read-only page) > > or it executes an x86 instruction that is excessively long. > > > > I have found the code but I haven't figured out how it is being > > called yet. The core loop is just: > > for(;;) { > > sigaction(SIGSEGV, &action, NULL); > > sigaction(SIGILL, &action, NULL); > > sigaction(SIGBUS, &action, NULL); > > > > ret = sigsetjmp(jmp_env, 1); > > if (done()) > > break; > > if (ret) { > > /* verify signal */ > > } else { > > *ptr = 0; > > } > > } > > > > Code like that fundamentally can not be multi-threaded. So the only way > > the sigpending limit is being hit is if there are more processes running > > that code simultaneously than the size of the limit. > > > > Further it looks like stress-ng pushes RLIMIT_SIGPENDING as high as it > > will go before the test starts. > > > > > > > Also, the old code was very careful to only do the "get_user()" for > > > the *first* signal it added to the queue, and do the "put_user()" for > > > when removing the last signal. Exactly because those atomics are very > > > expensive. > > > > > > The new code just does a lot of these atomics unconditionally. > > > > Yes. That seems a likely culprit. > > > > > I dunno. The profile data in there is a bit hard to read, but there's > > > a lot more cachee misses, and a *lot* of node crossers: > > > > > >> 5961544 +190.4% 17314361 perf-stat.i.cache-misses > > >> 22107466 +119.2% 48457656 perf-stat.i.cache-references > > >> 163292 ą 3% +4582.0% 7645410 perf-stat.i.node-load-misses > > >> 227388 ą 2% +3708.8% 8660824 perf-stat.i.node-loads > > > > > > and (probably as a result) average instruction costs have gone up enormously: > > > > > >> 3.47 +66.8% 5.79 perf-stat.overall.cpi > > >> 22849 -65.6% 7866 perf-stat.overall.cycles-between-cache-misses > > > > > > and it does seem to be at least partly about "put_ucounts()": > > > > > >> 0.00 +4.5 4.46 perf-profile.calltrace.cycles-pp.put_ucounts.__sigqueue_free.get_signal.arch_do_signal_or_restart.exit_to_user_mode_prepare > > > > > > and a lot of "get_ucounts()". > > > > > > But it may also be that the new "get sigpending" is just *so* much > > > more expensive than it used to be. > > > > That too is possible. > > > > That node-load-misses number does look like something is bouncing back > > and forth between the nodes a lot more. So I suspect stress-ng is > > running multiple copies of the sigsegv test in different processes at > > once. > > > > > > > > That really suggests cache line ping pong from get_ucounts and > > incrementing sigpending. > > > > It surprises me that obtaining the cache lines exclusively is > > the dominant cost on this code path but obtaining two cache lines > > exclusively instead of one cache cache line exclusively is consistent > > with a causing the exception delivery to take nearly twice as long. > > > > For the optimization we only care about the leaf count so with a little > > care we can restore the optimization. So that is probably the thing > > to do here. The fewer changes to worry about the less likely to find > > surprises. > > > > > > > > That said for this specific case there is a lot of potential room for > > improvement. As this is a per thread signal the code update sigpending > > in commit_cred and never worry about needing to pin the struct > > user_struct or struct ucounts. As this is a synchronous signal we could > > skip the sigpending increment, skip the signal queue entirely, and > > deliver the signal to user-space immediately. The removal of all cache > > ping pongs might make it worth it. > > > > There is also Thomas Gleixner's recent optimization to cache one > > sigqueue entry per task to give more predictable behavior. That > > would remove the cost of the allocation. > > > > Eric > -- Rgrds, legion From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============4933647879898774613==" MIME-Version: 1.0 From: Alexey Gladkov To: lkp@lists.01.org Subject: Re: 08ed4efad6: stress-ng.sigsegv.ops_per_sec -41.9% regression Date: Fri, 23 Apr 2021 09:44:31 +0200 Message-ID: <20210423074431.7ob6aqasome2zjbk@example.org> In-Reply-To: <20210423024722.GA13968@xsang-OptiPlex-9020> List-Id: --===============4933647879898774613== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Fri, Apr 23, 2021 at 10:47:22AM +0800, Oliver Sang wrote: > hi, Eric, > = > On Thu, Apr 08, 2021 at 01:44:43PM -0500, Eric W. Biederman wrote: > > Linus Torvalds writes: > > = > > > On Thu, Apr 8, 2021 at 1:32 AM kernel test robot wrote: > > >> > > >> FYI, we noticed a -41.9% regression of stress-ng.sigsegv.ops_per_sec= due to commit > > >> 08ed4efad684 ("[PATCH v10 6/9] Reimplement RLIMIT_SIGPENDING on top = of ucounts") > > > > > > Ouch. > > = > > We were cautiously optimistic when no test problems showed up from > > the last posting that there was nothing to look at here. > > = > > Unfortunately it looks like the bots just missed the last posting. = > = > this report is upon v10. do you have newer version which hope bot test? Yes. I posted a new version of this patch set. I would be very grateful if you could test it. https://lore.kernel.org/lkml/cover.1619094428.git.legion(a)kernel.org/ > please be noted, sorry to say, due to various reasons, it will be a > big challenge for us to capture each version of a patch set. > = > e.g. we didn't make out a similar performance regression for > v8/v9 version of this one.. > = > > = > > So it seems we are finally pretty much at correct code in need > > of performance tuning. > > = > > > I *think* this test may be testing "send so many signals that it > > > triggers the signal queue overflow case". > > > > > > And I *think* that the performance degradation may be due to lots of > > > unnecessary allocations, because ity looks like that commit changes > > > __sigqueue_alloc() to do > > > > > > struct sigqueue *q =3D kmem_cache_alloc(sigqueue_cachep, flag= s); > > > > > > *before* checking the signal limit, and then if the signal limit was > > > exceeded, it will just be free'd instead. > > > > > > The old code would check the signal count against RLIMIT_SIGPENDING > > > *first*, and if there were m ore pending signals then it wouldn't do > > > anything at all (including not incrementing that expensive atomic > > > count). > > = > > This is an interesting test in a lot of ways as it is testing the > > synchronous signal delivery path caused by an exception. The test > > is either executing *ptr =3D 0 (where ptr points to a read-only page) > > or it executes an x86 instruction that is excessively long. > > = > > I have found the code but I haven't figured out how it is being > > called yet. The core loop is just: > > for(;;) { > > sigaction(SIGSEGV, &action, NULL); > > sigaction(SIGILL, &action, NULL); > > sigaction(SIGBUS, &action, NULL); > > = > > ret =3D sigsetjmp(jmp_env, 1); > > if (done()) > > break; > > if (ret) { > > /* verify signal */ > > } else { > > *ptr =3D 0; > > } > > } > > = > > Code like that fundamentally can not be multi-threaded. So the only way > > the sigpending limit is being hit is if there are more processes running > > that code simultaneously than the size of the limit. > > = > > Further it looks like stress-ng pushes RLIMIT_SIGPENDING as high as it > > will go before the test starts. > > = > > = > > > Also, the old code was very careful to only do the "get_user()" for > > > the *first* signal it added to the queue, and do the "put_user()" for > > > when removing the last signal. Exactly because those atomics are very > > > expensive. > > > > > > The new code just does a lot of these atomics unconditionally. > > = > > Yes. That seems a likely culprit. > > = > > > I dunno. The profile data in there is a bit hard to read, but there's > > > a lot more cachee misses, and a *lot* of node crossers: > > > > > >> 5961544 +190.4% 17314361 perf-stat.i.cache-miss= es > > >> 22107466 +119.2% 48457656 perf-stat.i.cache-refe= rences > > >> 163292 =C4=85 3% +4582.0% 7645410 perf-stat.i.node-= load-misses > > >> 227388 =C4=85 2% +3708.8% 8660824 perf-stat.i.node-= loads > > > > > > and (probably as a result) average instruction costs have gone up eno= rmously: > > > > > >> 3.47 +66.8% 5.79 perf-stat.overall.cpi > > >> 22849 -65.6% 7866 perf-stat.overall.cycl= es-between-cache-misses > > > > > > and it does seem to be at least partly about "put_ucounts()": > > > > > >> 0.00 +4.5 4.46 perf-profile.calltrace= .cycles-pp.put_ucounts.__sigqueue_free.get_signal.arch_do_signal_or_restart= .exit_to_user_mode_prepare > > > > > > and a lot of "get_ucounts()". > > > > > > But it may also be that the new "get sigpending" is just *so* much > > > more expensive than it used to be. > > = > > That too is possible. > > = > > That node-load-misses number does look like something is bouncing back > > and forth between the nodes a lot more. So I suspect stress-ng is > > running multiple copies of the sigsegv test in different processes at > > once. > > = > > = > > = > > That really suggests cache line ping pong from get_ucounts and > > incrementing sigpending. > > = > > It surprises me that obtaining the cache lines exclusively is > > the dominant cost on this code path but obtaining two cache lines > > exclusively instead of one cache cache line exclusively is consistent > > with a causing the exception delivery to take nearly twice as long. > > = > > For the optimization we only care about the leaf count so with a little > > care we can restore the optimization. So that is probably the thing > > to do here. The fewer changes to worry about the less likely to find > > surprises. > > = > > = > > = > > That said for this specific case there is a lot of potential room for > > improvement. As this is a per thread signal the code update sigpending > > in commit_cred and never worry about needing to pin the struct > > user_struct or struct ucounts. As this is a synchronous signal we could > > skip the sigpending increment, skip the signal queue entirely, and > > deliver the signal to user-space immediately. The removal of all cache > > ping pongs might make it worth it. > > = > > There is also Thomas Gleixner's recent optimization to cache one > > sigqueue entry per task to give more predictable behavior. That > > would remove the cost of the allocation. > > = > > Eric > = -- = Rgrds, legion --===============4933647879898774613==--