From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ACD74C369B1 for ; Wed, 16 Apr 2025 06:41:36 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Zcrz24Wvnz2y06; Wed, 16 Apr 2025 16:41:34 +1000 (AEST) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1744785694; cv=none; b=SD7tAwLetVyAm/5Eqm3JBhKFj8+8KY4xaW7ouAHsGbDgStYe6ycg7fJSyS8ZRCbvSYOtp0lnDMShrxYk9PiP8oQMcGJILoXBxaPxT6xMeOuL5+r00kOU+C1ODlyhaeKYYMy6js8VdJc1Zpx9nrUU5060DceglhwYcWvzFEMHKbeE8g18z2cPO8qnK78hg7sNiwLJSJTa58KOf5axxzdAamcjX1P8Q9KX7qTT3tr2MY3gqgaVmoGDJaUk8c1O6fuSYWSsi7vhKETC7TepSkLbl2AmGFIJCtuDQMUUCLN+52E8uIA1JU0P9vBgPRCw+M/y7tthJSWNmYGdckW02Sy21Q== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1744785694; c=relaxed/relaxed; bh=CjiUfw8sFjLkVHZFD2DU255iU4N7QuXe4GHriAkYEUY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=oKIL3qt2OTjiCl0XZCZbswyWGYsFO44+Vbg86+59Xlyen2oWzy67IodVfVtNZG/NCEF0E5kGSNYYhYoAYqG3QjvWYFt6/mZOXhfaOR5cTXXIVYOvuPA9MPA7DCyheKXzr3n9nfVL2Y0HOWHUzpdLY8wJkU7Wgr4xdgO12MfRJLHniHuB4wmFpIlpLNWDvuz0LpC1scVYyYxUW8n83bweCprbnOJ70k1Dz+FNwaQQkIXyRWKQiCadWOodT3F+q2TD5n+5HMHi5zGt4YYdVK4L72brwcicpuqLiCw2vNZP94r57LJJHMVtNY2aMUUhIKEUlbtKIMdxaTZ8QaLSYAn3BA== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; dkim=pass (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=i/FekEqy; dkim-atps=neutral; spf=pass (client-ip=148.163.158.5; helo=mx0b-001b2d01.pphosted.com; envelope-from=vineethr@linux.ibm.com; receiver=lists.ozlabs.org) smtp.mailfrom=linux.ibm.com Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=i/FekEqy; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.ibm.com (client-ip=148.163.158.5; helo=mx0b-001b2d01.pphosted.com; envelope-from=vineethr@linux.ibm.com; receiver=lists.ozlabs.org) Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Zcrz069JQz2xqG for ; Wed, 16 Apr 2025 16:41:32 +1000 (AEST) Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 53FIdvdP021151; Wed, 16 Apr 2025 06:41:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:reply-to:subject:to; s=pp1; bh=CjiUfw8sFjLkVHZFD2DU255iU4N7QuXe4GHriAkYEUY=; b=i/FekEqyvSO6 2owF0T24+zqiBofcXJbqEhwrjGRlEk12Vc6t8/pvRyji0Fo4D/XP1JQaS076YY0Z gaFcwm8l6Bj+GdnwtcJegbqQszXHXCOw4RVhCahqzYm2VWMIZMi2eLq4FxicOINo /FxB9hIzJSGrWmndFu50NziKlCx5h7TKn3yv8hMZW/KJ8qmZuJZKJkW1tDn1kzB/ PEDQxr/BmmGJ3sx39+LdUWY21vE23zV91+u+salcfA7tW6etUNb62fi5fouvCmeI 76Y7ScXpzKBYsyw6XYN4cCak+5HTWvcsAtrprbDgnDxscXxpesgGWsRaxHNz7Zgw JtE2pCW3vw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 461nwq4tj6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 16 Apr 2025 06:41:02 +0000 (GMT) Received: from m0356516.ppops.net (m0356516.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 53G6V5oa011439; Wed, 16 Apr 2025 06:41:01 GMT Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 461nwq4tj3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 16 Apr 2025 06:41:01 +0000 (GMT) Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 53G5Hvvk024907; Wed, 16 Apr 2025 06:41:00 GMT Received: from smtprelay01.wdc07v.mail.ibm.com ([172.16.1.68]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 4602gtf8be-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 16 Apr 2025 06:41:00 +0000 Received: from smtpav02.dal12v.mail.ibm.com (smtpav02.dal12v.mail.ibm.com [10.241.53.101]) by smtprelay01.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 53G6ew0s30147250 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 16 Apr 2025 06:40:59 GMT Received: from smtpav02.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DED5D58051; Wed, 16 Apr 2025 06:40:58 +0000 (GMT) Received: from smtpav02.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C76C25805A; Wed, 16 Apr 2025 06:40:53 +0000 (GMT) Received: from [9.204.206.228] (unknown [9.204.206.228]) by smtpav02.dal12v.mail.ibm.com (Postfix) with ESMTP; Wed, 16 Apr 2025 06:40:53 +0000 (GMT) Message-ID: Date: Wed, 16 Apr 2025 12:10:52 +0530 X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] powerpc/defconfigs: Set HZ=1000 on ppc64 and powernv defconfigs To: Madhavan Srinivasan Cc: Michael Ellerman , Nicholas Piggin , Christophe Leroy , Naveen N Rao , Ard Biesheuvel , Eric Biggers , "Martin K . Petersen" , Andrew Morton , Yosry Ahmed , Tamir Duberstein , Srikar Dronamraju , Shrikanth Hegde , linuxppc-dev@lists.ozlabs.org, LKML , Madadi Vineeth Reddy References: <20250330074734.16679-1-vineethr@linux.ibm.com> Content-Language: en-US Reply-To: 20250330074734.16679-1-vineethr@linux.ibm.com From: Madadi Vineeth Reddy In-Reply-To: <20250330074734.16679-1-vineethr@linux.ibm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: kWUkxHY8twDaPpL0eNjfFgoUhd4rx9Fm X-Proofpoint-GUID: HtE-QrCrCo0uoyvGmgm9Bh0Rr0WgE71d X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1095,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-04-16_02,2025-04-15_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 suspectscore=0 clxscore=1015 bulkscore=0 priorityscore=1501 mlxscore=0 spamscore=0 malwarescore=0 mlxlogscore=999 impostorscore=0 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2502280000 definitions=main-2504160052 Hi Maddy, Ping. Any thoughts on this? Can it be picked up? Thanks, Madadi Vineeth Reddy On 30/03/25 13:17, Madadi Vineeth Reddy wrote: > Commit 030bdc3fd080 ("powerpc/defconfigs: Set HZ=100 on pseries and ppc64 > defconfigs") lowered CONFIG_HZ from 250 to 100, citing reduced need for a > higher tick rate due to high-resolution timers and concerns about timer > interrupt overhead and cascading effects in the timer wheel. > > However, improvements have been made to the timer wheel algorithm since > then, particularly in eliminating cascading effects at the cost of minor > timekeeping inaccuracies. More details are available here > https://lwn.net/Articles/646950/. This removes the original concern about > cascading, and the reliance on high-resolution timers is not applicable > to the scheduler, which still depends on periodic ticks set by CONFIG_HZ. > > With the introduction of the EEVDF scheduler, users can specify custom > slices for workloads. The default base_slice is 3ms, but with CONFIG_HZ=100 > (10ms tick interval), base_slice is ineffective. Workloads like stress-ng > that do not voluntarily yield the CPU run for ~10ms before switching out. > Additionally, setting a custom slice below 3ms (e.g., 2ms) should lower > task latency, but this effect is lost due to the coarse 10ms tick. > > By increasing CONFIG_HZ to 1000 (1ms tick), base_slice is properly honored, > and user-defined slices work as expected. Benchmark results support this > change: > > Latency improvements in schbench with EEVDF under stress-ng-induced noise: > > Scheduler CONFIG_HZ Custom Slice 99th Percentile Latency (µs) > -------------------------------------------------------------------- > EEVDF 1000 No 0.30x > EEVDF 1000 2 ms 0.29x > EEVDF (default) 100 No 1.00x > > Switching to HZ=1000 reduces the 99th percentile latency in schbench by > ~70%. This improvement occurs because, with HZ=1000, stress-ng tasks run > for ~3ms before yielding, compared to ~10ms with HZ=100. As a result, > schbench gets CPU time sooner, reducing its latency. > > Daytrader Performance: > > Daytrader results show minor variation within standard deviation, > indicating no significant regression. > > Workload (Users/Instances) Throughput 1000HZ vs 100HZ (Std Dev%) > -------------------------------------------------------------------------- > 30 u, 1 i +3.01% (1.62%) > 60 u, 1 i +1.46% (2.69%) > 90 u, 1 i –1.33% (3.09%) > 30 u, 2 i -1.20% (1.71%) > 30 u, 3 i –0.07% (1.33%) > > Avg. Response Time: No Change (=) > > pgbench select queries: > > Metric 1000HZ vs 100HZ (Std Dev%) > ------------------------------------------------------------------ > Average TPS Change +2.16% (1.27%) > Average Latency Change –2.21% (1.21%) > > Average TPS: Higher the better > Average Latency: Lower the better > > pgbench shows both throughput and latency improvements beyond standard > deviation. > > Given these results and the improvements in timer wheel implementation, > increasing CONFIG_HZ to 1000 ensures that powerpc benefits from EEVDF’s > base_slice and allows fine-tuned scheduling for latency-sensitive > workloads. > > Signed-off-by: Madadi Vineeth Reddy > --- > arch/powerpc/configs/powernv_defconfig | 2 +- > arch/powerpc/configs/ppc64_defconfig | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/powerpc/configs/powernv_defconfig b/arch/powerpc/configs/powernv_defconfig > index 6b6d7467fecf..8abf17d26b3a 100644 > --- a/arch/powerpc/configs/powernv_defconfig > +++ b/arch/powerpc/configs/powernv_defconfig > @@ -46,7 +46,7 @@ CONFIG_CPU_FREQ_GOV_POWERSAVE=y > CONFIG_CPU_FREQ_GOV_USERSPACE=y > CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y > CONFIG_CPU_IDLE=y > -CONFIG_HZ_100=y > +CONFIG_HZ_1000=y > CONFIG_BINFMT_MISC=m > CONFIG_PPC_TRANSACTIONAL_MEM=y > CONFIG_PPC_UV=y > diff --git a/arch/powerpc/configs/ppc64_defconfig b/arch/powerpc/configs/ppc64_defconfig > index 5fa154185efa..45d437e4c62e 100644 > --- a/arch/powerpc/configs/ppc64_defconfig > +++ b/arch/powerpc/configs/ppc64_defconfig > @@ -57,7 +57,7 @@ CONFIG_CPU_FREQ_GOV_POWERSAVE=y > CONFIG_CPU_FREQ_GOV_USERSPACE=y > CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y > CONFIG_CPU_FREQ_PMAC64=y > -CONFIG_HZ_100=y > +CONFIG_HZ_1000=y > CONFIG_PPC_TRANSACTIONAL_MEM=y > CONFIG_KEXEC=y > CONFIG_KEXEC_FILE=y