From patchwork Sun Feb 9 17:32:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 1235497 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-109297-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha1 header.s=default header.b=gLjdEtHz; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48Fx1k3Nskz9sPF for ; Mon, 10 Feb 2020 04:32:26 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; q=dns; s=default; b=LlZ JMWozrPkNZATpVU6IY/bYXUMJ4qbjNCNs0ntf+2YLu9LNChp02MpBlDfVUjbYedj o7El7pRReAz0uf+CRMwGL9FWZk5r1l3aE+XT6Z3IhXXpBcNjq1G3GkeQ1t8FKfUx 6gIO16MumJr0Q3BbKR4KOnHOaF3bAihiAtnZY02s= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; s=default; bh=Z3Lx+XsUS /Cn3FW5TGbQ4DOsU8M=; b=gLjdEtHzaAWqhR8ZnWzsBUsXUPTR17xgYnGCZRzri PWYgMCwa+Lv8BQ5O6+gd98O+ipDiFsf4Gk/CJvSwio+9A4mFiAglsf5xvTDDsJlN V1N70plJaDF8Esxag8ZmLMni3FX1qS2h8HcF1rUjW2oNAXFxXCxC61ZcKicpjCXx eY= Received: (qmail 71226 invoked by alias); 9 Feb 2020 17:32:12 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 71203 invoked by uid 89); 9 Feb 2020 17:32:09 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_NEUTRAL autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1676, HContent-Transfer-Encoding:8bit X-HELO: hera.aquilenet.fr From: Samuel Thibault To: libc-alpha@sourceware.org Cc: Samuel Thibault , commit-hurd@gnu.org Subject: [hurd,commited 1/2] htl: Fix default guard size Date: Sun, 9 Feb 2020 18:32:01 +0100 Message-Id: <20200209173202.287052-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 When it is not hardcoded by the architecture with PAGESIZE, we need to use the dynamic values from __vm_page_size. --- htl/pt-internal.h | 2 +- sysdeps/htl/pt-attr.c | 2 +- sysdeps/mach/hurd/htl/pt-sysdep.c | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/htl/pt-internal.h b/htl/pt-internal.h index 9147b87740..064e795157 100644 --- a/htl/pt-internal.h +++ b/htl/pt-internal.h @@ -304,7 +304,7 @@ extern error_t __pthread_sigstate (struct __pthread *__restrict thread, int how, /* Default thread attributes. */ -extern const struct __pthread_attr __pthread_default_attr; +extern struct __pthread_attr __pthread_default_attr; /* Default barrier attributes. */ extern const struct __pthread_barrierattr __pthread_default_barrierattr; diff --git a/sysdeps/htl/pt-attr.c b/sysdeps/htl/pt-attr.c index 1426fac67e..fb41e4859f 100644 --- a/sysdeps/htl/pt-attr.c +++ b/sysdeps/htl/pt-attr.c @@ -23,7 +23,7 @@ #include -const struct __pthread_attr __pthread_default_attr = { +struct __pthread_attr __pthread_default_attr = { __schedparam: { sched_priority: 0 }, __stacksize: 0, __stackaddr: NULL, diff --git a/sysdeps/mach/hurd/htl/pt-sysdep.c b/sysdeps/mach/hurd/htl/pt-sysdep.c index 32a290c4ee..84d191475d 100644 --- a/sysdeps/mach/hurd/htl/pt-sysdep.c +++ b/sysdeps/mach/hurd/htl/pt-sysdep.c @@ -78,6 +78,10 @@ _init_routine (void *stack) valid if the main thread terminates. */ thread->stack = 0; +#ifndef PAGESIZE + __pthread_default_attr.__guardsize = __vm_page_size; +#endif + ___pthread_self = thread; /* Decrease the number of threads, to take into account that the From patchwork Sun Feb 9 17:32:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 1235496 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-109296-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha1 header.s=default header.b=W2xKnuLS; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48Fx1Z31Xqz9sPF for ; Mon, 10 Feb 2020 04:32:18 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; q=dns; s= default; b=DqcDUjss8C/0L+pPrUQMEbxiFGZom8pBTx+iaqs31D5ukE2QBZ11l wFWeAb/zqoG5mBMZ7yPO6nK1V0pOiENGuLkxqhzzpdRLyUKzCHXrqiPVbr+ufKcO in14clWTKoPxZ2gPYu2O+P8rFqgo5VnzZKZkbcAswUdE+kHv5hXbxY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; s=default; bh=M9Fy+w0xlP1+SLnoRPdygNV1QOU=; b=W2xKnuLS+qN+Rewxkt5FHV6uz5aC dwLtp3GhozhSS86q42W3NrQ/lZgZQOiWhZ4mddvBEQEN7I9gbn6EkvGYRNl1ayP/ fwOsefkzcuY8ZD9Qm8kV3KefTIb+sFe5BSVtbA095yg8yPjzGxEQ9U3yvdzrK+k6 O12qOZmJXFQWAMQ= Received: (qmail 71217 invoked by alias); 9 Feb 2020 17:32:11 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 71204 invoked by uid 89); 9 Feb 2020 17:32:09 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-23.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_NEUTRAL autolearn=ham version=3.3.1 spammy= X-HELO: hera.aquilenet.fr From: Samuel Thibault To: libc-alpha@sourceware.org Cc: Samuel Thibault , commit-hurd@gnu.org Subject: [hurd, commited 2/2] pthread: Move some attr tests from nptl to sysdeps/pthread Date: Sun, 9 Feb 2020 18:32:02 +0100 Message-Id: <20200209173202.287052-2-samuel.thibault@ens-lyon.org> In-Reply-To: <20200209173202.287052-1-samuel.thibault@ens-lyon.org> References: <20200209173202.287052-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 So they can be checked with htl too. --- nptl/Makefile | 2 +- sysdeps/pthread/Makefile | 1 + {nptl => sysdeps/pthread}/tst-attr1.c | 0 3 files changed, 2 insertions(+), 1 deletion(-) rename {nptl => sysdeps/pthread}/tst-attr1.c (100%) diff --git a/nptl/Makefile b/nptl/Makefile index 774cf0a754..51a0be008b 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -234,7 +234,7 @@ LDLIBS-tst-thread-exit-clobber = -lstdc++ CFLAGS-tst-minstack-throw.o = -std=gnu++11 LDLIBS-tst-minstack-throw = -lstdc++ -tests = tst-attr1 tst-attr2 tst-attr3 tst-default-attr \ +tests = tst-attr2 tst-attr3 tst-default-attr \ tst-mutex5 tst-mutex7 tst-mutex9 tst-mutex11 tst-mutex5a tst-mutex7a \ tst-mutex7robust tst-mutexpi1 tst-mutexpi2 tst-mutexpi3 tst-mutexpi4 \ tst-mutexpi5 tst-mutexpi5a tst-mutexpi6 tst-mutexpi7 tst-mutexpi7a \ diff --git a/sysdeps/pthread/Makefile b/sysdeps/pthread/Makefile index fb467d8e79..5117110210 100644 --- a/sysdeps/pthread/Makefile +++ b/sysdeps/pthread/Makefile @@ -42,6 +42,7 @@ libpthread-routines += thrd_create thrd_detach thrd_exit thrd_join \ tests += tst-cnd-basic tst-mtx-trylock tst-cnd-broadcast \ tst-cnd-timedwait tst-thrd-detach tst-mtx-basic tst-thrd-sleep \ tst-mtx-recursive tst-tss-basic tst-call-once tst-mtx-timedlock \ + tst-attr1 \ tst-basic1 tst-basic2 tst-basic3 tst-basic4 tst-basic5 tst-basic6 \ tst-basic7 \ tst-mutex1 tst-mutex2 tst-mutex3 tst-mutex4 tst-mutex6 tst-mutex10 \ diff --git a/nptl/tst-attr1.c b/sysdeps/pthread/tst-attr1.c similarity index 100% rename from nptl/tst-attr1.c rename to sysdeps/pthread/tst-attr1.c