From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS17314 8.43.84.0/22 X-Spam-Status: No, score=-4.2 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 995691F8C6 for ; Wed, 15 Sep 2021 14:32:08 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6A2503858439 for ; Wed, 15 Sep 2021 14:32:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6A2503858439 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1631716327; bh=yXRv+fWC5orkqbAF4LETdmlwFPRXJDRplS9evkk97H4=; h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=sTEB/MsS56ck1drX4X32mxV8uwAe9b9FuVOSkT0GMsKkaV4qW/u7+Kw1e8T1fFvdR pm53KsraxLHvzVmqskFc+UBfIv2tXAEy1BGHJLeezgUEnzxDSGEhl7ra8AgXFI2xTK KfrIHXgd4zAQTOuO1WEc5Sc0wZFa7Sdyj3+pl5Jc= Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by sourceware.org (Postfix) with ESMTPS id B4DE23858403 for ; Wed, 15 Sep 2021 14:31:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B4DE23858403 Received: by mail-pj1-x1031.google.com with SMTP id f3-20020a17090a638300b00199097ddf1aso5128292pjj.0 for ; Wed, 15 Sep 2021 07:31:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yXRv+fWC5orkqbAF4LETdmlwFPRXJDRplS9evkk97H4=; b=3IBq+mdECMBjbcxPSQ/xtvjQV/Fc7lPf+S4bG8LZmjWPDdTAQ8RMmgE6K0FXS6M/Za tM8FTI6LKwGFw5bJcauNS7yzcIikVcVuMEPJmq0xM2tXHpAWjuzc2yZ48OFwzGlqQENE sK+cqVIgA5eHzXrazxdoAVd0UB3hphCvPYkgdAa5xOKB2lPD5O4utpqzKq67Yjy21GQU sH6Sv4oNCPGpyE0k2UQq88PlQhlnaZC+679jygJkbdC66GzdAoIAX5tJVexbJU442aJS +2TZbwKmEkZmuy+SVyhYyH3itOPFWjVYxpW7x4V1gC6CsLtQnE9/wxPrVhrhQp/J3jI0 WQwQ== X-Gm-Message-State: AOAM5339KcN8NCI1NfVUQ5XE8YIhxC2Yy6iUWezSCmp3IK8Ag702rvx2 mwyml7vq4rpt+xY3caAYlWi8f5C7HOfzd4tJ+fE= X-Google-Smtp-Source: ABdhPJyJKNbT92IjvrH6TjbdJLKA6bC7qcE9RnYFiu71HAICUOGyFAJMTyoIGQZlErNySZBrrij1qeGb3VZpVhsT8q8= X-Received: by 2002:a17:90b:17c1:: with SMTP id me1mr9113901pjb.28.1631716306778; Wed, 15 Sep 2021 07:31:46 -0700 (PDT) MIME-Version: 1.0 References: <1631497278-29829-1-git-send-email-vincent.chen@sifive.com> <1631497278-29829-6-git-send-email-vincent.chen@sifive.com> <87a6ket90x.fsf@oldenburg.str.redhat.com> In-Reply-To: <87a6ket90x.fsf@oldenburg.str.redhat.com> Date: Wed, 15 Sep 2021 07:31:11 -0700 Message-ID: Subject: Re: [RFC 5/5] RISC-V: Expand PTHREAD_STACK_MIN to support RVV environment To: Florian Weimer Content-Type: text/plain; charset="UTF-8" X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: "H.J. Lu via Libc-alpha" Reply-To: "H.J. Lu" Cc: Vincent Chen , GNU C Library , Andrew Waterman , Joseph Myers Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" On Wed, Sep 15, 2021 at 3:42 AM Florian Weimer via Libc-alpha wrote: > > * Joseph Myers: > > > On Mon, 13 Sep 2021, Vincent Chen wrote: > > > >> In order to support all pthread operations in the RVV environment, here > >> PTHREAD_STACK_MIN is set to 4 times GLRO(dl_minsigstacksize), and the > >> default PTHREAD_STACK_MIN is expanded to 20K bytes. > > > > A change to PTHREAD_STACK_MIN has been considered an ABI change in the > > past, requiring new symbol versions for pthread_attr_setstack and > > pthread_attr_setstacksize to ensure that binaries built with the old > > PTHREAD_STACK_MIN definition continue to work rather than failing because > > the old size is too small. You may need symbol versioning updates for > > those functions in RISC-V if you make such a change. (All the existing > > versioning support for this in architecture-independent files assumes the > > change in value was done before libpthread was merged into libc, so there > > will be some extra work involved in being the first architecture to > > increase PTHREAD_STACK_MIN after that merge.) > > Instead it may make sense to leave PTHREAD_STACK_MIN as is and switch to > the dynamic version (same for the SIGSTKSZ constants). > I don't know what problem RISC-V ran into. It should be fixed with: commit 5d98a7dae955bafa6740c26eaba9c86060ae0344 Author: H.J. Lu Date: Mon Jun 21 12:42:56 2021 -0700 Define PTHREAD_STACK_MIN to sysconf(_SC_THREAD_STACK_MIN) The constant PTHREAD_STACK_MIN may be too small for some processors. Rename _SC_SIGSTKSZ_SOURCE to _DYNAMIC_STACK_SIZE_SOURCE. When _DYNAMIC_STACK_SIZE_SOURCE or _GNU_SOURCE are defined, define PTHREAD_STACK_MIN to sysconf(_SC_THREAD_STACK_MIN) which is changed to MIN (PTHREAD_STACK_MIN, sysconf(_SC_MINSIGSTKSZ)). Consolidate with to provide a constant target specific PTHREAD_STACK_MIN value. Reviewed-by: Carlos O'Donell -- H.J.