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 [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 28C2A3858401 for ; Thu, 17 Mar 2022 16:16:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 28C2A3858401 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-354-aADaqBu7Mu69Guz9wh1V9A-1; Thu, 17 Mar 2022 12:16:09 -0400 X-MC-Unique: aADaqBu7Mu69Guz9wh1V9A-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0E8EF296A610; Thu, 17 Mar 2022 16:16:09 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.81]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BB55941136E2; Thu, 17 Mar 2022 16:16:08 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.16.1/8.16.1) with ESMTPS id 22HGG5ct169322 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 17 Mar 2022 17:16:06 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 22HGG5n7169321; Thu, 17 Mar 2022 17:16:05 +0100 Date: Thu, 17 Mar 2022 17:16:04 +0100 From: Jakub Jelinek To: Thomas Schwinge Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] openmp: Fix up gomp_affinity_init_numa_domains Message-ID: Reply-To: Jakub Jelinek References: <20211015192634.69CD8286470F@gskx-2.sc.intel.com> <20211018130308.GA304296@tucnak> <87o86qn8bm.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 In-Reply-To: <87o86qn8bm.fsf@euler.schwinge.homeip.net> X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2022 16:16:14 -0000 Hi! On Thu, Nov 11, 2021 at 02:14:05PM +0100, Thomas Schwinge wrote: > There appears to be yet another issue: there still are quite a number of > 'FAIL: libgomp.c/places-10.c execution test' reports on > . Also in my testing testing, on a system > where '/sys/devices/system/node/online' contains '0-1', I get a FAIL: > > [...] > OPENMP DISPLAY ENVIRONMENT BEGIN > _OPENMP = '201511' > OMP_DYNAMIC = 'FALSE' > OMP_NESTED = 'FALSE' > OMP_NUM_THREADS = '8' > OMP_SCHEDULE = 'DYNAMIC' > OMP_PROC_BIND = 'TRUE' > OMP_PLACES = '{0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30},{FAIL: libgomp.c/places-10.c execution test I've finally managed to debug this (by dumping used /sys/ files from an affected system in Fedora build system, replacing /sys/ with /tmp/ in gcc sources and populating there those files), I think following patch ought to fix it. I'll test it tonight in my bootstrap/regtest (but that's a non-numa box), can somebody with a box where places-10.c fails reliably test this too? Thanks. 2022-03-17 Jakub Jelinek * config/linux/affinity.c (gomp_affinity_init_numa_domains): Move seen variable next to pl variable. --- libgomp/config/linux/affinity.c.jj 2022-01-11 23:11:23.887269117 +0100 +++ libgomp/config/linux/affinity.c 2022-03-17 17:05:38.129008653 +0100 @@ -411,11 +411,11 @@ gomp_affinity_init_numa_domains (unsigne { char *p = line; void *pl = NULL; + bool seen = false; while (*p && *p != '\n') { unsigned long first, last; - bool seen = false; errno = 0; first = strtoul (p, &end, 10); Jakub