linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: pjt@google.com, paul.mckenney@linaro.org, tglx@linutronix.de,
	tj@kernel.org, suresh.b.siddha@intel.com, venki@google.com,
	mingo@redhat.com, peterz@infradead.org, Arvind.Chauhan@arm.com,
	linaro-dev@lists.linaro.org, patches@linaro.org,
	pdsw-power-team@arm.com, linux-kernel@vger.kernel.org,
	linux-rt-users@vger.kernel.org
Subject: Re: [PATCH V2 Resend 3/4] workqueue: Schedule work on non-idle cpu instead of current one
Date: Tue, 27 Nov 2012 08:59:03 -0500	[thread overview]
Message-ID: <1354024743.6276.79.camel@gandalf.local.home> (raw)
In-Reply-To: <CAKohpok5toHdxxjBU+bPJwkZt9Sv-QGY8o8X6HErza1WT-DWOA@mail.gmail.com>

On Tue, 2012-11-27 at 19:18 +0530, Viresh Kumar wrote:
> On 27 November 2012 18:56, Steven Rostedt <rostedt@goodmis.org> wrote:
> > A couple of things. The sched_select_cpu() is not cheap. It has a double
> > loop of domains/cpus looking for a non idle cpu. If we have 1024 CPUs,
> > and we are CPU 1023 and all other CPUs happen to be idle, we could be
> > searching 1023 CPUs before we come up with our own.
> 
> Not sure if you missed the first check sched_select_cpu()
> 
> +int sched_select_cpu(unsigned int sd_flags)
> +{
> +       /* If Current cpu isn't idle, don't migrate anything */
> +       if (!idle_cpu(cpu))
> +               return cpu;
> 
> We aren't going to search if we aren't idle.

OK, we are idle, but CPU 1022 isn't. We still need a large search. But,
heh we are idle we can spin. But then why go through this in the first
place ;-)


> 
> > Also, I really don't like this as a default behavior. It seems that this
> > solution is for a very special case, and this can become very intrusive
> > for the normal case.
> 
> We tried with an KCONFIG option for it, which Tejun rejected.

Yeah, I saw that. I don't like adding KCONFIG options either. Best is to
get something working that doesn't add any regressions. If you can get
this to work without making *any* regressions in the normal case than
I'm totally fine with that. But if this adds any issues with the normal
case, then it's a show stopper.

> 
> > To be honest, I'm uncomfortable with this approach. It seems to be
> > fighting a symptom and not the disease. I'd rather find a way to keep
> > work from being queued on wrong CPU. If it is a timer, find a way to
> > move the timer. If it is something else, lets work to fix that. Doing
> > searches of possibly all CPUs (unlikely, but it is there), just seems
> > wrong to me.
> 
> As Vincent pointed out, on big LITTLE systems we just don't want to
> serve works on big cores. That would be wasting too much of power.
> Specially if we are going to wake up big cores.
> 
> It would be difficult to control the source driver (which queues work) to
> little cores. We thought, if somebody wanted to queue work on current
> cpu then they must use queue_work_on().

As Tejun has mentioned earlier, is there any assumptions anywhere that
expects an unbounded work queue to not migrate? Where per cpu variables
might be used. Tejun had a good idea of forcing this to migrate the work
*every* time. To not let a work queue run on the same CPU that it was
queued on. If it can survive that, then it is probably OK. Maybe add a
config option that forces this? That way, anyone can test that this
isn't an issue.

-- Steve



  reply	other threads:[~2012-11-27 13:59 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-06 10:34 [PATCH V2 Resend 0/4] Create sched_select_cpu() and use it for workqueues and timers Viresh Kumar
2012-11-06 10:38 ` [PATCH V2 Resend 3/4] workqueue: Schedule work on non-idle cpu instead of current one Viresh Kumar
     [not found]   ` <ad25c731a6ca1bd1269555245952f05c856a9759.1352196505.git.viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2012-11-26 17:15     ` Tejun Heo
2012-11-27  5:19       ` Viresh Kumar
2012-11-27 12:54         ` Vincent Guittot
     [not found]         ` <CAKohpom9=K976NmyFWtXx2UQyRcLAqsoGw-5AaqXRpSL6uxP_g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-01-04 11:11           ` Viresh Kumar
2013-01-04 15:09             ` Tejun Heo
2013-01-07  9:58               ` Viresh Kumar
2013-01-07 13:28                 ` Steven Rostedt
2013-01-07 17:59                   ` Viresh Kumar
2013-01-07 22:29                     ` Steven Rostedt
2013-01-08  4:03                       ` Viresh Kumar
2013-01-07 15:04                 ` Tejun Heo
2013-01-07 15:40                   ` Amit Kucheria
2013-01-07 18:07                   ` Viresh Kumar
2013-01-09 18:49                     ` Tejun Heo
2013-01-10  5:04                       ` Viresh Kumar
2012-11-27 13:26   ` Steven Rostedt
2012-11-27 13:48     ` Viresh Kumar
2012-11-27 13:59       ` Steven Rostedt [this message]
2012-11-27 14:55         ` Vincent Guittot
2012-11-27 15:04           ` Steven Rostedt
2012-11-27 15:35             ` Vincent Guittot
     [not found] ` <cover.1352196505.git.viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2012-11-06 10:38   ` [PATCH V2 Resend 1/4] sched: Create sched_select_cpu() to give preferred CPU for power saving Viresh Kumar
2012-11-06 10:38   ` [PATCH V2 Resend 2/4] timer: hrtimer: Don't check idle_cpu() before calling get_nohz_timer_target() Viresh Kumar
2012-11-06 10:38   ` [PATCH V2 Resend 4/4] timer: Migrate running timer Viresh Kumar
2012-11-27 13:47     ` Steven Rostedt
2013-03-20 15:13       ` Viresh Kumar
2013-04-09 14:52         ` Viresh Kumar
2013-04-24 11:22           ` Viresh Kumar
2013-05-13  9:19             ` Viresh Kumar
2013-05-13 10:35               ` Thomas Gleixner
2013-05-22  8:34                 ` Viresh Kumar
2013-05-22  9:06                   ` Peter Zijlstra
2013-05-22  9:23                     ` Viresh Kumar
2013-05-31 10:49                   ` Viresh Kumar
2013-06-18  4:51                     ` Viresh Kumar
2013-07-24  9:17                       ` Viresh Kumar
2013-08-07  9:55                         ` Viresh Kumar
2013-10-04 12:39                           ` Sebastian Andrzej Siewior
2013-10-23  5:55                             ` Viresh Kumar
2012-11-26 15:00 ` [PATCH V2 Resend 0/4] Create sched_select_cpu() and use it for workqueues and timers Viresh Kumar
2012-11-26 16:40   ` Steven Rostedt
     [not found]     ` <1353948027.6276.38.camel-f9ZlEuEWxVcJvu8Pb33WZ0EMvNT87kid@public.gmane.org>
2012-11-26 17:03       ` Paul E. McKenney
2012-11-26 17:35         ` Steven Rostedt
     [not found]           ` <1353951352.6276.43.camel-f9ZlEuEWxVcJvu8Pb33WZ0EMvNT87kid@public.gmane.org>
2012-11-26 19:03             ` Paul E. McKenney
2012-11-26 19:17               ` Steven Rostedt
2012-11-27  6:25     ` Viresh Kumar

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=1354024743.6276.79.camel@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=Arvind.Chauhan@arm.com \
    --cc=linaro-dev@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=patches@linaro.org \
    --cc=paul.mckenney@linaro.org \
    --cc=pdsw-power-team@arm.com \
    --cc=peterz@infradead.org \
    --cc=pjt@google.com \
    --cc=suresh.b.siddha@intel.com \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.org \
    --cc=venki@google.com \
    --cc=viresh.kumar@linaro.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;
as well as URLs for NNTP newsgroup(s).