lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260119143552.GH830229@noisy.programming.kicks-ass.net>
Date: Mon, 19 Jan 2026 15:35:52 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Frederic Weisbecker <frederic@...nel.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
	"Christophe Leroy (CS GROUP)" <chleroy@...nel.org>,
	"Rafael J. Wysocki" <rafael@...nel.org>,
	Alexander Gordeev <agordeev@...ux.ibm.com>,
	Anna-Maria Behnsen <anna-maria@...utronix.de>,
	Ben Segall <bsegall@...gle.com>, Boqun Feng <boqun.feng@...il.com>,
	Christian Borntraeger <borntraeger@...ux.ibm.com>,
	Dietmar Eggemann <dietmar.eggemann@....com>,
	Heiko Carstens <hca@...ux.ibm.com>, Ingo Molnar <mingo@...hat.com>,
	Jan Kiszka <jan.kiszka@...mens.com>,
	Joel Fernandes <joelagnelf@...dia.com>,
	Juri Lelli <juri.lelli@...hat.com>,
	Kieran Bingham <kbingham@...nel.org>,
	Madhavan Srinivasan <maddy@...ux.ibm.com>,
	Mel Gorman <mgorman@...e.de>, Michael Ellerman <mpe@...erman.id.au>,
	Neeraj Upadhyay <neeraj.upadhyay@...nel.org>,
	Nicholas Piggin <npiggin@...il.com>,
	"Paul E . McKenney" <paulmck@...nel.org>,
	Steven Rostedt <rostedt@...dmis.org>,
	Sven Schnelle <svens@...ux.ibm.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Uladzislau Rezki <urezki@...il.com>,
	Valentin Schneider <vschneid@...hat.com>,
	Vasily Gorbik <gor@...ux.ibm.com>,
	Vincent Guittot <vincent.guittot@...aro.org>,
	Viresh Kumar <viresh.kumar@...aro.org>,
	Xin Zhao <jackzxcui1989@....com>, linux-pm@...r.kernel.org,
	linux-s390@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org
Subject: Re: [PATCH 09/15] tick/sched: Move dyntick-idle cputime accounting
 to cputime code

On Fri, Jan 16, 2026 at 03:52:02PM +0100, Frederic Weisbecker wrote:

> +static void kcpustat_idle_stop(struct kernel_cpustat *kc, ktime_t now)
>  {
> +	u64 *cpustat = kc->cpustat;
> +	ktime_t delta;
> +
> +	if (!kc->idle_elapse)
> +		return;
> +
> +	delta = ktime_sub(now, kc->idle_entrytime);
> +
> +	write_seqcount_begin(&kc->idle_sleeptime_seq);
> +	if (nr_iowait_cpu(smp_processor_id()) > 0)
> +		cpustat[CPUTIME_IOWAIT] = ktime_add(cpustat[CPUTIME_IOWAIT], delta);
> +	else
> +		cpustat[CPUTIME_IDLE] = ktime_add(cpustat[CPUTIME_IDLE], delta);
> +
> +	kc->idle_entrytime = now;
> +	kc->idle_elapse = false;
> +	write_seqcount_end(&kc->idle_sleeptime_seq);
>  }

I realize this is mostly code movement; but do we really want to
preserve ktime_{sub,add}() and all that?

I mean, we killed that 32bit ktime nonsense ages ago.

> -static void tick_nohz_stop_idle(struct tick_sched *ts, ktime_t now)
> -{
> -	u64 *cpustat = kcpustat_this_cpu->cpustat;
> -	ktime_t delta;
> -
> -	if (vtime_generic_enabled_this_cpu())
> -		return;
> -
> -	if (WARN_ON_ONCE(!tick_sched_flag_test(ts, TS_FLAG_IDLE_ACTIVE)))
> -		return;
> -
> -	delta = ktime_sub(now, ts->idle_entrytime);
> -
> -	write_seqcount_begin(&ts->idle_sleeptime_seq);
> -	if (nr_iowait_cpu(smp_processor_id()) > 0)
> -		cpustat[CPUTIME_IOWAIT] = ktime_add(cpustat[CPUTIME_IOWAIT], delta);
> -	else
> -		cpustat[CPUTIME_IDLE] = ktime_add(cpustat[CPUTIME_IDLE], delta);
> -
> -	ts->idle_entrytime = now;
> -	tick_sched_flag_clear(ts, TS_FLAG_IDLE_ACTIVE);
> -	write_seqcount_end(&ts->idle_sleeptime_seq);
> -
> -	sched_clock_idle_wakeup_event();
> -}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ