mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: riel@redhat.com
Cc: linux-kernel@vger.kernel.org, fweisbec@gmail.com,
	tglx@linutronix.de, mingo@kernel.org, luto@amacapital.net,
	clark@redhat.com
Subject: Re: [PATCH 3/4] time,acct: drop irq save & restore from __acct_update_integrals
Date: Mon, 1 Feb 2016 10:28:56 +0100	[thread overview]
Message-ID: <20160201092856.GM6357@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <1454292751-23472-4-git-send-email-riel@redhat.com>

On Sun, Jan 31, 2016 at 09:12:30PM -0500, riel@redhat.com wrote:
>  kernel/tsacct.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/kernel/tsacct.c b/kernel/tsacct.c
> index 9c23584c76c4..31fb6c9746d4 100644
> --- a/kernel/tsacct.c
> +++ b/kernel/tsacct.c
> @@ -124,20 +124,18 @@ static void __acct_update_integrals(struct task_struct *tsk,
>  				    cputime_t utime, cputime_t stime)
>  {
>  	cputime_t time, dtime;
> -	unsigned long flags;
>  	u64 delta;
>  
>  	if (!likely(tsk->mm))
>  		return;
>  
> -	local_irq_save(flags);
>  	time = stime + utime;
>  	dtime = time - tsk->acct_timexpd;
>  	/* Avoid division: cputime_t is often in nanoseconds already. */
>  	delta = cputime_to_nsecs(dtime);
>  
>  	if (delta < TICK_NSEC)
> -		goto out;
> +		return;
>  
>  	tsk->acct_timexpd = time;
>  	/*
> @@ -147,8 +145,6 @@ static void __acct_update_integrals(struct task_struct *tsk,
>  	 */
>  	tsk->acct_rss_mem1 += delta * get_mm_rss(tsk->mm) >> 10;
>  	tsk->acct_vm_mem1 += delta * tsk->mm->total_vm >> 10;
> -out:
> -	local_irq_restore(flags);
>  }

Like Frederic said on your last posting, at the very least
do_exit()->acct_update_integrals() will not have IRQs disabled.

Its just the acct_account_cputime() callers that I suspect will all have
IRQs disabled, but it would still be goot to verify that with a
WARN_ON(!irqs_disabled()) test in there for at least one test run, and
then include that you did this in the Changelog.

  reply	other threads:[~2016-02-01  9:29 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-01  2:12 [PATCH 0/4 v3] sched,time: reduce nohz_full syscall overhead 40% riel
2016-02-01  2:12 ` [PATCH 1/4] sched,time: remove non-power-of-two divides from __acct_update_integrals riel
2016-02-01  4:46   ` kbuild test robot
2016-02-01  8:37   ` Thomas Gleixner
2016-02-01  9:22     ` Peter Zijlstra
2016-02-01  9:31       ` Thomas Gleixner
2016-02-01 13:44       ` Rik van Riel
2016-02-01 13:51         ` Peter Zijlstra
2016-02-01  2:12 ` [PATCH 2/4] acct,time: change indentation in __acct_update_integrals riel
2016-02-01  2:12 ` [PATCH 3/4] time,acct: drop irq save & restore from __acct_update_integrals riel
2016-02-01  9:28   ` Peter Zijlstra [this message]
2016-02-01 19:22     ` Rik van Riel
2016-02-01  2:12 ` [PATCH 4/4] sched,time: only call account_{user,sys,guest,idle}_time once a jiffy riel
2016-02-01  9:29   ` Peter Zijlstra
2016-02-01 19:23     ` Rik van Riel
2016-02-01  7:41 ` [PATCH] perf tooling: Add 'perf bench syscall' benchmark Ingo Molnar
2016-02-01  7:48   ` [PATCH] perf tooling: Simplify 'perf bench syscall' Ingo Molnar
2016-02-01 15:41   ` [PATCH] perf tooling: Add 'perf bench syscall' benchmark Andy Lutomirski
2016-02-03 10:22     ` Ingo Molnar
2016-06-20 18:00       ` [PATCH] perf: add 'perf bench syscall' Josh Poimboeuf
2016-06-20 19:16         ` Andy Lutomirski
2016-06-21 14:55           ` Josh Poimboeuf
2016-06-21 16:31             ` Andy Lutomirski
  -- strict thread matches above, loose matches on Subject: below --
2016-02-11  1:08 [PATCH 0/4 v6] sched,time: reduce nohz_full syscall overhead 40% riel
2016-02-11  1:08 ` [PATCH 3/4] time,acct: drop irq save & restore from __acct_update_integrals riel
2016-02-02 17:19 [PATCH 0/4 v5] sched,time: reduce nohz_full syscall overhead 40% riel
2016-02-02 17:19 ` [PATCH 3/4] time,acct: drop irq save & restore from __acct_update_integrals riel
2016-02-01 19:21 [PATCH 0/4 v4] sched,time: reduce nohz_full syscall overhead 40% riel
2016-02-01 19:21 ` [PATCH 3/4] time,acct: drop irq save & restore from __acct_update_integrals riel
2016-01-30  3:36 [PATCH 0/2] sched,time: reduce nohz_full syscall overhead 40% riel
2016-01-30  3:36 ` [PATCH 3/4] time,acct: drop irq save & restore from __acct_update_integrals riel
2016-01-30 16:24   ` Frederic Weisbecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160201092856.GM6357@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=clark@redhat.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=mingo@kernel.org \
    --cc=riel@redhat.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome