From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 8F5183AAB4A5 for ; Thu, 6 May 2021 18:10:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8F5183AAB4A5 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-591-JFUxZk-qOQCT0lBd8HFJJQ-1; Thu, 06 May 2021 14:10:55 -0400 X-MC-Unique: JFUxZk-qOQCT0lBd8HFJJQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9125BC73BC for ; Thu, 6 May 2021 18:10:54 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-112-137.ams2.redhat.com [10.36.112.137]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D5EEF60871 for ; Thu, 6 May 2021 18:10:53 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH 11/13] nptl: Simplify resetting the in-flight stack in __reclaim_stacks In-Reply-To: References: Message-Id: Date: Thu, 06 May 2021 20:11:12 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Thu, 06 May 2021 18:10:58 -0000 stack_list_del overwrites the in-flight stack variable. --- nptl/allocatestack.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c index 12cd1058d4..076cffd35b 100644 --- a/nptl/allocatestack.c +++ b/nptl/allocatestack.c @@ -799,6 +799,8 @@ __reclaim_stacks (void) elem->next->prev = elem->prev; elem->prev->next = elem->next; } + + GL (dl_in_flight_stack) = 0; } /* Mark all stacks except the still running one as free. */ @@ -842,7 +844,7 @@ __reclaim_stacks (void) /* Remove the entry for the current thread to from the cache list and add it to the list of running threads. Which of the two lists is decided by the user_stack flag. */ - stack_list_del (&self->list); + list_del (&self->list); /* Re-initialize the lists for all the threads. */ INIT_LIST_HEAD (&GL (dl_stack_used)); @@ -856,8 +858,6 @@ __reclaim_stacks (void) /* There is one thread running. */ __nptl_nthreads = 1; - GL (dl_in_flight_stack) = 0; - /* Initialize locks. */ GL (dl_stack_cache_lock) = LLL_LOCK_INITIALIZER; __default_pthread_attr_lock = LLL_LOCK_INITIALIZER; -- 2.30.2