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 97BFFFCEE82 for ; Wed, 25 Feb 2026 11:15:48 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4fLX8305Dxz3f1h; Wed, 25 Feb 2026 22:15:47 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip="2600:3c04:e001:324:0:1991:8:25" ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1772018146; cv=none; b=bcjspgJscwUtIWezFlpKBCQ+b3vbpcHpaP+1VlKvUslFey7b6zMMqrUboJ0HZ8xoQ137Eu/KnW5MOJNtdPWTl8iVgs1C4Djpunzkz2V8f8NuAj+FsS28yaMRQFnSS6qR6q14mop27kjpPJkItBM/SmyO+UcfXh5NndosRs+riCVqPQCkpoukn0Sn1tVkdIHakW1ad5JOjePqub5fKf7Kh5YnQ+Hwo+Zyn1CWsW8OCnLUZSelr9JbXcXW3KLYQjwyZE8mQ5fvU4xgrifmEiQ37WDcTpoNsCyms0fvdHEM6jhaqwHqHwytMZNF/BC4g/AsPgHbl4qfvfbQU17tXqUjSA== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1772018146; c=relaxed/relaxed; bh=74s0nOeiCZF+5M+nsZxnyeTIQ77pngxvhLdNenvrd8E=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=MF0Wo4ypolakRpT0IqxtwLLhJfsYKurV+071utF8mU/Hy2AEW/IP42WqrSLlEH5g0yWZD6csYxI8sMgsc4CzW4R1rMS8ssN4Dn8P0YeLzFx9HR6oGTF5udjdWS/q2+N25mQGIDGE8iFQMMKa5y/aikj1TW4yGFrPODj4i/mK1pfYpUHw/R/VvbtqGMQmIWv7fATVF4wCSM8yq7rmZsjdn5+euYYPIan9eRsFotqIoljlACSsoSemajqxJnIYnHbN+w+uyhqIw3J7FWxni3uaE5cOTiBQxc5Z+XFlxFEH5E7wYDoNGtv+bUtT94Np8eqHFPX8/im6dJJe+iij1ah9ng== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=glkmO39J; dkim-atps=neutral; spf=pass (client-ip=2600:3c04:e001:324:0:1991:8:25; helo=tor.source.kernel.org; envelope-from=chleroy@kernel.org; receiver=lists.ozlabs.org) smtp.mailfrom=kernel.org Authentication-Results: lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=glkmO39J; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=2600:3c04:e001:324:0:1991:8:25; helo=tor.source.kernel.org; envelope-from=chleroy@kernel.org; receiver=lists.ozlabs.org) Received: from tor.source.kernel.org (tor.source.kernel.org [IPv6:2600:3c04:e001:324:0:1991:8:25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4fLX8212vJz3f1g for ; Wed, 25 Feb 2026 22:15:46 +1100 (AEDT) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 18D4C600AA; Wed, 25 Feb 2026 11:15:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8A061C19423; Wed, 25 Feb 2026 11:14:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772018143; bh=bQpUX9iESFZR79pF0V6kpKQNgWEfKF3IUuiMBPbrNgY=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=glkmO39JGsJMFCHHzK2xRPLw4dlCOyTH5mgj5Q9vk6Zk7TByZ7LEpSWTzYGIjL0mK U+B/jmw1j1Ds6/2/I+WscMESWXrpHEOJvEuqzzikYZeEYd3rU9+f6FT4U6M2KHJ6ko LV3O8PezUudPfjHW4yNU7EoRqmFH6lGK5Dly13vOvrXfyqAt01v63kCQns//79aNad IW0wfZ7Ywvu1KVT9170lo8SZ5wFcsCeHkHD9elO+bEPSs61OygkXTUln5RA48o4b+L 9+0tcrvFmg1LVDcIQtXLsJycvs81SHxMTSJI9QjbNwy0Nbe6yFfGPh79mWQkzbQwHq Ean2jR2uiNoBQ== Message-ID: Date: Wed, 25 Feb 2026 12:14:35 +0100 X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 04/15] powerpc/time: Prepare to stop elapsing in dynticks-idle To: Shrikanth Hegde , Frederic Weisbecker , LKML , Madhavan Srinivasan Cc: "Rafael J. Wysocki" , Alexander Gordeev , Anna-Maria Behnsen , Ben Segall , Boqun Feng , Christian Borntraeger , Dietmar Eggemann , Heiko Carstens , Ingo Molnar , Jan Kiszka , Joel Fernandes , Juri Lelli , Kieran Bingham , Mel Gorman , Michael Ellerman , Neeraj Upadhyay , Nicholas Piggin , "Paul E . McKenney" , Peter Zijlstra , Steven Rostedt , Sven Schnelle , Thomas Gleixner , Uladzislau Rezki , Valentin Schneider , Vasily Gorbik , Vincent Guittot , Viresh Kumar , Xin Zhao , linux-pm@vger.kernel.org, linux-s390@vger.kernel.org, linuxppc-dev@lists.ozlabs.org References: <20260206142245.58987-1-frederic@kernel.org> <20260206142245.58987-5-frederic@kernel.org> <9413517d-963b-4e6d-b11b-b440acd7cb5a@linux.ibm.com> <9ab1e7d7-57ee-49f9-963c-3a1b96dda684@kernel.org> <120884b0-0b09-43a9-b0f6-7dc2affe1ac0@linux.ibm.com> <55720b5b-f643-4e67-8841-d81a9e712faf@kernel.org> Content-Language: fr-FR From: "Christophe Leroy (CS GROUP)" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi Hegde, Le 25/02/2026 à 11:34, Shrikanth Hegde a écrit : > Hi Christophe. > > On 2/25/26 3:15 PM, Christophe Leroy (CS GROUP) wrote: >> >> Hope it is more explicit now. >> > > Got it. The main concern was around with additional computation that > sched_clock, > not any additional paths per se. > > yes, that would be possible, > > > How about we do below? This adds only one subtraction. > This achieves the same outcome. It adds a bit more than just a substration. It adds a call to an extern fonction. 00000164 : 164: 94 21 ff f0 stwu r1,-16(r1) 168: 7c 08 02 a6 mflr r0 16c: 90 01 00 14 stw r0,20(r1) 170: 93 e1 00 0c stw r31,12(r1) 174: 7f ec 42 e6 mftb r31 178: 48 00 00 01 bl 178 178: R_PPC_REL24 get_boot_tb 17c: 81 02 00 08 lwz r8,8(r2) 180: 81 22 00 28 lwz r9,40(r2) 184: 7c 84 f8 50 subf r4,r4,r31 188: 7d 29 40 50 subf r9,r9,r8 18c: 7d 29 22 14 add r9,r9,r4 190: 90 82 00 24 stw r4,36(r2) 194: 91 22 00 08 stw r9,8(r2) 198: 80 01 00 14 lwz r0,20(r1) 19c: 83 e1 00 0c lwz r31,12(r1) 1a0: 7c 08 03 a6 mtlr r0 1a4: 38 21 00 10 addi r1,r1,16 1a8: 4e 80 00 20 blr 000001ac : 1ac: 94 21 ff f0 stwu r1,-16(r1) 1b0: 7c 08 02 a6 mflr r0 1b4: 90 01 00 14 stw r0,20(r1) 1b8: 93 e1 00 0c stw r31,12(r1) 1bc: 7f ec 42 e6 mftb r31 1c0: 48 00 00 01 bl 1c0 1c0: R_PPC_REL24 get_boot_tb 1c4: 81 02 00 0c lwz r8,12(r2) 1c8: 81 22 00 24 lwz r9,36(r2) 1cc: 7c 84 f8 50 subf r4,r4,r31 1d0: 7d 29 40 50 subf r9,r9,r8 1d4: 7d 29 22 14 add r9,r9,r4 1d8: 90 82 00 28 stw r4,40(r2) 1dc: 91 22 00 0c stw r9,12(r2) 1e0: 80 01 00 14 lwz r0,20(r1) 1e4: 83 e1 00 0c lwz r31,12(r1) 1e8: 7c 08 03 a6 mtlr r0 1ec: 38 21 00 10 addi r1,r1,16 1f0: 4e 80 00 20 blr I really still can't see the point of this substraction. At one place we do tb1 = mftb1; acct->utime += (tb1 - acct->starttime_user); acct->starttime = tb1; At the other place we do tb2 = mftb2; acct->stime += (tb2 - acct->starttime); acct->starttime_user = tb2; So at the end we have acct->utime += mftb1 - mftb2; acct->stime += mftb2 - mftb1; You want to change to tb1 = mftb1 - boot_tb; tb2 = mftb2 - boot_tb; At the end we would get acct->utime += mftb1 - boot_tb - mftb2 + boot_tb = mftb1 - mftb2; acct->stime += mftb2 - boot_tb - mftb1 + boot_tb = mftb2 - mftb1; So what's the point in doing such a useless substract that disappears at the end ? What am I missing ? Christophe