From ec332cd30cf1ccde914a87330ff66744414c8d24 Mon Sep 17 00:00:00 2001 From: Robert Love Date: Fri, 8 Feb 2002 19:11:35 -0800 Subject: [PATCH] Re: [PATCH] Preemptible Kernel for 2.5 On Sat, 2002-02-09 at 01:43, Linus Torvalds wrote: > That will clean up all your issues with header file ordering. You are right, it did. I removed all the sched.h dependencies and this reduced the size of the patch greatly. I now use current_thread_info() and none of the header or include hackery from before. I've tested this with and without preemption enabled with success. I appreciate your help with this. Again, this is a minimal i386-only patch. I have other arches, documentation, etc. Patch against 2.5.4-pre5. Enjoy, Robert Love --- kernel/fork.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'kernel/fork.c') diff --git a/kernel/fork.c b/kernel/fork.c index 3e49ad5c1ebc..9ac534b70d1f 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -650,6 +650,13 @@ int do_fork(unsigned long clone_flags, unsigned long stack_start, if (p->binfmt && p->binfmt->module) __MOD_INC_USE_COUNT(p->binfmt->module); +#ifdef CONFIG_PREEMPT + /* + * schedule_tail drops this_rq()->lock so we compensate with a count + * of 1. Also, we want to start with kernel preemption disabled. + */ + p->thread_info->preempt_count = 1; +#endif p->did_exec = 0; p->swappable = 0; p->state = TASK_UNINTERRUPTIBLE; -- cgit v1.2.3