From: Nick Piggin <piggin@cyberone.com.au>
To: Andrew Morton <akpm@osdl.org>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH 4/5] 2.6.0 sched style fixes
Date: Sun, 21 Dec 2003 02:22:24 +1100 [thread overview]
Message-ID: <3FE46930.1020504@cyberone.com.au> (raw)
In-Reply-To: <3FE468F5.7020501@cyberone.com.au>
[-- Attachment #1: Type: text/plain, Size: 49 bytes --]
Couple of small spacing and indentation changes
[-- Attachment #2: sched-style.patch --]
[-- Type: text/plain, Size: 2996 bytes --]
Couple of small spacing and indentation changes
linux-2.6-npiggin/kernel/sched.c | 33 +++++++++++++++++----------------
1 files changed, 17 insertions(+), 16 deletions(-)
diff -puN kernel/sched.c~sched-style kernel/sched.c
--- linux-2.6/kernel/sched.c~sched-style 2003-12-04 13:01:07.000000000 +1100
+++ linux-2.6-npiggin/kernel/sched.c 2003-12-04 13:01:25.000000000 +1100
@@ -396,7 +396,7 @@ static void recalc_task_prio(task_t *p,
* other processes.
*/
if (p->mm && p->activated != -1 &&
- sleep_time > JUST_INTERACTIVE_SLEEP(p)){
+ sleep_time > JUST_INTERACTIVE_SLEEP(p)) {
p->sleep_avg = JIFFIES_TO_NS(MAX_SLEEP_AVG -
AVG_TIMESLICE);
if (!HIGH_CREDIT(p))
@@ -422,15 +422,15 @@ static void recalc_task_prio(task_t *p,
* sleep are limited in their sleep_avg rise as they
* are likely to be cpu hogs waiting on I/O
*/
- if (p->activated == -1 && !HIGH_CREDIT(p) && p->mm){
+ if (p->activated == -1 && !HIGH_CREDIT(p) && p->mm) {
if (p->sleep_avg >= JUST_INTERACTIVE_SLEEP(p))
sleep_time = 0;
else if (p->sleep_avg + sleep_time >=
- JUST_INTERACTIVE_SLEEP(p)){
- p->sleep_avg =
- JUST_INTERACTIVE_SLEEP(p);
- sleep_time = 0;
- }
+ JUST_INTERACTIVE_SLEEP(p)) {
+ p->sleep_avg =
+ JUST_INTERACTIVE_SLEEP(p);
+ sleep_time = 0;
+ }
}
/*
@@ -443,7 +443,7 @@ static void recalc_task_prio(task_t *p,
*/
p->sleep_avg += sleep_time;
- if (p->sleep_avg > NS_MAX_SLEEP_AVG){
+ if (p->sleep_avg > NS_MAX_SLEEP_AVG) {
p->sleep_avg = NS_MAX_SLEEP_AVG;
if (!HIGH_CREDIT(p))
p->interactive_credit++;
@@ -470,7 +470,7 @@ static inline void activate_task(task_t
* This checks to make sure it's not an uninterruptible task
* that is now waking up.
*/
- if (!p->activated){
+ if (!p->activated) {
/*
* Tasks which were woken up by interrupts (ie. hw events)
* are most likely of interactive nature. So we give them
@@ -480,13 +480,14 @@ static inline void activate_task(task_t
*/
if (in_interrupt())
p->activated = 2;
- else
- /*
- * Normal first-time wakeups get a credit too for on-runqueue
- * time, but it will be weighted down:
- */
+ else {
+ /*
+ * Normal first-time wakeups get a credit too for on-runqueue
+ * time, but it will be weighted down:
+ */
p->activated = 1;
}
+ }
p->timestamp = now;
__activate_task(p, rq);
@@ -638,7 +639,7 @@ repeat_lock_task:
task_rq_unlock(rq, &flags);
goto repeat_lock_task;
}
- if (old_state == TASK_UNINTERRUPTIBLE){
+ if (old_state == TASK_UNINTERRUPTIBLE) {
rq->nr_uninterruptible--;
/*
* Tasks on involuntary sleep don't earn
@@ -1603,7 +1604,7 @@ switch_tasks:
RCU_qsctr(task_cpu(prev))++;
prev->sleep_avg -= run_time;
- if ((long)prev->sleep_avg <= 0){
+ if ((long)prev->sleep_avg <= 0) {
prev->sleep_avg = 0;
if (!(HIGH_CREDIT(prev) || LOW_CREDIT(prev)))
prev->interactive_credit--;
_
next prev parent reply other threads:[~2003-12-20 15:24 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-12-20 15:19 [PATCH 1/5] 2.6.0 fix preempt ctx switch accounting Nick Piggin
2003-12-20 15:20 ` [PATCH 2/5] 2.6.0 sched fork cleanup Nick Piggin
2003-12-20 15:21 ` [PATCH 3/5] 2.6.0 sched migrate comment Nick Piggin
2003-12-20 15:22 ` Nick Piggin [this message]
2003-12-20 15:24 ` [PATCH 5/5] 2.6.0 sched affinity race Nick Piggin
2003-12-20 21:07 ` [PATCH 4/5] 2.6.0 sched style fixes Ingo Molnar
2003-12-20 20:26 ` [PATCH 3/5] 2.6.0 sched migrate comment Ingo Molnar
2003-12-20 23:19 ` Nick Piggin
2003-12-20 19:55 ` [PATCH 2/5] 2.6.0 sched fork cleanup Ingo Molnar
2003-12-20 23:17 ` Nick Piggin
2003-12-20 19:22 ` [PATCH 1/5] 2.6.0 fix preempt ctx switch accounting Ingo Molnar
2003-12-20 19:52 ` Rob Love
2003-12-20 20:07 ` Linus Torvalds
2003-12-20 21:32 ` Ingo Molnar
2003-12-20 23:15 ` Nick Piggin
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=3FE46930.1020504@cyberone.com.au \
--to=piggin@cyberone.com.au \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.