linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	LKML <linux-kernel@vger.kernel.org>,
	Tony Luck <tony.luck@intel.com>,
	Fenghua Yu <fenghua.yu@intel.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	Peter Zijlstra <peterz@infradead.org>
Subject: Re: [PATCH 3/4] cputime: Consolidate vtime handling on context switch
Date: Thu, 16 Aug 2012 09:50:32 +0200	[thread overview]
Message-ID: <20120816095032.16611651@de.ibm.com> (raw)
In-Reply-To: <20120815192813.GE19716@somewhere>

On Wed, 15 Aug 2012 21:28:17 +0200
Frederic Weisbecker <fweisbec@gmail.com> wrote:

> On Wed, Aug 15, 2012 at 05:22:19PM +0200, Martin Schwidefsky wrote:
> > On Tue, 14 Aug 2012 16:16:49 +0200
> > Frederic Weisbecker <fweisbec@gmail.com> wrote:
> > 
> > > The archs that implement virtual cputime accounting all
> > > flush the cputime of a task when it gets descheduled
> > > and sometimes set up some ground initialization for the
> > > next task to account its cputime.
> > > 
> > > These archs all put their own hooks in their context
> > > switch callbacks and handle the off-case themselves.
> > > 
> > > Consolidate this by creating a new account_switch_vtime()
> > > callback called in generic code right after a context switch
> > > and that these archs must implement to flush the prev task
> > > cputime and initialize the next task cputime related state.
> > 
> > That change requires that the accounting for the previous process
> > can be done before finish_arch_switch() completed. With the old
> > code the architecture could to the accounting call in the middle
> > of finish_arch_switch, that is not possible anymore. Dunno if this
> > is relevant or not. For s390 the new code should work fine.
> 
> I'm not sure how this could potentially cause a problem. Interrupts are disabled
> between while we switch_to() until finish_lock_switch(). So nothing
> should be able to mess up with the accounting of the prev task.
> 
> I don't really understand what you mean actually.

It is more a theoretical consideration. If the finish_arch_switch code
updates fields that are required to do the cputime accounting then the
order could be important. But then you could move that necessary code
from finish_arch_switch to account_switch_vtime.
As said that change is fine for s390, so I'm good with it.

-- 
blue skies,
   Martin.

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


  reply	other threads:[~2012-08-16  7:50 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-14 14:16 [PATCH 0/4] cputime: Virtual cputime accounting small cleanups and consolidation v2 Frederic Weisbecker
2012-08-14 14:16 ` [PATCH 1/4] cputime: Generalize CONFIG_VIRT_CPU_ACCOUNTING Frederic Weisbecker
2012-08-15 15:03   ` Martin Schwidefsky
2012-08-15 19:09     ` Frederic Weisbecker
2012-08-16  7:53       ` Martin Schwidefsky
2012-08-16  9:38         ` Benjamin Herrenschmidt
2012-08-16 12:55           ` Frederic Weisbecker
2012-08-16 14:00             ` Martin Schwidefsky
2012-08-16 14:38               ` Frederic Weisbecker
2012-08-14 14:16 ` [PATCH 2/4] sched: Move cputime code to its own file Frederic Weisbecker
2012-08-15 15:07   ` Martin Schwidefsky
2012-08-14 14:16 ` [PATCH 3/4] cputime: Consolidate vtime handling on context switch Frederic Weisbecker
2012-08-15 15:22   ` Martin Schwidefsky
2012-08-15 19:28     ` Frederic Weisbecker
2012-08-16  7:50       ` Martin Schwidefsky [this message]
2012-08-16 12:50         ` Frederic Weisbecker
2012-08-16 13:59           ` Martin Schwidefsky
2012-08-14 14:16 ` [PATCH 4/4] s390: Remove leftover account_tick_vtime() header Frederic Weisbecker
2012-08-15 15:22   ` Martin Schwidefsky
2012-08-15  4:54 ` [PATCH 0/4] cputime: Virtual cputime accounting small cleanups and consolidation v2 Frederic Weisbecker
  -- strict thread matches above, loose matches on Subject: below --
2012-08-17 14:37 [PATCH 0/4] cputime: Virtual cputime accounting small cleanups and consolidation v3 Frederic Weisbecker
2012-08-17 14:37 ` [PATCH 3/4] cputime: Consolidate vtime handling on context switch Frederic Weisbecker
2012-06-19 13:43 [PATCH 0/4] cputime: Virtual cputime accounting small cleanups and consolidation Frederic Weisbecker
2012-06-19 13:43 ` [PATCH 3/4] cputime: Consolidate vtime handling on context switch 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=20120816095032.16611651@de.ibm.com \
    --to=schwidefsky@de.ibm.com \
    --cc=benh@kernel.crashing.org \
    --cc=fenghua.yu@intel.com \
    --cc=fweisbec@gmail.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).