From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 73F6236F91D for ; Fri, 12 Jun 2026 08:24:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781252677; cv=none; b=FPa4ikfDIXLFdIE4QjVH1kSQcGI8d33ywBl/hgnmU1TmQ0wzX9FwYYX81hSO1SmdMjmZTMr++fVg0axjjME7rWjJIlfjHx2B5QSmC5nzq+XfjvJjIykXdfXhNVlIfZvDl4UIAxsbOT+baVs+qbO5sM4Su5VGuRy06YDdsZoLnXU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781252677; c=relaxed/simple; bh=pHsTtRh3BgJvRzkVkxECUE2h14thLlMYtqhfQrfyDAU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=COnwPgAYKtDYfHKrHuZ+v4cUieY53McbLx56ke+bG8oIhAKweXiaIYO15RSdMv3amiZqwUMPoiKf8SY5kD4WYkXlhDHPY5e/OnoaPclnKZ+1ef67d3AeYWE9JgFRjaKXPtXd7fO8iKxf2kySx2NTehOFBkaAdcLwkMCF2TwrRtA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=TY/zRNk0; arc=none smtp.client-ip=209.85.218.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="TY/zRNk0" Received: by mail-ej1-f44.google.com with SMTP id a640c23a62f3a-bec405a6ea5so105940466b.0 for ; Fri, 12 Jun 2026 01:24:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1781252671; x=1781857471; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=ppN3q6i1kLf7wFBLTi3clAGN0Ie4CZBFcKsjThSzwnI=; b=TY/zRNk0OcTX2xzoYUwnHaiuY4dGE5v3Yf/BCLV3UWKEHlZ153j+srcPgtG8b1p8F4 mMBMrSlc/NBERyh4caQhmZm83ZDZufIFTYniHuUPP0v3vvD8BJknkCJxgGEwFz2H9Z5+ BI/mX+qxYKn3wPXWPF+Bi51zxxLzgF6FALs9GwhO/riy2Ja5PRLUaRs4hPPNCEgJ3EBL CJqa4yZUX5G+dEpl9dwskFCPvmlVwOTr8GmrGZRLZF90IJUOUtbLGv7vfDNeGBRoMYbF hdWybRw3i1K4OB4UQueEEOgjWEbU3JCqGtzdH6SbWs2UXCSuQh9etNqnIC8MjHLWSDyz NsXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781252671; x=1781857471; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ppN3q6i1kLf7wFBLTi3clAGN0Ie4CZBFcKsjThSzwnI=; b=nGBD0UswbIYR6RU9/btBrjdk0BH5eV78FgQuhrn688HXq6OnF0ewLjZZacHoOrYKUb emsY+s4IyqfDasECLE11BGXdR2H56Bd87ETZLxqcFdzuuBE5y0omLckGwai8xoEL71xo sf70hjJaF8lxTjMEcb6BxrISHO3dgWUVD9Lz9Rl9F0jmV9kc74yjw0E0PXgG+gzURk3h 4JBEwFE9Ai1RC4wXnhAZKsardMxewHDL+RZ8Fg20dXzodMAjNNW7Qd549M4M4/Az0lhS T4TMTHdU0kbgHje70R4KxN1ruAIxgceCTIF3qjiihag+F74yJsNj05tkCs/QI0xEHv+x vwlw== X-Forwarded-Encrypted: i=1; AFNElJ9OdxOsCQ3YWmqkyRakrOK5Txl4sfIaHUCzg81mPk49DNEDrCmtmomBVlaiHUGVGYbd8y4wI3FciqyBcMo=@vger.kernel.org X-Gm-Message-State: AOJu0Yw3iS3ZwxXDIeT1TrishGsg2KUwmwDsLJMCy73NTtmv6UcaMyNN Eyl9W+SKWLbGVE0sA1S2r7fyqgJlQxSpukXafWigVYODTYMIDZfbERbnMOayuxJlpPM= X-Gm-Gg: Acq92OF3HEg9zMgkJpNW2+u+oc01gNXv2bg33EMI6m/suTdIEWlMAfIw5hskD4V+o0U V5OwZTOWrqwQ68oR7qYVHCPbLkphI/FDVJXxEziKZbVsvc8CN66OWYuV/J+tsUm7aLZBzCFOc+6 e0KXiramLzSBHzxYqY7a/3Sjdrsx93cW4LLi4wpf5IsL8Zq1QGiPMWfM5qEWubSVgpt0lQjfTS0 Psg+eIldPFe+b0trqSV9qgsqddQzwqHYnEqAp3J3H1F9M0eAkw+MvoTxZrSIgxlcpnXfr81DBGj /g0O4udcfxxWQ9FKbKBj9gXU+le1PVRTwnBekTGfnPUNUW06JGlaAX/9U7m66VYo6dU0xuEXgwd VdcPrBXVr2EBCrlyiSnx1pZb7MVr3lunS75yHjKqsMuGh4R6I4DkC2keV4MCo5m/eq8oy/H4lxR r6lgK64Ao95RDpox5dA9Vyw0pJSwLK X-Received: by 2002:a17:906:ef0d:b0:bec:157:a630 with SMTP id a640c23a62f3a-bfe28e12485mr87169166b.23.1781252670620; Fri, 12 Jun 2026 01:24:30 -0700 (PDT) Received: from [192.168.1.3] ([185.48.77.170]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-bfdb44208c9sm77618266b.13.2026.06.12.01.24.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 12 Jun 2026 01:24:30 -0700 (PDT) Message-ID: <453d71dc-1bd1-40e0-81e4-c578f64f438c@linaro.org> Date: Fri, 12 Jun 2026 09:24:29 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] perf test: Compile named_threads workload with -O0 To: David Laight Cc: Arnaldo Carvalho de Melo , Namhyung Kim , Ian Rogers , Leo Yan , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260611-james-cs-unformatted-per-thread-fix-followup-v1-1-3c855d93dba8@linaro.org> <20260611195449.7230e316@pumpkin> Content-Language: en-US From: James Clark In-Reply-To: <20260611195449.7230e316@pumpkin> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 11/06/2026 7:54 pm, David Laight wrote: > On Thu, 11 Jun 2026 12:13:46 +0100 > James Clark wrote: > >> The work loop relies on the compiler not optimizing it away, although >> named_threads_work is not static for that reason, the compiler could >> still do it. > > Isn't in enough to put barrier() in the loop? > > David > Probably, but I don't think it would make a difference for this specific test workload, and I don't think that style has ever been used for any of the Perf tests. I think Sashiko's comment leading to this was overly pedantic, neither GCC or Clang optimize this away even with -O2. So in this specific case it was only fixing a hypothetical which is why I didn't add a fixes tag. Although I admit there is some chance it could happen with other changes. However, I think -O0 is the appropriate fix for a workload because it makes the stacks and order of execution predictable, which is what the tests look at. And that also has the effect of guaranteeing this isn't optimized away, so we probably don't need both. Thanks James >> >> Fix it by compiling without optimization. Also add -fno-inline for >> consistency and in case anyone wants to look at callstacks. >> >> Signed-off-by: James Clark >> --- >> One trailing Sashiko fix from the "perf cs-etm: Queue context packets >> for frontend" patch series that has been applied already. >> --- >> tools/perf/tests/workloads/Build | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/tools/perf/tests/workloads/Build b/tools/perf/tests/workloads/Build >> index 75b377934a0e..7bb4b9829ba2 100644 >> --- a/tools/perf/tests/workloads/Build >> +++ b/tools/perf/tests/workloads/Build >> @@ -26,3 +26,4 @@ CFLAGS_datasym.o = -g -O0 -fno-inline -U_FORTIFY_SOURCE >> CFLAGS_traploop.o = -g -O0 -fno-inline -U_FORTIFY_SOURCE >> CFLAGS_inlineloop.o = -g -O2 >> CFLAGS_deterministic.o = -g -O0 -fno-inline -U_FORTIFY_SOURCE >> +CFLAGS_named_threads.o = -g -O0 -fno-inline -U_FORTIFY_SOURCE >> >> --- >> base-commit: 7336514f41e75d44782fee7e0990d4195a3d3161 >> change-id: 20260611-james-cs-unformatted-per-thread-fix-followup-babf28a4e640 >> >> Best regards, >