From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id +xBVMa6au2rMChcAWB0awg (envelope-from ) for ; Tue, 29 Sep 2026 07:02:06 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=WxiNYpQW; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id B64A91E06B; Tue, 29 Sep 2026 07:02:06 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 083631E033 for ; Tue, 29 Sep 2026 07:02:05 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 903EE4BB3B8D for ; Tue, 29 Sep 2026 11:02:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 903EE4BB3B8D Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=WxiNYpQW Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 6F1394BB1C3B for ; Tue, 29 Sep 2026 11:01:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6F1394BB1C3B Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6F1394BB1C3B Authentication-Results: sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1790679677; cv=none; b=I5aBf98uelv+kxp7FunrWZC5ED+JDglXCWJSugu8dj3xeYIrBdAf/rNdt6FN2DbPMuBZo3DSQwCwxA9ujVUHuJ7FvkYAvWyPxdmZgOjqiOia2JSVfrmIt5P10iS4ZcN4hW8O8pJKw3lKJY5YlqzQp4tD1vailRmJgQjRx3WilHc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1790679677; c=relaxed/simple; bh=rG6NBOzFf7q1O35CJWmFquvd6A4gNCOehnhV4Q083s0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=R8bz3iXCwUJtNGYgA+al2mO0A1F+rKY0IFcywUMto4Bj6ApFpbKrRe2lxu7gQ3pyjdBJdlWa6azny6r7kC2Y8aqpEMe3pofJw1S31rm7KbHTiiIz072eFAC9KvtiLYnBEJB8PfcIqR2X9PZejRPQcWlIFe+mh5CM89mCr30mwGc= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=WxiNYpQW DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6F1394BB1C3B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1790679676; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=qWIDh9K+I6g7YCEAJKKyF6nyGHcC6pjl+PwqP7G6hek=; b=WxiNYpQWt3vyqOw9e9ZbTuz792QT+gYFb4tDJWr//7v78hyFa0TKtSnRfukOjM/WQ7ObW9 HyidfiXXSuUviHC9UStDD4BrPHmuUrMF5CFygrhwyp8INFNTev//RdGN7gD0WsH5MuooGB YmUanAYIk5upmJ7eib2Q5xD+2KPsWM0= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-581-M79kRIEePeK4P1a5PiZR6g-1; Tue, 29 Sep 2026 07:01:10 -0400 X-MC-Unique: M79kRIEePeK4P1a5PiZR6g-1 X-Mimecast-MFC-AGG-ID: M79kRIEePeK4P1a5PiZR6g_1790679669 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-c29959eb71fso415876666b.1 for ; Tue, 29 Sep 2026 04:01:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790679669; x=1791284469; h=content-type:mime-version:message-id:date:references:in-reply-to :subject:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=qWIDh9K+I6g7YCEAJKKyF6nyGHcC6pjl+PwqP7G6hek=; b=tWZnP0tUAP/ehra0gK7Cb2T1zdc9aX0BWW1Tp5JpniiiDl4N9XyN4tT/mNzarR327e gLLFGbAg1LxAeZdT+wqdJYMTqa3WMbTE6iofihRMMf7SnK6DmrCQqb9Scob1j95VXSpT FhcKrAHCIdpu7EgiOYJjQHozuMzTLLaGX964J4byXlAK4MyaO+5hZT5q7vcTVl96RFdV Vk7Sj4wWF4qc4qWsRNhRyu2aFpMlkFRmwe/eD1hrRd07Wg3eHhbH3XbnPvgRx++IgGl2 TbRztItNJrXjMl3/06Tlc2Y0IMux0s1QNb+APEkuKQ6n35cG+n9y3GTLPI2bF45dyEzH iMMA== X-Forwarded-Encrypted: i=1; AKwUvBzFv08G1Wwqo/HSNynMnOkYiPvZj9DLEGitHSfhsj8yRDDDFv/yGcPzREcH71GM5uCfzJ3r+DU7Rj1NPg==@sourceware.org X-Gm-Message-State: AFuF++mg0AQkxlAENZ3u6BiGrH13NRanBeSo0qXMms0Hv/wghoNTIPGX M6AwGd4yTWdmLLSNdwmmHQLuB8jTn31esu5foYsBaDSZMGJUemKnlvxOtj9U3dP2fWGbE7uRQHj DiRnqc7lDEuDSsx0cSGhlhzAuQ71y02eUvJokQUepLX+c3poXoKTX//iUeOetq1o= X-Gm-Gg: AYBFou3akXvRWc23uGKv1CcUn0c167rDKEbyiqiBlgU8RhP+dzZyTv/MiW7AKAcp9UX vCOjX43fmGEqgkmflyGGdp1y+0VOOaZMF1wOJ2T3jo3dcb4bQICL1l7DrsWc1a5VQidxJAcMgrD f0qkwkBugUr+pVmS11g9MkbfFVmSY8hXTzIfjxW2HKPu/q5ubFaJbzTZG1DYvzhxIQzY5OTrCwy AToeohyrnpG8ZX7mbXBJf2p/XrhBw8N1x2tk3ta0fe8tWihRwpR0QDuglSWWdWiM1l/0vdFqLWn 0JeLEaIiArz5MZmDjBothC8HsiuD1ccZ7J2QB0vLTQXaCjsVqOZqnFxzLDIsfUMqOQij X-Received: by 2002:a17:907:1997:b0:c29:9691:ec9d with SMTP id a640c23a62f3a-c2ac52d6e4cmr1221663166b.22.1790679667716; Tue, 29 Sep 2026 04:01:07 -0700 (PDT) X-Received: by 2002:a17:907:1997:b0:c29:9691:ec9d with SMTP id a640c23a62f3a-c2ac52d6e4cmr1221656966b.22.1790679666976; Tue, 29 Sep 2026 04:01:06 -0700 (PDT) Received: from localhost ([213.31.44.29]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48af505e699sm3297421f8f.20.2026.09.29.04.01.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Sep 2026 04:01:06 -0700 (PDT) From: Andrew Burgess To: Tom de Vries , gdb-patches@sourceware.org Subject: Re: [PATCH] [gdb] Check for sched_getaffinity in configure In-Reply-To: <20260917124042.3215076-1-tdevries@suse.de> References: <20260917124042.3215076-1-tdevries@suse.de> Date: Tue, 29 Sep 2026 12:01:05 +0100 Message-ID: <87tsn8z5hq.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: rKxl2087xwrlQgSxzGTbuRKkzw9aUr1VHvCXAdAlsYw_1790679669 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org Tom de Vries writes: > A post-commit review comment [1] on commit 8ea833b7067 ("[gdb] Exclude > unavailable hardware threads in default worker-threads") mentioned that we > should: > - check for the presence of sched_getaffinity in configure > - remove the todo comment. > > Implement these two. Makes sense to me. Approved-By: Andrew Burgess Thanks, Andrew > > [1] https://sourceware.org/pipermail/gdb-patches/2026-September/230415.html > --- > gdb/config.in | 3 +++ > gdb/configure | 1 + > gdb/configure.ac | 1 + > gdb/maint.c | 6 ++---- > 4 files changed, 7 insertions(+), 4 deletions(-) > > diff --git a/gdb/config.in b/gdb/config.in > index 74745665d4d..0e5a6637c2b 100644 > --- a/gdb/config.in > +++ b/gdb/config.in > @@ -430,6 +430,9 @@ > /* Define to 1 if you have the `sbrk' function. */ > #undef HAVE_SBRK > > +/* Define to 1 if you have the `sched_getaffinity' function. */ > +#undef HAVE_SCHED_GETAFFINITY > + > /* Define to 1 if you have the `setlocale' function. */ > #undef HAVE_SETLOCALE > > diff --git a/gdb/configure b/gdb/configure > index f411113ea66..810e9ed7a37 100755 > --- a/gdb/configure > +++ b/gdb/configure > @@ -30161,6 +30161,7 @@ for ac_func in \ > pread64 \ > pwrite \ > resize_term \ > + sched_getaffinity \ > setlocale \ > setrlimit \ > setsid \ > diff --git a/gdb/configure.ac b/gdb/configure.ac > index 5d8e2d6628f..0d88a280b16 100644 > --- a/gdb/configure.ac > +++ b/gdb/configure.ac > @@ -1542,6 +1542,7 @@ AC_CHECK_FUNCS([ \ > pread64 \ > pwrite \ > resize_term \ > + sched_getaffinity \ > setlocale \ > setrlimit \ > setsid \ > diff --git a/gdb/maint.c b/gdb/maint.c > index 800cf7e0cda..ed57b34eab5 100644 > --- a/gdb/maint.c > +++ b/gdb/maint.c > @@ -47,7 +47,7 @@ > #include "cli/cli-style.h" > #include "cli/cli-cmds.h" > > -#if defined (__linux__) || defined (__CYGWIN__) > +#if HAVE_SCHED_GETAFFINITY > #include > #endif > > @@ -891,13 +891,11 @@ update_thread_pool_size () > { > /* Exclude unavailable hardware threads (for instance made > unavailable using taskset). */ > -#if (defined (__linux__) || defined (__CYGWIN__)) && defined (_GNU_SOURCE) > +#if HAVE_SCHED_GETAFFINITY > cpu_set_t cpus; > int res = sched_getaffinity (getpid (), sizeof (cpu_set_t), &cpus); > if (res == 0) > n_threads = std::min (n_threads, CPU_COUNT (&cpus)); > -#else > - /* Todo: handle other platforms. */ > #endif > } > } > > base-commit: 4c733e49e3da1eab7991ab64c5bb75c7a56bf48a > -- > 2.51.0