From patchwork Mon Nov 11 14:02:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 2009839 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=xXoCE+7i; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XnB8c0SWTz1xty for ; Tue, 12 Nov 2024 01:03:05 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E3E983858C62 for ; Mon, 11 Nov 2024 14:03:03 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by sourceware.org (Postfix) with ESMTPS id 5B4783858D21 for ; Mon, 11 Nov 2024 14:02:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5B4783858D21 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=baylibre.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5B4783858D21 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::335 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1731333764; cv=none; b=x89JkHSS029I2FKquxk/Mtr0bxEiGhvDnuUoTTDM9fb7a1bXGrhO1l1uRa4RABPBRXMWypbr2HaMc1cw1mDPm46r/Im7w07U/Zpz0AmmNrbJsjh0EXwMJZDP1T9Cucz4bBKzysgVMBLdY6UVpB/qAEE0nDJ/pXp+HtEK6l4bdWE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1731333764; c=relaxed/simple; bh=++bhAPvaFEV/UZ+Qo6u4Clw03KtnefC0zjaBN66NaQ0=; h=DKIM-Signature:Message-ID:Date:MIME-Version:To:From:Subject; b=A5LFIzlF9e+F1pX3ZDfuNkzwPjj54Ja8V25oTArMj0KN+SMnaq5jkYeeDsB1Sr+l1yNfg+kb29F5F294iiGy3Kp/FEVvm39rLxTgC6z7p5JvNHmBY+tUmuRpOQKTk3J5+WpnFXf6zMdisZs6ghwSQrsk+sKIX5kArYfpqW3uD04= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-431616c23b5so25874415e9.0 for ; Mon, 11 Nov 2024 06:02:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1731333757; x=1731938557; darn=gcc.gnu.org; h=subject:from:to:content-language:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=++bhAPvaFEV/UZ+Qo6u4Clw03KtnefC0zjaBN66NaQ0=; b=xXoCE+7iwR6PYnj/dcQ4VjYPLce0L3I5k/7fk2WTImaxtKxW5Ocd3sIfMngTRW7ybq r/KR9HkhUAfWxl6WFN6mXNadNUUSX1XPwrzoTEPKDH7gQPZbYie+npN7aeh6k3pcDCZn U9V/8RC5MWHIrOsNHYW03R0GYJzXzbG0Bb0A3w5dR30oLLvFBXcTlrBrWfldAYtaGD8F TyTqf1aXEZ0PGypzPb8P4xhyW5kQsXDZkxISrOhFv3j0k3UvSmah68hP89HVpwInbMnb ufkzWm+AeP9dePsHXywRVbhIBX1PApWjVyaNcmouioULvKpTjv/O1iAtuWJzdb1dJsx+ Pv9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731333757; x=1731938557; h=subject:from:to:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=++bhAPvaFEV/UZ+Qo6u4Clw03KtnefC0zjaBN66NaQ0=; b=WxLhr7erqrXadEe+xntNZ9lh/k5Dkrz7WfBsSDqoO2yRrA7gXw3J5L8T6lQdbqb88x b3+y3SMGJTeYEPRhprMDIk1ySyfACE9/CcAgFI6d1Ie+GavF9gLo9nzpGvszZIWo7AkO geMnpfPAnGXtB48BI8rXjkMAGapaiy3uhy2/HdzwsInedvNVqI4D96D/wwOcHpCaxB6L 5a89WNaE69LIj8LUpUjO4ZdhEjs/EqwUUtOTsXsIh3ZpBb6Fl2FPHve+99ZSquT3KnnI lkQgzR78ckHMEV68bC2UiwYBFZDgYMYIP46xGjo7QQcaZ8rSfbmlmod12asqf1MwI2Tr XckA== X-Gm-Message-State: AOJu0YxWrBQgBWr7IF3B+kpRlxCa9d+4srQ1saUZxIqJNg/K79rQ/3ma ydBzRp9DIS9F76Lpjc3lJnAaiLsUaz/lR6fkm6PGScGI1Uou6TJbqHTCl2tfaZsqmEUhccnRgsp P X-Google-Smtp-Source: AGHT+IEBslZH7+ryWvXJB+dWNnjBxNhe/aCt8jh8ZNWAbdjabGAjLOjrcKywvva18yjF5OUT/awQlw== X-Received: by 2002:a05:600c:501e:b0:42c:b98d:b993 with SMTP id 5b1f17b1804b1-432b74357b7mr111045345e9.2.1731333756803; Mon, 11 Nov 2024 06:02:36 -0800 (PST) Received: from ?IPV6:2001:16b8:26bd:3300:960b:f307:6879:87a4? (200116b826bd3300960bf307687987a4.dip.versatel-1u1.de. [2001:16b8:26bd:3300:960b:f307:6879:87a4]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432bbebed39sm108762735e9.19.2024.11.11.06.02.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 Nov 2024 06:02:36 -0800 (PST) Message-ID: <02ee29b7-f1a7-43a4-87cb-8733555ea684@baylibre.com> Date: Mon, 11 Nov 2024 15:02:33 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: gcc-patches From: Tobias Burnus Subject: [Patch] libgomp.c-c++-common/pr109062.c: Fix expected spin count for hybrid x86 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org I intent to commit the attached patch later today as obvious. It is an older issue I never properly investigated before but finally want to fix it. The issue is that on systems (like my laptop) that have Intel's E and P cores (hybrid x86); testing by Intel has shown that spincount=1 is actually faster, presumably because work can then migrate from E to P cores instead of having P cores blocked by spin-count waits. Tobias PS: For the original issue (i.e. setting it to 1), see https://gcc.gnu.org/PR109812 and https://inbox.sourceware.org/gcc-patches/DM4PR11MB609367F5B9DBD0F6A6B6FC53EACCA@DM4PR11MB6093.namprd11.prod.outlook.com/T/ libgomp.c-c++-common/pr109062.c: Fix expected spin count for hybrid x86 On my system with E and P cores (hybrid) x86, the spincount is by default 1 and not 300000, cf. PR109812 and r14-4571-ge1e127de18dbee. Hence, this commit updates the expected value of the testcase to also accept omp_display_env showing "GOMP_SPINCOUNT = '1'". libgomp/ChangeLog: * testsuite/libgomp.c-c++-common/pr109062.c: diff --git a/libgomp/testsuite/libgomp.c-c++-common/pr109062.c b/libgomp/testsuite/libgomp.c-c++-common/pr109062.c index 5c7c287dafd..cb05c333e0e 100644 --- a/libgomp/testsuite/libgomp.c-c++-common/pr109062.c +++ b/libgomp/testsuite/libgomp.c-c++-common/pr109062.c @@ -11,4 +11,8 @@ main () return 0; } -/* { dg-output ".*\\\[host] GOMP_SPINCOUNT = '300000'.*" { target native } } */ +/* On hybrid x86-64, i.e. with P and E cores, the default is GOMP_SPINCOUNT=1; + hence, handle either value; see PR109812. */ +/* { dg-output ".*\\\[host] GOMP_SPINCOUNT = '(?:300000|1)'.*" { target { native && { x86_64-*-* i?86-*-* } } } } */ + +/* { dg-output ".*\\\[host] GOMP_SPINCOUNT = '300000'.*" { target { native && { ! { x86_64-*-* i?86-*-* } } } } } */