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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 061A3C433F5 for ; Thu, 9 Dec 2021 08:13:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234471AbhLIIQz (ORCPT ); Thu, 9 Dec 2021 03:16:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230243AbhLIIQy (ORCPT ); Thu, 9 Dec 2021 03:16:54 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF4DEC061746 for ; Thu, 9 Dec 2021 00:13:21 -0800 (PST) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1639037599; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=UsOJNwKmhXSBB0U8D3ufuMxmFz4ZFGFz1+SJ7OxFjKI=; b=eUl9Unym8+X4Zr4jaqVnB8j/DP4JAWhUL/D6KOW9eRXfF89EnyT1VKgKP4gKQyWplTlh54 adeXPkPhiDLuefEyIXET2RxQ7gCdZW8HTFpMhjiJpBjaIHedqr2ie/47yvDISpY7h/PJQv u1B874iJSJDgPe+VjWwbpcH4zXdv+ecqixIn3nOHXmMZtuVdIikRzpirpzEhVbVEbprPZg 3ZLSrI0gL0VA60givbjnNUvJIt+gqMrEcaKhGdksT+Dqb+q7MDlF7DeffjXELcM9oIX+VO bq9XSccDZNtiZwX/9nOh0ZXhPQGGnzSXUinUxV5/xOUmZQ/x8sqdOVDAujr4kQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1639037599; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=UsOJNwKmhXSBB0U8D3ufuMxmFz4ZFGFz1+SJ7OxFjKI=; b=DcOWHHSYqZ0UFF1a/4A9eCj5StOZP4GKRbvpGR7x/EC87IjB4pd4PTL59ovBa0C3YZ5wJQ Av4sXn4LK/Z2/nBQ== To: Dave Hansen , "Bae, Chang Seok" Cc: "Sang, Oliver" , Borislav Petkov , LKML , "lkp@lists.01.org" , lkp , "Huang, Ying" , "Tang, Feng" , "zhengjun.xing@linux.intel.com" , "Yin, Fengwei" Subject: Re: [x86/signal] 3aac3ebea0: will-it-scale.per_thread_ops -11.9% regression In-Reply-To: References: <20211207012128.GA16074@xsang-OptiPlex-9020> Date: Thu, 09 Dec 2021 09:13:18 +0100 Message-ID: <87v8zyyz4x.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 08 2021 at 10:20, Dave Hansen wrote: > On 12/8/21 10:00 AM, Bae, Chang Seok wrote: >> diff --git a/kernel/signal.c b/kernel/signal.c >> index a629b11bf3e0..8194d2f38bf1 100644 >> --- a/kernel/signal.c >> +++ b/kernel/signal.c >> @@ -4224,6 +4224,11 @@ int restore_altstack(const stack_t __user *uss) >> stack_t new; >> if (copy_from_user(&new, uss, sizeof(stack_t))) >> return -EFAULT; >> + if (current->sas_ss_sp == (unsigned long) new.ss_sp && >> + current->sas_ss_size == new.ss_size && >> + current->sas_ss_flags == new.ss_flags) >> + return 0; >> + >> (void)do_sigaltstack(&new, NULL, current_user_stack_pointer(), >> MINSIGSTKSZ); >> /* squash all but EFAULT for now */ > > This seems like a generally good optimization that could go in > do_sigaltstack() itself, no? Yes, right before the sigaltstack_lock() invocation. Thanks, tglx