]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] remove preempt_disable from pdflush
authorRobert Love <rml@tech9.net>
Tue, 21 May 2002 11:00:36 +0000 (04:00 -0700)
committerLinus Torvalds <torvalds@penguin.transmeta.com>
Tue, 21 May 2002 11:00:36 +0000 (04:00 -0700)
It seems by the comments the statements were only there to prevent the
thread from finding itself as TASK_RUNNING after a kernel preemption.
Since we reverted to the original preemption behavior (which does not do
that) it should be safe.  Looking over the code confirms - it seems to
not be doing anything evil and is properly locked otherwise.

mm/pdflush.c

index 5e7d0125c39d0bfed9f945af155bf6c579343a93..d9465be7909121dc17b8135b2884346834f54841 100644 (file)
@@ -78,12 +78,6 @@ struct pdflush_work {
        unsigned long when_i_went_to_sleep;
 };
 
-/*
- * preemption is disabled in pdflush.  There was a bug in preempt
- * which was causing pdflush to get flipped into state TASK_RUNNING
- * when it performed a spin_unlock.  That bug is probably fixed,
- * but play it safe.  The preempt-off paths are very short.
- */
 static int __pdflush(struct pdflush_work *my_work)
 {
        daemonize();
@@ -100,7 +94,6 @@ static int __pdflush(struct pdflush_work *my_work)
        my_work->fn = NULL;
        my_work->who = current;
 
-       preempt_disable();
        spin_lock_irq(&pdflush_lock);
        nr_pdflush_threads++;
 //     printk("pdflush %d [%d] starts\n", nr_pdflush_threads, current->pid);
@@ -114,9 +107,7 @@ static int __pdflush(struct pdflush_work *my_work)
 
                schedule();
 
-               preempt_enable();
                (*my_work->fn)(my_work->arg0);
-               preempt_disable();
 
                /*
                 * Thread creation: For how long have there been zero
@@ -150,7 +141,6 @@ static int __pdflush(struct pdflush_work *my_work)
        nr_pdflush_threads--;
 //     printk("pdflush %d [%d] ends\n", nr_pdflush_threads, current->pid);
        spin_unlock_irq(&pdflush_lock);
-       preempt_enable();
        return 0;
 }