All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: "Meyer, Mike" <Mike.Meyer@Teradata.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mingo@redhat.com" <mingo@redhat.com>
Subject: Re: [PATCH] sched: fix task and run queue run_delay inconsistencies
Date: Thu, 1 Oct 2015 08:37:32 +0200	[thread overview]
Message-ID: <20151001063732.GM2881@worktop.programming.kicks-ass.net> (raw)
In-Reply-To: <72105DE171429F468B83CE64C279BFFA17615A68@SUSHDC8002.TD.TERADATA.COM>

On Wed, Sep 30, 2015 at 08:28:41PM +0000, Meyer, Mike wrote:
> > From: Peter Zijlstra [mailto:peterz@infradead.org]
> >
> > On Wed, Sep 23, 2015 at 12:37:18AM +0000, Meyer, Mike wrote:
> > >
> > > The proposed patch addresses the issue by calling
> > > sched_info_reset_dequeued(thread) following the call to
> > > enqueue_task(rq, thread) for running threads in situations in which
> > > thread->sched_info.last_queued should remain 0.
> > 
> > Would something like the below; which avoids calling
> > sched_info_{de,}queued() for these sites also work?
> > 
> > It even shrinks the code (due to inlining {en,de}queue_task()):
> > 
> > $ size defconfig-build/kernel/sched/core.o defconfig-
> > build/kernel/sched/core.o.orig
> >    text    data     bss     dec     hex filename
> >   64019   23378    2344   89741   15e8d defconfig-build/kernel/sched/core.o
> >   64149   23378    2344   89871   15f0f defconfig-build/kernel/sched/core.o.orig
> > 
> Yes that will also address the issue.
> 
> The reason I approached the way I did was to avoid adding code path to
> the far more common uses of {en,de}queue_task() but I doubt anyone is
> going to notice a difference with the addition of some register
> save/restores and a compare in that path.  Overall the code does
> shrink with the alternative which is good.

In most cases the flags should be compile time constants, and with the
inline we can determine the branch at compile time, avoiding emitting
that branch instruction entirely.

But let me double check the asm for a few important sites.

> My only comment is I am not sure about the naming of the flag
> ENQUEUE_TEMP which implies (to me) the enqueue is temporary which
> clearly it isn't.    Maybe something like DEQUEUE_MOVE/ENQUEUE_MOVE
> would be a bit more descriptive of the use case.

Yes, I ran out of creative juices, let me attempt a better name once
I've woken up a bit.


  reply	other threads:[~2015-10-01  6:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-23  0:37 [PATCH] sched: fix task and run queue run_delay inconsistencies Meyer, Mike
2015-09-30 15:44 ` Peter Zijlstra
2015-09-30 20:28   ` Meyer, Mike
2015-10-01  6:37     ` Peter Zijlstra [this message]
2015-10-01  9:43       ` Peter Zijlstra
2015-10-01 16:06         ` Meyer, Mike
2015-10-06 16:17   ` [tip:sched/core] sched/core: Fix task and run queue sched_info:: " tip-bot for Peter Zijlstra

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=20151001063732.GM2881@worktop.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=Mike.Meyer@Teradata.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.