From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bird.elm.relay.mailchannels.net (bird.elm.relay.mailchannels.net [23.83.212.17]) by sourceware.org (Postfix) with ESMTPS id 7DFB33858CDB for ; Fri, 28 Apr 2023 18:05:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7DFB33858CDB Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=ascii.art.br Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=ascii.art.br X-Sender-Id: dreamhost|x-authsender|tuliom@ascii.art.br Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 2B683142753; Fri, 28 Apr 2023 18:05:40 +0000 (UTC) Received: from pdx1-sub0-mail-a213.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id B6EC7142834; Fri, 28 Apr 2023 18:05:39 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1682705139; a=rsa-sha256; cv=none; b=txGaykztKNKJhh/9qvDqjatsMMkdTkkgNrPNgrWdxBfeo/K+PscpP7ewKzUBzmrJSkrgGq JoH11V9wXtQBjBfoxLqJ3tRPC7Mf4Qj4uusGLz6Ibf0oQc9AdO4mXx4+ggMRDQvN3k0hK7 LCPS6N3PbWyLBsFsZVgl5UNkr3t76FPvu5/Y8LhOwJrpapsDcSPA/h71A3pLDQqXTg+mAI pojklXOlGEHTCVh26+lXjGw2+hWZXcBQ2sXNagF7xeTxMsO2sbpwNMof+kKkalU5Dlc2yM bM346n1UdZal1GTAmGQ9BCyehPT7CPavvn08Bb1506DHu8jXlXSIpGkx1F1Htg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1682705139; 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:dkim-signature; bh=XvzG42dBM6kqw/Ux2ExnYiewMOcXDm+HBYeuyMxMehY=; b=xYctE2u/PIM9BVOTVizQq5D7CMwjUXqSTXuRDj/QzGmqz721hkCk12ljSkpQNAyMSt8zRu kncuANr0bDvZISsibEjSa+zxlMpW7hzJizV+wSk3iePBscZGTzgL08V4YlrFc5e3PUk20Z aXyZ9IqE7Y/SKT5w2GeB5e0a+9hgOauKNHgmUhLRRi09yM2Ahq0hdFpDHRrPiH7EbAe55Q P+XH57fRoatejOT8+QLM4QHrw5luzuOoxTSRx6Qbbhz6+kgUDvr0OVqmKMCN3iHrrecBY0 gIP6rkexr40LwdWC4BAYvVJkLSUHcYYEmT+df/5qK9G1brSlUtZgbDBUROs17g== ARC-Authentication-Results: i=1; rspamd-7f66b7b68c-b6gxx; auth=pass smtp.auth=dreamhost smtp.mailfrom=tuliom@ascii.art.br X-Sender-Id: dreamhost|x-authsender|tuliom@ascii.art.br X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|tuliom@ascii.art.br X-MailChannels-Auth-Id: dreamhost X-Duck-Trouble: 613cdbe63b2fc205_1682705139991_1368198165 X-MC-Loop-Signature: 1682705139991:880555666 X-MC-Ingress-Time: 1682705139991 Received: from pdx1-sub0-mail-a213.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.127.59.20 (trex/6.7.2); Fri, 28 Apr 2023 18:05:39 +0000 Received: from ascii.art.br (ip-187-73-2-115.isp.valenet.com.br [187.73.2.115]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: tuliom@ascii.art.br) by pdx1-sub0-mail-a213.dreamhost.com (Postfix) with ESMTPSA id 4Q7LBB6B5szDl; Fri, 28 Apr 2023 11:05:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ascii.art.br; s=dreamhost; t=1682705139; bh=XvzG42dBM6kqw/Ux2ExnYiewMOcXDm+HBYeuyMxMehY=; h=From:To:Cc:Subject:Date:Content-Type; b=hcMtut6GrH2JwpUpda5e9BOMUYSPFqGvFmfodDLmICIFwJAoYCarS8PtXW5k3e7iu zGRYst1WEnvECghBHwOS8b7/MbdYH9SdETKh1+BVtolw+9pZZ74B0wulxXO1vE9squ k/Iz47HVnUHG5yLKIMwU1PVPY2eLX9kBTKg2J2wSmHPRD9iZxMXrLlY/4Y6g6ntJE5 M0s4qqmXhbTW3M2ANvt1xIa4bu/AeJH9BODDXfTbHlZhWkXSl3hjvpjFBagsEhbnBS 3G3xv0W0FF3VlKeMEkOtR/24CYJTkphXuJ+74HCSSVIVZkGF4M9MIGjcv/UBsoM3K1 T8cBbbgFQgQkQ== From: Tulio Magno Quites Machado Filho To: Manjunath Matti via Libc-alpha , libc-alpha@sourceware.org Cc: rajis@linux.ibm.com, Manjunath Matti Subject: Re: [PATCH] powerpc: Use sysconf (_SC_SIGSTKSZ) to set SIGSTKSZ and MINSIGSTKSZ. In-Reply-To: <20230424105208.301614-1-mmatti@linux.ibm.com> References: <20230424105208.301614-1-mmatti@linux.ibm.com> Date: Fri, 28 Apr 2023 15:05:34 -0300 Message-ID: <874jozevbl.fsf@ascii.art.br> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_BARRACUDACENTRAL,RCVD_IN_BL_SPAMCOP_NET,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Manjunath Matti via Libc-alpha writes: > Add support in PowerPC to use sysconf (_SC_SIGSTKSZ) to set SIGSTKSZ > and MINSIGSTKSZ similar to x86. This commit message explains what is being done, but it doesn't make it clear why this commit is important. If I understand correctly, the goal is to have dynamic values for the signal stack size and minimum signal stack size. Is this correct? I also suggest to mention the kernel commit ID that started doing this: 2896b2dff49d0377e4372f470dcddbcb26f2be59 > diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/sigstksz.h b/sysdeps/unix/sysv/linux/powerpc/bits/sigstksz.h > new file mode 100644 > index 0000000000..2bec1e7917 > --- /dev/null > +++ b/sysdeps/unix/sysv/linux/powerpc/bits/sigstksz.h > @@ -0,0 +1,33 @@ > +/* Definition of MINSIGSTKSZ and SIGSTKSZ. Linux/PowerPC version. > + Copyright (C) 2020-2023 Free Software Foundation, Inc. ^ I believe this should be just 2023. > +#if defined __USE_DYNAMIC_STACK_SIZE && __USE_DYNAMIC_STACK_SIZE > +# include > + > +/* Default stack size for a signal handler: sysconf (SC_SIGSTKSZ). */ > +# undef SIGSTKSZ > +# define SIGSTKSZ sysconf (_SC_SIGSTKSZ) I have been told that structs could be using SIGSTKSZ to set their size. If that's happening, the softwares using them will stop building after this change. Is this reasonable? > +/* Minimum stack size for a signal handler: SIGSTKSZ/4. */ > +# undef MINSIGSTKSZ > +# define MINSIGSTKSZ (SIGSTKSZ >> 2) > +#endif I didn't understand this part. Why SIGSTKSZ/4 ? I know this is correct now, but I think the kernel is allowed to use another value. Why is this part not using sysconf(_SC_MINSIGSTKSZ)? I'm not suggesting to use sysconf() here, but I'm trying to understand why the same source of value for both SIGSTKSZ and MINSIGSTKSZ is not being used. If we reach consensus that both macros in this file can have values set at runtime, then I it might be worth adding a test in order to check that dl_minsigstacksize, MINSIGSTKSZ and AT_MINSIGSTKSZ passed by the kernel are identical. -- Tulio Magno