Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1309010
| From | Byungchul Park <byungchul.park@lge.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 2/4] sched: Consolidate nohz CPU load update code |
| Date | 2016-01-14 06:20 +0100 |
| Message-ID | <qQIud-2fD-3@gated-at.bofh.it> (permalink) |
| References | <qQw9J-2at-33@gated-at.bofh.it> <qQw9J-2at-39@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Wed, Jan 13, 2016 at 05:01:29PM +0100, Frederic Weisbecker wrote:
> #ifdef CONFIG_NO_HZ_COMMON
> +static void __update_cpu_load_nohz(struct rq *this_rq,
> + unsigned long curr_jiffies,
Do we need to pass current jiffies as a function parameter?
> + unsigned long load,
> + int active)
> +{
> + unsigned long pending_updates;
> +
> + pending_updates = curr_jiffies - this_rq->last_load_update_tick;
> + if (pending_updates) {
> + this_rq->last_load_update_tick = curr_jiffies;
> + /*
> + * In the regular NOHZ case, we were idle, this means load 0.
> + * In the NOHZ_FULL case, we were non-idle, we should consider
> + * its weighted load.
> + */
> + __update_cpu_load(this_rq, load, pending_updates, active);
> + }
> +}
> +
> /*
> * There is no sane way to deal with nohz on smp when using jiffies because the
> * cpu doing the jiffies update might drift wrt the cpu doing the jiffy reading
> @@ -4467,22 +4486,15 @@ static unsigned long weighted_cpuload(const int cpu)
> * Called from nohz_idle_balance() to update the load ratings before doing the
> * idle balance.
> */
> -static void update_idle_cpu_load(struct rq *this_rq)
> +static void update_cpu_load_idle(struct rq *this_rq)
> {
> - unsigned long curr_jiffies = READ_ONCE(jiffies);
> - unsigned long load = weighted_cpuload(cpu_of(this_rq));
> - unsigned long pending_updates;
> -
> /*
> * bail if there's load or we're actually up-to-date.
> */
> - if (load || curr_jiffies == this_rq->last_load_update_tick)
> + if (weighted_cpuload(cpu_of(this_rq)))
> return;
>
> - pending_updates = curr_jiffies - this_rq->last_load_update_tick;
> - this_rq->last_load_update_tick = curr_jiffies;
> -
> - __update_cpu_load(this_rq, load, pending_updates, 0);
> + __update_cpu_load_nohz(this_rq, READ_ONCE(jiffies), 0, 0);
This question is not directly related to this patch but I am just
curious about... Should we use READ_ONCE on jiffies which is already
volatile type?
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH 2/4] sched: Consolidate nohz CPU load update code Frederic Weisbecker <fweisbec@gmail.com> - 2016-01-13 17:10 +0100 Re: [PATCH 2/4] sched: Consolidate nohz CPU load update code Byungchul Park <byungchul.park@lge.com> - 2016-01-14 03:40 +0100 Re: [PATCH 2/4] sched: Consolidate nohz CPU load update code Byungchul Park <byungchul.park@lge.com> - 2016-01-14 06:20 +0100
csiph-web