Re: [RFC][PATCH] #define yield() for 2.4 scheduler (anticipating

Bongani Hlope (bonganilinux@mweb.co.za)
01 Mar 2002 23:18:12 +0200


On Fri, 2002-03-01 at 20:58, Mike Fedyk wrote:
> On Fri, Mar 01, 2002 at 11:32:37AM -0500, Dan Chen wrote:
> > In response to Rik's post concerning a #define yield(), I've done a
> > quick egrep over the 2.4.19-pre2 tree and modified as necessary. This is
> > a strict search and replace. Thanks to Rik and Davide for assistance.
> > Please correct me if I erred.
> >
> > --
> > Dan Chen crimsun@email.unc.edu
> > GPG key: www.unc.edu/~crimsun/pubkey.gpg.asc
>
> > diff -uNr linux.orig/fs/buffer.c linux/fs/buffer.c
> > --- linux.orig/fs/buffer.c Thu Feb 28 22:00:02 2002
> > +++ linux/fs/buffer.c Fri Mar 1 10:29:52 2002
> > @@ -735,9 +735,8 @@
> > wakeup_bdflush();
> > try_to_free_pages(zone, GFP_NOFS, 0);
> > run_task_queue(&tq_disk);
> > - current->policy |= SCHED_YIELD;
> > __set_current_state(TASK_RUNNING);
> > - schedule();
> > + yield();
> > }
> >
> > void init_buffer(struct buffer_head *bh, bh_end_io_t *handler, void *private)
>
> is __set_current_state(TASK_RUNNING) compatible with the new scheduler?
> -

I once tried to apply the O(1) scheduler on 2.4.18-pre9 + aa vm and I
made a similar change (the O(1) patch was rejected on buffer.c) and it
caused so corruption on my file system (ext2), but I'm still not sure
what cause it that change was my main concern. I think Ingo is using
sys_sched_yield(); instead of yield. I will still be carefull about it
though.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/