mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: linux-kernel@vger.kernel.org,
	Giovanni Gherdovich <ggherdovich@suse.cz>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Mel Gorman <mgorman@techsingularity.net>,
	Mike Galbraith <mgalbraith@suse.de>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Rik van Riel <riel@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Wanpeng Li <wanpeng.li@hotmail.com>,
	Ingo Molnar <mingo@kernel.org>
Subject: Re: [PATCH v2 1/2] sched/cputime: Use only pi_lock to protect sum_exec_runtime read
Date: Mon, 5 Sep 2016 21:16:17 +0200	[thread overview]
Message-ID: <20160905191617.GC3318@worktop.controleur.wifipass.org> (raw)
In-Reply-To: <20160905141657.GA22190@redhat.com>

On Mon, Sep 05, 2016 at 04:16:57PM +0200, Stanislaw Gruszka wrote:
> On Mon, Sep 05, 2016 at 11:13:01AM +0200, Stanislaw Gruszka wrote:
> > Currently we protect 64bit sum_exec_runtime read on 32bit cpus using
> > task_rq_lock() which internally takes t->pi_lock and rq->lock. Taking
> > rq->lock is not needed in this case.
> 
> I looked more at kernel/sched/ code and now I'm not sure about this.
> I assumed that update_curr() is called with rq->curr->pi_lock, but
> looks like it can be called with some other task->pi_lock not
> necessary the rq->curr, hence looks that we need rq->lock to assure
> protection

Correct, rq->lock needs be held for this.

update_curr() is called from places like the tick and schedule(),
neither of which hold pi_lock.

  reply	other threads:[~2016-09-05 19:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-05  9:13 [PATCH v2 0/2] sched/cputime: sum_exec_runtime fixes for 32-bit cpus Stanislaw Gruszka
2016-09-05  9:13 ` [PATCH v2 1/2] sched/cputime: Use only pi_lock to protect sum_exec_runtime read Stanislaw Gruszka
2016-09-05 14:16   ` Stanislaw Gruszka
2016-09-05 19:16     ` Peter Zijlstra [this message]
2016-09-05  9:13 ` [PATCH v2 2/2] sched/cputime: Protect other sum_exec_runtime reads on 32 bit cpus Stanislaw Gruszka

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=20160905191617.GC3318@worktop.controleur.wifipass.org \
    --to=peterz@infradead.org \
    --cc=ggherdovich@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgalbraith@suse.de \
    --cc=mgorman@techsingularity.net \
    --cc=mingo@kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=riel@redhat.com \
    --cc=sgruszka@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=wanpeng.li@hotmail.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

all inboxes | Powered by JetHome®