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: <20231127130754.3affb908@gandalf.local.home>
Date:   Mon, 27 Nov 2023 13:07:54 -0500
From:   Steven Rostedt <rostedt@...dmis.org>
To:     tiozhang <tiozhang@...iglobal.com>
Cc:     <bigeasy@...utronix.de>, <tglx@...utronix.de>, <mingo@...hat.com>,
        <peterz@...radead.org>, <juri.lelli@...hat.com>,
        <vincent.guittot@...aro.org>, <linux-kernel@...r.kernel.org>,
        <dietmar.eggemann@....com>, <bsegall@...gle.com>,
        <mgorman@...e.de>, <bristot@...hat.com>, <vschneid@...hat.com>,
        <zyhtheonly@...il.com>, <zyhtheonly@...h.net>
Subject: Re: [PATCH] sched/cputime: exclude ktimer threads in
 irqtime_account_irq

On Fri, 24 Nov 2023 14:34:50 +0800
tiozhang <tiozhang@...iglobal.com> wrote:

> diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c
> index af7952f12e6c..0fac0109d151 100644
> --- a/kernel/sched/cputime.c
> +++ b/kernel/sched/cputime.c
> @@ -73,7 +73,12 @@ void irqtime_account_irq(struct task_struct *curr, unsigned int offset)
>  	 */
>  	if (pc & HARDIRQ_MASK)
>  		irqtime_account_delta(irqtime, delta, CPUTIME_IRQ);
> +#ifdef CONFIG_PREEMPT_RT
> +	else if ((pc & SOFTIRQ_OFFSET) && curr != this_cpu_ksoftirqd()
> +		&& curr != this_cpu_ktimers())
> +#else
>  	else if ((pc & SOFTIRQ_OFFSET) && curr != this_cpu_ksoftirqd())
> +#endif
>  		irqtime_account_delta(irqtime, delta, CPUTIME_SOFTIRQ);
>  }

If the above is necessary, it would look nicer as:

  	else if (((pc & SOFTIRQ_OFFSET) && curr != this_cpu_ksoftirqd() &&
		  (!IS_ENABLED(CONFIG_PREEMPT_RT) || curr != this_cpu_ktimers()))

-- Steve

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ