Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1257691 > unrolled thread

Re: [PATCH V3 3/5] cpufreq: ondemand: queue work for policy->cpus together

Started by"Rafael J. Wysocki" <rjw@rjwysocki.net>
First post2015-10-28 07:10 +0100
Last post2015-10-28 09:40 +0100
Articles 4 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH V3 3/5] cpufreq: ondemand: queue work for policy->cpus together "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-10-28 07:10 +0100
    Re: [PATCH V3 3/5] cpufreq: ondemand: queue work for policy->cpus  together Viresh Kumar <viresh.kumar@linaro.org> - 2015-10-28 07:50 +0100
      Re: [PATCH V3 3/5] cpufreq: ondemand: queue work for policy->cpus together "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-10-28 08:10 +0100
        Re: [PATCH V3 3/5] cpufreq: ondemand: queue work for policy->cpus  together Viresh Kumar <viresh.kumar@linaro.org> - 2015-10-28 09:40 +0100

#1257691 — Re: [PATCH V3 3/5] cpufreq: ondemand: queue work for policy->cpus together

From"Rafael J. Wysocki" <rjw@rjwysocki.net>
Date2015-10-28 07:10 +0100
SubjectRe: [PATCH V3 3/5] cpufreq: ondemand: queue work for policy->cpus together
Message-ID<qos5P-7j5-5@gated-at.bofh.it>
On Tuesday, October 13, 2015 01:39:03 PM Viresh Kumar wrote:
> Currently update_sampling_rate() runs over each online CPU and
> cancels/queues work on it. Its very inefficient for the case where a
> single policy manages multiple CPUs, as they can be processed together.

In the case of one policy object shared between multiple CPUs, I'm
wondering why we don't use a single delayed work function for all of them
in the first place.  That would address the problem at the source instead
of dealing with the symptoms.

> Also drop the unnecessary cancel_delayed_work_sync() as we are doing a
> mod_delayed_work_on() in gov_queue_work(), which will take care of
> pending works for us.

I'd prefer a separate patch for that if poss.

Thanks,
Rafael

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1257711 — Re: [PATCH V3 3/5] cpufreq: ondemand: queue work for policy->cpus together

FromViresh Kumar <viresh.kumar@linaro.org>
Date2015-10-28 07:50 +0100
SubjectRe: [PATCH V3 3/5] cpufreq: ondemand: queue work for policy->cpus together
Message-ID<qosIx-7ys-9@gated-at.bofh.it>
In reply to#1257691
On 28-10-15, 07:38, Rafael J. Wysocki wrote:
> On Tuesday, October 13, 2015 01:39:03 PM Viresh Kumar wrote:
> > Currently update_sampling_rate() runs over each online CPU and
> > cancels/queues work on it. Its very inefficient for the case where a
> > single policy manages multiple CPUs, as they can be processed together.
> 
> In the case of one policy object shared between multiple CPUs, I'm
> wondering why we don't use a single delayed work function for all of them
> in the first place.  That would address the problem at the source instead
> of dealing with the symptoms.

That's what we had long back. The problem is that the timers queued
for cpufreq are deferrable and if the CPU, on which the timer is
queued, goes idle, then the governor would halt. And there can be
other CPUs in the policy->cpus group which are still running.

> > Also drop the unnecessary cancel_delayed_work_sync() as we are doing a
> > mod_delayed_work_on() in gov_queue_work(), which will take care of
> > pending works for us.
> 
> I'd prefer a separate patch for that if poss.

okay.

-- 
viresh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1257720

From"Rafael J. Wysocki" <rjw@rjwysocki.net>
Date2015-10-28 08:10 +0100
Message-ID<qot1U-7VJ-3@gated-at.bofh.it>
In reply to#1257711
On Wednesday, October 28, 2015 12:16:35 PM Viresh Kumar wrote:
> On 28-10-15, 07:38, Rafael J. Wysocki wrote:
> > On Tuesday, October 13, 2015 01:39:03 PM Viresh Kumar wrote:
> > > Currently update_sampling_rate() runs over each online CPU and
> > > cancels/queues work on it. Its very inefficient for the case where a
> > > single policy manages multiple CPUs, as they can be processed together.
> > 
> > In the case of one policy object shared between multiple CPUs, I'm
> > wondering why we don't use a single delayed work function for all of them
> > in the first place.  That would address the problem at the source instead
> > of dealing with the symptoms.
> 
> That's what we had long back. The problem is that the timers queued
> for cpufreq are deferrable and if the CPU, on which the timer is
> queued, goes idle, then the governor would halt. And there can be
> other CPUs in the policy->cpus group which are still running.

It looks like we shouldn't be using delayed works for this, really.

We should be using timer functions and normal work items.  Schedule the
timer function on all CPUs sharing the policy and then queue up the
work item from the first one that executes the timer.  Then make the
timer function bail out immediately until the work has completed and
re-schedule the timers from the work item.

Thanks,
Rafael

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1257800 — Re: [PATCH V3 3/5] cpufreq: ondemand: queue work for policy->cpus together

FromViresh Kumar <viresh.kumar@linaro.org>
Date2015-10-28 09:40 +0100
SubjectRe: [PATCH V3 3/5] cpufreq: ondemand: queue work for policy->cpus together
Message-ID<qour0-dw-23@gated-at.bofh.it>
In reply to#1257720
On 28-10-15, 08:33, Rafael J. Wysocki wrote:
> It looks like we shouldn't be using delayed works for this, really.
> 
> We should be using timer functions and normal work items.  Schedule the
> timer function on all CPUs sharing the policy and then queue up the
> work item from the first one that executes the timer.  Then make the
> timer function bail out immediately until the work has completed and
> re-schedule the timers from the work item.

Okay, I will try to get some code out for that then.

-- 
viresh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web