linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sched/core: remove obsolete nr_uninterruptible()
@ 2013-02-20  7:37 Sha Zhengju
  2013-02-20  8:21 ` [PATCH V2] " Sha Zhengju
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Sha Zhengju @ 2013-02-20  7:37 UTC (permalink / raw)
  To: linux-kernel, mingo; +Cc: Sha Zhengju

From: Sha Zhengju <handai.szj@taobao.com>

Signed-off-by: Sha Zhengju <handai.szj@taobao.com>
---
 kernel/sched/core.c |   17 -----------------
 1 file changed, 17 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index c0b07c3..792f6fc 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -1957,23 +1957,6 @@ unsigned long nr_running(void)
 	return sum;
 }
 
-unsigned long nr_uninterruptible(void)
-{
-	unsigned long i, sum = 0;
-
-	for_each_possible_cpu(i)
-		sum += cpu_rq(i)->nr_uninterruptible;
-
-	/*
-	 * Since we read the counters lockless, it might be slightly
-	 * inaccurate. Do not allow it to go below zero though:
-	 */
-	if (unlikely((long)sum < 0))
-		sum = 0;
-
-	return sum;
-}
-
 unsigned long long nr_context_switches(void)
 {
 	int i;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH V2] sched/core: remove obsolete nr_uninterruptible()
  2013-02-20  7:37 [PATCH] sched/core: remove obsolete nr_uninterruptible() Sha Zhengju
@ 2013-02-20  8:21 ` Sha Zhengju
  2013-02-20  8:31 ` [PATCH] " Xiaotian Feng
  2013-02-20  9:14 ` [PATCH V3] " Sha Zhengju
  2 siblings, 0 replies; 6+ messages in thread
From: Sha Zhengju @ 2013-02-20  8:21 UTC (permalink / raw)
  To: linux-kernel; +Cc: mingo, Sha Zhengju

From: Sha Zhengju <handai.szj@taobao.com>

Signed-off-by: Sha Zhengju <handai.szj@taobao.com>
---
 kernel/sched/core.c |   22 ++--------------------
 1 file changed, 2 insertions(+), 20 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 03d7784..b7b03cd 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -1969,11 +1969,10 @@ context_switch(struct rq *rq, struct task_struct *prev,
 }
 
 /*
- * nr_running, nr_uninterruptible and nr_context_switches:
+ * nr_running and nr_context_switches:
  *
  * externally visible scheduler statistics: current number of runnable
- * threads, current number of uninterruptible-sleeping threads, total
- * number of context switches performed since bootup.
+ * threads, total number of context switches performed since bootup.
  */
 unsigned long nr_running(void)
 {
@@ -1985,23 +1984,6 @@ unsigned long nr_running(void)
 	return sum;
 }
 
-unsigned long nr_uninterruptible(void)
-{
-	unsigned long i, sum = 0;
-
-	for_each_possible_cpu(i)
-		sum += cpu_rq(i)->nr_uninterruptible;
-
-	/*
-	 * Since we read the counters lockless, it might be slightly
-	 * inaccurate. Do not allow it to go below zero though:
-	 */
-	if (unlikely((long)sum < 0))
-		sum = 0;
-
-	return sum;
-}
-
 unsigned long long nr_context_switches(void)
 {
 	int i;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] sched/core: remove obsolete nr_uninterruptible()
  2013-02-20  7:37 [PATCH] sched/core: remove obsolete nr_uninterruptible() Sha Zhengju
  2013-02-20  8:21 ` [PATCH V2] " Sha Zhengju
@ 2013-02-20  8:31 ` Xiaotian Feng
  2013-02-20  9:05   ` Sha Zhengju
  2013-02-20  9:14 ` [PATCH V3] " Sha Zhengju
  2 siblings, 1 reply; 6+ messages in thread
From: Xiaotian Feng @ 2013-02-20  8:31 UTC (permalink / raw)
  To: Sha Zhengju; +Cc: linux-kernel, mingo, Sha Zhengju

On Wed, Feb 20, 2013 at 3:37 PM, Sha Zhengju <handai.szj@gmail.com> wrote:
> From: Sha Zhengju <handai.szj@taobao.com>
>
> Signed-off-by: Sha Zhengju <handai.szj@taobao.com>
> ---
>  kernel/sched/core.c |   17 -----------------
>  1 file changed, 17 deletions(-)

You missed include/linux/sched.h :)

>
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index c0b07c3..792f6fc 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -1957,23 +1957,6 @@ unsigned long nr_running(void)
>         return sum;
>  }
>
> -unsigned long nr_uninterruptible(void)
> -{
> -       unsigned long i, sum = 0;
> -
> -       for_each_possible_cpu(i)
> -               sum += cpu_rq(i)->nr_uninterruptible;
> -
> -       /*
> -        * Since we read the counters lockless, it might be slightly
> -        * inaccurate. Do not allow it to go below zero though:
> -        */
> -       if (unlikely((long)sum < 0))
> -               sum = 0;
> -
> -       return sum;
> -}
> -
>  unsigned long long nr_context_switches(void)
>  {
>         int i;
> --
> 1.7.9.5
>
> --
> 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/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] sched/core: remove obsolete nr_uninterruptible()
  2013-02-20  8:31 ` [PATCH] " Xiaotian Feng
@ 2013-02-20  9:05   ` Sha Zhengju
  0 siblings, 0 replies; 6+ messages in thread
From: Sha Zhengju @ 2013-02-20  9:05 UTC (permalink / raw)
  To: Xiaotian Feng; +Cc: linux-kernel, mingo, Sha Zhengju

On Wed, Feb 20, 2013 at 4:31 PM, Xiaotian Feng <xtfeng@gmail.com> wrote:
> On Wed, Feb 20, 2013 at 3:37 PM, Sha Zhengju <handai.szj@gmail.com> wrote:
>> From: Sha Zhengju <handai.szj@taobao.com>
>>
>> Signed-off-by: Sha Zhengju <handai.szj@taobao.com>
>> ---
>>  kernel/sched/core.c |   17 -----------------
>>  1 file changed, 17 deletions(-)
>
> You missed include/linux/sched.h :)

Ohhhh... yeah, another lost... thank you for correcting me!  :)

>
>>
>> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
>> index c0b07c3..792f6fc 100644
>> --- a/kernel/sched/core.c
>> +++ b/kernel/sched/core.c
>> @@ -1957,23 +1957,6 @@ unsigned long nr_running(void)
>>         return sum;
>>  }
>>
>> -unsigned long nr_uninterruptible(void)
>> -{
>> -       unsigned long i, sum = 0;
>> -
>> -       for_each_possible_cpu(i)
>> -               sum += cpu_rq(i)->nr_uninterruptible;
>> -
>> -       /*
>> -        * Since we read the counters lockless, it might be slightly
>> -        * inaccurate. Do not allow it to go below zero though:
>> -        */
>> -       if (unlikely((long)sum < 0))
>> -               sum = 0;
>> -
>> -       return sum;
>> -}
>> -
>>  unsigned long long nr_context_switches(void)
>>  {
>>         int i;
>> --
>> 1.7.9.5
>>
>> --
>> 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/



-- 
Thanks,
Sha

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH V3] sched/core: remove obsolete nr_uninterruptible()
  2013-02-20  7:37 [PATCH] sched/core: remove obsolete nr_uninterruptible() Sha Zhengju
  2013-02-20  8:21 ` [PATCH V2] " Sha Zhengju
  2013-02-20  8:31 ` [PATCH] " Xiaotian Feng
@ 2013-02-20  9:14 ` Sha Zhengju
  2013-02-20 14:00   ` [tip:sched/urgent] sched/core: Remove the obsolete and unused nr_uninterruptible() function tip-bot for Sha Zhengju
  2 siblings, 1 reply; 6+ messages in thread
From: Sha Zhengju @ 2013-02-20  9:14 UTC (permalink / raw)
  To: linux-kernel; +Cc: mingo, Sha Zhengju

From: Sha Zhengju <handai.szj@taobao.com>

Signed-off-by: Sha Zhengju <handai.szj@taobao.com>
---
 include/linux/sched.h |    1 -
 kernel/sched/core.c   |   22 ++--------------------
 2 files changed, 2 insertions(+), 21 deletions(-)

diff --git a/include/linux/sched.h b/include/linux/sched.h
index 33cc421..f9ca237d 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -98,7 +98,6 @@ extern int nr_threads;
 DECLARE_PER_CPU(unsigned long, process_counts);
 extern int nr_processes(void);
 extern unsigned long nr_running(void);
-extern unsigned long nr_uninterruptible(void);
 extern unsigned long nr_iowait(void);
 extern unsigned long nr_iowait_cpu(int cpu);
 extern unsigned long this_cpu_load(void);
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 03d7784..b7b03cd 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -1969,11 +1969,10 @@ context_switch(struct rq *rq, struct task_struct *prev,
 }
 
 /*
- * nr_running, nr_uninterruptible and nr_context_switches:
+ * nr_running and nr_context_switches:
  *
  * externally visible scheduler statistics: current number of runnable
- * threads, current number of uninterruptible-sleeping threads, total
- * number of context switches performed since bootup.
+ * threads, total number of context switches performed since bootup.
  */
 unsigned long nr_running(void)
 {
@@ -1985,23 +1984,6 @@ unsigned long nr_running(void)
 	return sum;
 }
 
-unsigned long nr_uninterruptible(void)
-{
-	unsigned long i, sum = 0;
-
-	for_each_possible_cpu(i)
-		sum += cpu_rq(i)->nr_uninterruptible;
-
-	/*
-	 * Since we read the counters lockless, it might be slightly
-	 * inaccurate. Do not allow it to go below zero though:
-	 */
-	if (unlikely((long)sum < 0))
-		sum = 0;
-
-	return sum;
-}
-
 unsigned long long nr_context_switches(void)
 {
 	int i;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [tip:sched/urgent] sched/core: Remove the obsolete and unused nr_uninterruptible() function
  2013-02-20  9:14 ` [PATCH V3] " Sha Zhengju
@ 2013-02-20 14:00   ` tip-bot for Sha Zhengju
  0 siblings, 0 replies; 6+ messages in thread
From: tip-bot for Sha Zhengju @ 2013-02-20 14:00 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, handai.szj, hpa, mingo, a.p.zijlstra, tglx

Commit-ID:  1c3e826482ab698e418c7a894440e62c76aac893
Gitweb:     http://git.kernel.org/tip/1c3e826482ab698e418c7a894440e62c76aac893
Author:     Sha Zhengju <handai.szj@taobao.com>
AuthorDate: Wed, 20 Feb 2013 17:14:38 +0800
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 20 Feb 2013 11:39:24 +0100

sched/core: Remove the obsolete and unused nr_uninterruptible() function

Signed-off-by: Sha Zhengju <handai.szj@taobao.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1361351678-8065-1-git-send-email-handai.szj@taobao.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 include/linux/sched.h |  1 -
 kernel/sched/core.c   | 22 ++--------------------
 2 files changed, 2 insertions(+), 21 deletions(-)

diff --git a/include/linux/sched.h b/include/linux/sched.h
index 33cc421..f9ca237d 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -98,7 +98,6 @@ extern int nr_threads;
 DECLARE_PER_CPU(unsigned long, process_counts);
 extern int nr_processes(void);
 extern unsigned long nr_running(void);
-extern unsigned long nr_uninterruptible(void);
 extern unsigned long nr_iowait(void);
 extern unsigned long nr_iowait_cpu(int cpu);
 extern unsigned long this_cpu_load(void);
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 03d7784..b7b03cd 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -1969,11 +1969,10 @@ context_switch(struct rq *rq, struct task_struct *prev,
 }
 
 /*
- * nr_running, nr_uninterruptible and nr_context_switches:
+ * nr_running and nr_context_switches:
  *
  * externally visible scheduler statistics: current number of runnable
- * threads, current number of uninterruptible-sleeping threads, total
- * number of context switches performed since bootup.
+ * threads, total number of context switches performed since bootup.
  */
 unsigned long nr_running(void)
 {
@@ -1985,23 +1984,6 @@ unsigned long nr_running(void)
 	return sum;
 }
 
-unsigned long nr_uninterruptible(void)
-{
-	unsigned long i, sum = 0;
-
-	for_each_possible_cpu(i)
-		sum += cpu_rq(i)->nr_uninterruptible;
-
-	/*
-	 * Since we read the counters lockless, it might be slightly
-	 * inaccurate. Do not allow it to go below zero though:
-	 */
-	if (unlikely((long)sum < 0))
-		sum = 0;
-
-	return sum;
-}
-
 unsigned long long nr_context_switches(void)
 {
 	int i;

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-02-20 14:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-20  7:37 [PATCH] sched/core: remove obsolete nr_uninterruptible() Sha Zhengju
2013-02-20  8:21 ` [PATCH V2] " Sha Zhengju
2013-02-20  8:31 ` [PATCH] " Xiaotian Feng
2013-02-20  9:05   ` Sha Zhengju
2013-02-20  9:14 ` [PATCH V3] " Sha Zhengju
2013-02-20 14:00   ` [tip:sched/urgent] sched/core: Remove the obsolete and unused nr_uninterruptible() function tip-bot for Sha Zhengju

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).