From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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> From: "H.J. Lu" 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 Cc: Joseph Myers , Vincent Chen , GNU C Library , Andrew Waterman Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3024.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org 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: , X-List-Received-Date: Wed, 15 Sep 2021 14:31:49 -0000 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.