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 71E66C433EF for ; Mon, 10 Jan 2022 19:01:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242940AbiAJTBO (ORCPT ); Mon, 10 Jan 2022 14:01:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242891AbiAJTBN (ORCPT ); Mon, 10 Jan 2022 14:01:13 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82F0AC06173F for ; Mon, 10 Jan 2022 11:01:13 -0800 (PST) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1641841270; 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=Qb2LYR0mvCXQteUYlTd24mwtEO8GRj2FXYrjHJf3/S8=; b=UygH+TboO+7X+UCg7mnm+o8eLbiErmkBTg7Hi8JIhlyL29QGLbREvrYva71oCQovdLGVlP +zV1X44uHiRuxb71KQUOzDFDN6sKGour2zDTf8wj4R3KY7n8m3B6cCWMIefbY/HQJG09UZ BpcOqWzNjk9Wgn7A1vLF7hMma63CB+kQZH0yrtILNsJWHmETBR9Ow41IrqOzfM0biXY50y GExRFz6Wmm3nee1LDkAklAXiUlo1B8YeQCmmoMLX5Yr3WdMkdndwIdXvP9QZlIq6tFsE6e SsoUv4cAEWwFY+LTEfxaE7tvO6k9e5sJ+n6i0vLTjIDESWs6i4mcKqbwO5FkeA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1641841270; 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=Qb2LYR0mvCXQteUYlTd24mwtEO8GRj2FXYrjHJf3/S8=; b=ph7L0eTmTnYvCBz1S/5XS55TqCiVg5/C95Q5K7fJ6x81q4MtCH+YsMAzNVmfI1q/JVmWw/ iAq1ik3IgdkRAOBw== To: Linus Torvalds , Dave Hansen Cc: Borislav Petkov , "Chang S. Bae" , Dave Hansen , x86-ml , lkml Subject: Re: [GIT PULL] core/urgent for v5.16-rc6 In-Reply-To: References: <15b1a9af-f8ff-c3e2-ba3e-cdbd29ae38db@intel.com> Date: Mon, 10 Jan 2022 20:01:09 +0100 Message-ID: <87ilurqutm.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 20 2021 at 08:25, Linus Torvalds wrote: > On Mon, Dec 20, 2021 at 8:20 AM Linus Torvalds > wrote: >> >> Whatever. I don't care that much, but this all smells like you just >> dug your own hole for very questionable causes, and instead of a >> "don't do that then" this all is doubling down on a bad idea. > > It further looks like it's really only the sas_ss_size that is > checked, so if people wan tto have a lock, make it clear that's the > only thing that the lock is about. > > So the actual "do I even need to lock" condition should likely just be > > if (ss_size < t->sas_ss_size) > .. don't bother locking .. > > but as mentioned, I don't really see much of a point in being so > careful even about the growing case. > > If somebody is changing xstate features concurrently with another > thread setting up their altstack, they can keep both pieces. In principle I agree, but the whole signal stack business is a nightmare and the way how a program ends up using some xfeature is hideous at best. An application does not necessarily know about it at all because the usage is hidden in random library code. So there is a chance to run into concurrency issues for real. Let me grab your (Dave's) patch and rework the whole thing into something sensible. I had a patch around which replaced sighand lock with an explicit lock for that purpose. Let me dig that out and polish it all up. Thanks, tglx