diff options
| author | Robert Love <rml@tech9.net> | 2002-02-08 19:11:35 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2002-02-08 19:11:35 -0800 |
| commit | ec332cd30cf1ccde914a87330ff66744414c8d24 (patch) | |
| tree | 36d00dc307aa1e4eef2c5c91ec722dd2f1a45834 /kernel/fork.c | |
| parent | d7b654751759e2a2e1d49aebf595c12e55ca7b69 (diff) | |
[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
Diffstat (limited to 'kernel/fork.c')
| -rw-r--r-- | kernel/fork.c | 7 |
1 files changed, 7 insertions, 0 deletions
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; |
