mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org,
	Martin Schwidefsky <schwidefsky@de.ibm.com>,
	Jan Glauber <jang@linux.vnet.ibm.com>,
	heiko.carstens@de.ibm.com, Paul Mackerras <paulus@samba.org>
Subject: Re: [accounting regression since rc1]  scheduler updates
Date: Tue, 14 Aug 2007 10:37:47 +0200	[thread overview]
Message-ID: <200708141037.48001.borntraeger@de.ibm.com> (raw)
In-Reply-To: <20070812163225.GA11996@elte.hu>

This is a 2nd try with correct email address, sorry for the duplicates.

Am Sonntag, 12. August 2007 schrieb Ingo Molnar:
> Linus, please pull the latest scheduler git tree from:

Hello Ingo,

this is a followup to the discussion in 
http://lkml.org/lkml/2007/7/19/538

Since 2.6.12, s390 already does precise accouting for system and user time.  
Depending on CONFIG_VIRT_CPU_ACCOUNTING, we  use two 64bit hardware timers on 
s390: the first returns the wall clock time and is stepped even if the 
virtual cpu is not backed by a physical cpu. The second timer is only 
stepped, when the virtual cpu is backed by a physical cpu. The timers have a 
very high accurancy, and the architecture guarantees that bit 51 is increased 
by one/microsecond. We store both timers on each context switch, irq, 
syscall, and machinecheck in entry.S. The calculation are made in 
arch/s390/kernel/vtime.c in accouting_system_vtime and friends with 
microsecond accurracy. This is also used for irq accouting (see the 
definition of irq_enter). It basically boils down to precise numbers in the 
cpu stat and the utime/stime for processes as well as knowledge about time 
stolen by the hypervisor. 

With CFS the accounting was changed, and everything is now based on 
sum_exec_runtime.  There is now an accounting regression on s390 (and maybe 
ppc64), as the default jiffy implemenation does not know anything about 
virtual cpus.

While looking for a solution, I started with a very quick hack and reverted 
b27f03d4bdc145a09fb7b0c0e004b29f1ee555fa for the procfs related changes. If I 
revert that commit, it seems that I get the old behaviour -  but of course 
this is just a hack.

I see some options now:

1. Jan could finish his sched_clock implementation for s390 and we would get 
close to the precise numbers. This would also let CFS make better decisions. 
Downside: its not as precise as before as we do some math on the numbers and 
it will burn cycles to compute numbers we already have 
(utime=sum*utime/stime). 
2. set sum_exec_runtime based on the precise utime and stime. Dont know enough 
about CFS if this would show different scheduling behaviour than 1
3. ifdef fs/proc/array.c depending on CONFIG_VIRT_CPU_ACCOUNTING. This will 
save some cycles, and the numbers are precise to a microsecond. Downside: the 
scheduler gets no information about virtual cpus and steal time so its 
probably not completely fair
4. implement sched_clock AND reuse the exisiting utime and stime numbers.
5. other clever solutions I cannot see

Any suggestions?

Christian

  reply	other threads:[~2007-08-14  8:39 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-12 16:32 [git pull request] " Ingo Molnar
2007-08-14  8:37 ` Christian Borntraeger [this message]
2007-08-16  8:17   ` [PATCH][RFC] Re: accounting regression since rc1 Christian Borntraeger
2007-08-20 15:45   ` [accounting regression since rc1] scheduler updates Ingo Molnar
2007-08-20 17:03     ` Martin Schwidefsky
2007-08-20 18:08       ` Ingo Molnar
2007-08-20 18:33         ` Martin Schwidefsky
2007-08-20 19:00           ` Balbir Singh
2007-08-20 19:05           ` Ingo Molnar
2007-08-21  7:20             ` Christian Borntraeger
2007-08-20 19:12           ` Ingo Molnar
2007-08-21  7:00           ` Christian Borntraeger
2007-08-21  9:18             ` Martin Schwidefsky
2007-08-20 23:07         ` Paul Mackerras
2007-08-21  2:18         ` Andi Kleen
2007-08-21  7:09           ` Ingo Molnar
2007-08-21 10:07             ` Andi Kleen
2007-08-21 10:20               ` Ingo Molnar
2007-08-21 11:15                 ` Andi Kleen
2007-08-21 11:20                   ` Ingo Molnar
2007-08-21  8:17     ` Christian Borntraeger
2007-08-21  8:42       ` Ingo Molnar
2007-08-21  9:11         ` Martin Schwidefsky
2007-08-21  9:34           ` Ingo Molnar
2007-08-21  9:48             ` Paul Mackerras
2007-08-21 10:38             ` Martin Schwidefsky
2007-08-21 11:36               ` Ingo Molnar
2007-08-21 11:58                 ` Martin Schwidefsky
2007-08-21 10:39             ` Christian Borntraeger
2007-08-21 10:43             ` Christian Borntraeger
2007-08-21 11:15               ` Ingo Molnar
2007-08-21 11:24                 ` Christian Borntraeger
2007-08-21 11:30                   ` Ingo Molnar
2007-08-21 11:58                     ` Christian Borntraeger
2007-08-21 12:21                       ` Ingo Molnar
2007-08-21 12:57                         ` Martin Schwidefsky
2007-08-21 11:25       ` Ingo Molnar
2007-08-22  7:50         ` Christian Borntraeger
2007-08-22  7:59           ` Ingo Molnar
     [not found] ` <200708141032.47235.borntraeger@de.ibm.com>
     [not found]   ` <alpine.LFD.0.999.0708140835240.30176@woody.linux-foundation.org>
2007-08-14 18:19     ` Christian Borntraeger

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=200708141037.48001.borntraeger@de.ibm.com \
    --to=borntraeger@de.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=heiko.carstens@de.ibm.com \
    --cc=jang@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.org \
    --cc=schwidefsky@de.ibm.com \
    --cc=torvalds@linux-foundation.org \
    /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

all inboxes | Powered by JetHome®