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]
Date:	Wed, 29 Apr 2009 11:48:01 +0200
From:	Martin Schwidefsky <schwidefsky@...ibm.com>
To:	Eric Dumazet <dada1@...mosbay.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Andrew Gallatin <gallatin@...i.com>,
	linux-kernel@...r.kernel.org, rick.jones2@...com, brice@...i.com,
	Paul Mackerras <paulus@...ba.org>,
	Benjamin Herrenschmidt <benh@...nel.crashing.org>,
	Ingo Molnar <mingo@...e.hu>
Subject: Re: [PATCH] sched: account system time properly

On Wed, 29 Apr 2009 11:20:03 +0200
Eric Dumazet <dada1@...mosbay.com> wrote:

> Martin Schwidefsky a écrit :
> > On Wed, 29 Apr 2009 09:46:17 +0200
> > Eric Dumazet <dada1@...mosbay.com> wrote:
> > 
> >> Eric Dumazet a écrit :
> >>> Andrew Morton a écrit :
> >>>
> >>> So, if IRQs are interrupting idle task, I guess if (p != rq->idle) will be false.
> >>>
> > 
> > If an IRQ interrupts the idle task the tick is supposed to be accounted
> > as an idle tick. Only if the IRQ interrupted the system while it has
> > been in hardirq or softirq processing then it should be accounted as
> > system tick.
> > 
> >> Maybe following patch is needed ?
> >>
> >> [PATCH] sched: account system time properly
> >>
> >> When idle task is interrupted by an IRQ, time accounting considers CPU is idle,
> >> even while it should account for hard or softirq.
> >>
> >> Signed-off-by: Eric Dumazet <dada1@...mosbay.com>
> >>
> >> diff --git a/kernel/sched.c b/kernel/sched.c
> >> index b902e58..26efa47 100644
> >> --- a/kernel/sched.c
> >> +++ b/kernel/sched.c
> >> @@ -4732,7 +4732,7 @@ void account_process_tick(struct task_struct *p, int user_tick)
> >>  
> >>  	if (user_tick)
> >>  		account_user_time(p, one_jiffy, one_jiffy_scaled);
> >> -	else if (p != rq->idle)
> >> +	else if ((p != rq->idle) || (irq_count() != HARDIRQ_OFFSET))
> >>  		account_system_time(p, HARDIRQ_OFFSET, one_jiffy,
> >>  				    one_jiffy_scaled);
> >>  	else
> > 
> > That patch makes a lot of sense to me. Does it fix the problem?
> > 
> 
> Yes it does, on my machine at least :
> 
> 11:18:48 AM  CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest   %idle
> 11:18:58 AM  all    0.00    0.00    0.00    0.00    0.21    0.69    0.00    0.00   99.10
> 11:18:58 AM    0    0.00    0.00    0.00    0.00    1.70    5.50    0.00    0.00   92.80  << HERE >>
> 11:18:58 AM    1    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00
> 11:18:58 AM    2    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00
> 11:18:58 AM    3    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00
> 11:18:58 AM    4    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00
> 11:18:58 AM    5    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00
> 11:18:58 AM    6    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00
> 11:18:58 AM    7    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00

Very good. Acked-by: Martin Schwidefsky <schwidefsky@...ibm.com> 


-- 
blue skies,
   Martin.

"Reality continues to ruin my life." - Calvin.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ