From: Ingo Molnar <mingo@elte.hu>
To: Nick Piggin <piggin@cyberone.com.au>
Cc: Andrew Morton <akpm@osdl.org>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/5] 2.6.0 fix preempt ctx switch accounting
Date: Sat, 20 Dec 2003 20:22:38 +0100 [thread overview]
Message-ID: <20031220192238.GA30970@elte.hu> (raw)
In-Reply-To: <3FE46885.2030905@cyberone.com.au>
* Nick Piggin <piggin@cyberone.com.au> wrote:
> Make sure to count kernel preemption as a context switch. A short cut
> has been preventing it.
i'd prefer the much simpler patch below. This also keeps the kernel
preemption logic isolated instead of mixing it into the normal path.
Ingo
--- linux/kernel/sched.c.orig
+++ linux/kernel/sched.c
@@ -1520,8 +1520,10 @@ need_resched:
* if entering off of a kernel preemption go straight
* to picking the next task.
*/
- if (unlikely(preempt_count() & PREEMPT_ACTIVE))
+ if (unlikely(preempt_count() & PREEMPT_ACTIVE)) {
+ prev->nivcsw++;
goto pick_next_task;
+ }
switch (prev->state) {
case TASK_INTERRUPTIBLE:
next prev parent reply other threads:[~2003-12-20 19:23 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 ` [PATCH 4/5] 2.6.0 sched style fixes Nick Piggin
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 ` Ingo Molnar [this message]
2003-12-20 19:52 ` [PATCH 1/5] 2.6.0 fix preempt ctx switch accounting 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=20031220192238.GA30970@elte.hu \
--to=mingo@elte.hu \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=piggin@cyberone.com.au \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox