login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
October
»
20
Re: High CPU load when machine is idle (related to PROBLEM: Unusually high load average when idle in 2.6.35, 2.6.35.1 and later)
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Peter Zijlstra
Subject:
Re: High CPU load when machine is idle (related to PROBLEM: Unusually high load average when idle in 2.6.35, 2.6.35.1 and later)
Date: Wednesday, October 20, 2010 - 7:25 am
On Wed, 2010-10-20 at 16:14 +0200, Peter Zijlstra wrote:
quoted text
> --- > include/linux/sched.h | 8 ++++++++ > kernel/sched.c | 28 +++++++++++++++++++++------- > kernel/sched_idletask.c | 1 - > kernel/time/tick-sched.c | 2 ++ > 4 files changed, 31 insertions(+), 8 deletions(-) > > diff --git a/include/linux/sched.h b/include/linux/sched.h > index 0383601..5311ef4 100644 > --- a/include/linux/sched.h > +++ b/include/linux/sched.h > @@ -145,6 +145,14 @@ extern unsigned long this_cpu_load(void); > > extern void calc_global_load(void); > > +#ifdef CONFIG_NO_HZ > +extern void calc_load_account_idle(void); > +extern void calc_load_account_nonidle(void); > +#else > +static inline void calc_load_account_idle(void) { } > +static inline void calc_load_account_nonidle(void) { } > +#endif > + > extern unsigned long get_parent_ip(unsigned long addr); > > struct seq_file; > diff --git a/kernel/sched.c b/kernel/sched.c > index abf8440..79a29e6 100644 > --- a/kernel/sched.c > +++ b/kernel/sched.c > @@ -526,6 +526,10 @@ struct rq { > /* calc_load related fields */ > unsigned long calc_load_update; > long calc_load_active; > +#ifdef CONFIG_NO_HZ > + long calc_load_inactive; > + int calc_load_seq; > +#endif > > #ifdef CONFIG_SCHED_HRTICK > #ifdef CONFIG_SMP > @@ -1833,7 +1837,6 @@ static void cfs_rq_set_shares(struct cfs_rq *cfs_rq, unsigned long shares) > } > #endif > > -static void calc_load_account_idle(struct rq *this_rq); > static void update_sysctl(void); > static int get_update_sysctl_factor(void); > static void update_cpu_load(struct rq *this_rq); > @@ -3111,16 +3114,29 @@ static long calc_load_fold_active(struct rq *this_rq) > * When making the ILB scale, we should try to pull this in as well. > */ > static atomic_long_t calc_load_tasks_idle; > +static atomic_t calc_load_seq; > > -static void calc_load_account_idle(struct rq *this_rq) > +void calc_load_account_idle(void) > { > + struct rq *this_rq = this_rq(); > long delta; > > delta = calc_load_fold_active(this_rq); > + this_rq->calc_load_inactive = delta; > + this_rq->calc_load_seq = atomic_read(&calc_load_seq); > + > if (delta) > atomic_long_add(delta, &calc_load_tasks_idle); > } > > +void calc_load_account_nonidle(void) > +{ > + struct rq *this_rq = this_rq(); > + > + if (atomic_read(&calc_load_seq) == this_rq->calc_load_seq) > + atomic_long_add(this_rq->calc_load_inactive, &calc_load_tasks_idle);
So that should read: that atomic_long_sub() Trouble is, load goes down with that patch fixed, it just never goes up :/
quoted text
> +} > + > static long calc_load_fold_idle(void) > { > long delta = 0; > @@ -3128,16 +3144,14 @@ static long calc_load_fold_idle(void) > /* > * Its got a race, we don't care... > */ > - if (atomic_long_read(&calc_load_tasks_idle)) > + if (atomic_long_read(&calc_load_tasks_idle)) { > + atomic_inc(&calc_load_seq); > delta = atomic_long_xchg(&calc_load_tasks_idle, 0); > + } > > return delta; > } > #else > -static void calc_load_account_idle(struct rq *this_rq) > -{ > -} > - > static inline long calc_load_fold_idle(void) > { > return 0; > diff --git a/kernel/sched_idletask.c b/kernel/sched_idletask.c > index 9fa0f402..6ca191f 100644 > --- a/kernel/sched_idletask.c > +++ b/kernel/sched_idletask.c > @@ -23,7 +23,6 @@ static void check_preempt_curr_idle(struct rq *rq, struct task_struct *p, int fl > static struct task_struct *pick_next_task_idle(struct rq *rq) > { > schedstat_inc(rq, sched_goidle); > - calc_load_account_idle(rq); > return rq->idle; > } > > diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c > index 3e216e0..808abd7 100644 > --- a/kernel/time/tick-sched.c > +++ b/kernel/time/tick-sched.c > @@ -411,6 +411,7 @@ void tick_nohz_stop_sched_tick(int inidle) > ts->tick_stopped = 1; > ts->idle_jiffies = last_jiffies; > rcu_enter_nohz(); > + calc_load_account_idle(); > } > > ts->idle_sleeps++; > @@ -520,6 +521,7 @@ void tick_nohz_restart_sched_tick(void) > > ts->inidle = 0; > > + calc_load_account_nonidle(); > rcu_exit_nohz(); > > /* Update jiffies first */ >
--
unsubscribe notice
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/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
Re: High CPU load when machine is idle (related to PROBLEM ...
, Damien Wyart
, (Thu Oct 14, 7:58 am)
Re: High CPU load when machine is idle (related to PROBLEM ...
, Chase Douglas
, (Thu Oct 14, 8:29 am)
Re: High CPU load when machine is idle (related to PROBLEM ...
, Damien Wyart
, (Thu Oct 14, 8:56 am)
Re: High CPU load when machine is idle (related to PROBLEM ...
, Peter Zijlstra
, (Fri Oct 15, 4:08 am)
Re: High CPU load when machine is idle (related to PROBLEM ...
, Peter Zijlstra
, (Mon Oct 18, 5:32 am)
Re: High CPU load when machine is idle (related to PROBLEM ...
, Damien Wyart
, (Wed Oct 20, 6:27 am)
Re: High CPU load when machine is idle (related to PROBLEM ...
, Peter Zijlstra
, (Wed Oct 20, 6:30 am)
Re: High CPU load when machine is idle (related to PROBLEM ...
, Peter Zijlstra
, (Wed Oct 20, 6:43 am)
Re: High CPU load when machine is idle (related to PROBLEM ...
, Peter Zijlstra
, (Wed Oct 20, 7:14 am)
Re: High CPU load when machine is idle (related to PROBLEM ...
, Peter Zijlstra
, (Wed Oct 20, 7:25 am)
Re: High CPU load when machine is idle (related to PROBLEM ...
, Peter Zijlstra
, (Wed Oct 20, 10:26 am)
Re: High CPU load when machine is idle (related to PROBLEM ...
, Damien Wyart
, (Wed Oct 20, 1:24 pm)
Re: High CPU load when machine is idle (related to PROBLEM ...
, tmhikaru
, (Wed Oct 20, 6:48 pm)
Re: High CPU load when machine is idle (related to PROBLEM ...
, tmhikaru
, (Wed Oct 20, 6:53 pm)
Re: High CPU load when machine is idle (related to PROBLEM ...
, Ingo Molnar
, (Thu Oct 21, 1:22 am)
Re: High CPU load when machine is idle (related to PROBLEM ...
, tmhikaru
, (Thu Oct 21, 1:57 am)
Re: High CPU load when machine is idle (related to PROBLEM ...
, Peter Zijlstra
, (Thu Oct 21, 5:09 am)
Re: High CPU load when machine is idle (related to PROBLEM ...
, Venkatesh Pallipadi
, (Thu Oct 21, 10:18 am)
Re: High CPU load when machine is idle (related to PROBLEM ...
, tmhikaru
, (Thu Oct 21, 11:36 am)
Re: High CPU load when machine is idle (related to PROBLEM ...
, tmhikaru
, (Thu Oct 21, 6:37 pm)
[No subject]
, Venkatesh Pallipadi
, (Fri Oct 22, 2:03 pm)
Re: High CPU load when machine is idle (related to PROBLEM ...
, Venkatesh Pallipadi
, (Fri Oct 22, 4:03 pm)
Re: High CPU load when machine is idle (related to PROBLEM ...
, tmhikaru
, (Fri Oct 22, 7:13 pm)
Re: High CPU load when machine is idle (related to PROBLEM ...
, Peter Zijlstra
, (Mon Oct 25, 3:12 am)
Re: High CPU load when machine is idle (related to PROBLEM ...
, Venkatesh Pallipadi
, (Mon Oct 25, 9:29 am)
Re: High CPU load when machine is idle (related to PROBLEM ...
, Peter Zijlstra
, (Tue Oct 26, 5:44 am)
Re: High CPU load when machine is idle (related to PROBLEM ...
, Peter Zijlstra
, (Tue Oct 26, 7:05 am)
Re: High CPU load when machine is idle (related to PROBLEM ...
, Peter Zijlstra
, (Fri Oct 29, 12:42 pm)
Re: High CPU load when machine is idle (related to PROBLEM ...
, Kyle McMartin
, (Tue Nov 9, 11:55 am)
Re: High CPU load when machine is idle (related to PROBLEM ...
, Peter Zijlstra
, (Tue Nov 9, 12:02 pm)
Re: High CPU load when machine is idle (related to PROBLEM ...
, tmhikaru
, (Tue Nov 9, 7:37 pm)
Re: High CPU load when machine is idle (related to PROBLEM ...
, Kyle McMartin
, (Tue Nov 9, 8:45 pm)
Re: High CPU load when machine is idle (related to PROBLEM ...
, Peter Zijlstra
, (Wed Nov 10, 5:00 am)
Re: High CPU load when machine is idle (related to PROBLEM ...
, Peter Zijlstra
, (Wed Nov 10, 5:01 am)
Re: High CPU load when machine is idle (related to PROBLEM ...
, tmhikaru
, (Sat Nov 13, 10:14 pm)
Re: High CPU load when machine is idle (related to PROBLEM ...
, Damien Wyart
, (Thu Nov 25, 6:31 am)
Re: High CPU load when machine is idle (related to PROBLEM ...
, Peter Zijlstra
, (Thu Nov 25, 7:03 am)
Re: High CPU load when machine is idle (related to PROBLEM ...
, Peter Zijlstra
, (Sat Nov 27, 1:15 pm)
Re: High CPU load when machine is idle (related to PROBLEM ...
, Kyle McMartin
, (Sat Nov 27, 9:26 pm)
Re: High CPU load when machine is idle (related to PROBLEM ...
, Damien Wyart
, (Sun Nov 28, 4:40 am)
Re: High CPU load when machine is idle (related to PROBLEM ...
, Valdis.Kletnieks
, (Sun Nov 28, 11:07 am)
Re: High CPU load when machine is idle (related to PROBLEM ...
, Peter Zijlstra
, (Mon Nov 29, 4:38 am)
Re: High CPU load when machine is idle (related to PROBLEM ...
, tmhikaru
, (Mon Nov 29, 12:40 pm)
Re: High CPU load when machine is idle (related to PROBLEM ...
, Peter Zijlstra
, (Mon Nov 29, 4:01 pm)
Re: High CPU load when machine is idle (related to PROBLEM ...
, Peter Zijlstra
, (Tue Nov 30, 7:59 am)
Re: High CPU load when machine is idle (related to PROBLEM ...
, Kyle McMartin
, (Tue Nov 30, 8:39 am)
Re: High CPU load when machine is idle (related to PROBLEM ...
, Damien Wyart
, (Tue Nov 30, 9:49 am)
Re: High CPU load when machine is idle (related to PROBLEM ...
, Damien Wyart
, (Tue Nov 30, 9:53 am)
Re: High CPU load when machine is idle (related to PROBLEM ...
, Peter Zijlstra
, (Tue Nov 30, 10:29 am)
Re: High CPU load when machine is idle (related to PROBLEM ...
, tmhikaru
, (Tue Nov 30, 1:01 pm)
Re: High CPU load when machine is idle (related to PROBLEM ...
, Kyle McMartin
, (Tue Nov 30, 1:04 pm)
Re: High CPU load when machine is idle (related to PROBLEM ...
, tmhikaru
, (Wed Dec 1, 2:27 pm)
Re: High CPU load when machine is idle (related to PROBLEM ...
, tmhikaru
, (Thu Dec 2, 3:16 am)
[tip:sched/urgent] sched: Cure more NO_HZ load average woes
, tip-bot for Peter Zi ...
, (Wed Dec 8, 1:40 pm)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Michael Trimarchi
Re: [PATCH] VFS: make file->f_pos access atomic on 32bit arch
Miklos Szeredi
[patch 14/15] vfs: more path_permission() conversions
Serge E. Hallyn
Re: [RFC v5][PATCH 7/8] Infrastructure for shared objects
Bernd Schmidt
Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3
Takashi Iwai
[PATCH 2/2] input: Add LED support to Synaptics device
git
:
Junio C Hamano
Re: mingw, windows, crlf/lf, and git
Eyvind Bernhardsen
Re: Where has "git ls-remote" reference pattern matching gone?
Shawn O. Pearce
Re: Switching from CVS to GIT
Todd Zullinger
Re: [PATCH 2/2] send-email: rfc2047-quote subject lines with non-ascii characters
Santi Béjar
Re: How to use git-fmt-merge-msg?
linux-netdev
:
Ramkrishna Vepa
[net-2.6 PATCH 1/10] Neterion: New driver: Driver help file
Mark Anthony
invitation / inquiry
Ingo Molnar
Re: [PATCH 08/16] dma-debug: add core checking functions
David Miller
Re: [PATCH 1/3] f_phonet: dev_kfree_skb instead of dev_kfree_skb_any in TX callback
Sascha Hauer
[PATCH 03/12] fec: do not typedef struct types
git-commits-head
:
Linux Kernel Mailing List
amba: struct device - replace bus_id with dev_name(), dev_set_name()
Linux Kernel Mailing List
MIPS: Yosemite: Convert SMP startup lock to arch spinlock.
Linux Kernel Mailing List
ARM: S5PC100: IRQ and timer
Linux Kernel Mailing List
davinci: edma: clear interrupt status for interrupt enabled channels only
Linux Kernel Mailing List
x86, mm, kprobes: fault.c, simplify notify_page_fault()
openbsd-misc
:
Daniel A. Ramaley
Re: [semi-OT] Can anyone recommend an OpenBSD-compatible colour laser printer?
Matthias Kilian
Re: can't get vesa @ 1280x800 or nv
Tobias Ulmer
Re: Problem after upgrade 4.5 to 4.6: ERR M
Philip Guenther
Re: SIGCHLD and libpthread.so
J.C. Roberts
Re: [semi-OT] Can anyone recommend an OpenBSD-compatible colour laser printer?
Colocation donated by:
Syndicate