2002-03-01 16:35:07

by Dan Chen

[permalink] [raw]
Subject: [RFC][PATCH] #define yield() for 2.4 scheduler (anticipating O(1))

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 [email protected]
GPG key: http://www.unc.edu/~crimsun/pubkey.gpg.asc


Attachments:
(No filename) (0.00 B)
(No filename) (232.00 B)
Download all attachments

2002-03-01 18:01:05

by Davide Libenzi

[permalink] [raw]
Subject: Re: [RFC][PATCH] #define yield() for 2.4 scheduler (anticipating O(1))

On Fri, 1 Mar 2002, 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.

Feed it to Marcelo with a few lines of comment ( even if it's clear ).



- Davide


2002-03-01 18:57:53

by Mike Fedyk

[permalink] [raw]
Subject: Re: [RFC][PATCH] #define yield() for 2.4 scheduler (anticipating O(1))

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 [email protected]
> GPG key: http://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?

2002-03-01 19:05:33

by Dan Chen

[permalink] [raw]
Subject: Re: [RFC][PATCH] #define yield() for 2.4 scheduler (anticipating O(1))

On Fri, Mar 01, 2002 at 10:58:25AM -0800, Mike Fedyk wrote:
> is __set_current_state(TASK_RUNNING) compatible with the new scheduler?

Yes.

--
Dan Chen [email protected]
GPG key: http://www.unc.edu/~crimsun/pubkey.gpg.asc


Attachments:
(No filename) (239.00 B)
(No filename) (232.00 B)
Download all attachments

2002-03-01 21:05:00

by Bongani Hlope

[permalink] [raw]
Subject: Re: [RFC][PATCH] #define yield() for 2.4 scheduler (anticipating O(1))

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 [email protected]
> > GPG key: http://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.

2002-03-01 22:29:23

by Ken Brownfield

[permalink] [raw]
Subject: Re: [RFC][PATCH] #define yield() for 2.4 scheduler (anticipating O(1))

I doubt this is an issue specific to the kernel or patches -- I've had
O(1) running with -aa and -rmap for quite some time with no problems. I
was recoding rather than implementing the macro, but the concept was the
same.

--
Ken.
[email protected]

On Fri, Mar 01, 2002 at 11:18:12PM +0200, Bongani Hlope wrote:
| 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.

2002-03-02 11:06:12

by Rik van Riel

[permalink] [raw]
Subject: Re: [RFC][PATCH] #define yield() for 2.4 scheduler (anticipating O(1))

On 1 Mar 2002, Bongani Hlope wrote:

> I think Ingo is using sys_sched_yield(); instead of yield. I will still
> be carefull about it though.

Hmm, I guess it is kind of important to use the same name
for yielding the CPU that ingo is using ;)

Rik
--
"Linux holds advantages over the single-vendor commercial OS"
-- Microsoft's "Competing with Linux" document

http://www.surriel.com/ http://distro.conectiva.com/


2002-03-02 17:38:51

by Dan Chen

[permalink] [raw]
Subject: Re: [RFC][PATCH] #define yield() for 2.4 scheduler (anticipating O(1))

On Fri, Mar 01, 2002 at 06:13:49PM -0300, Rik van Riel wrote:
> On 1 Mar 2002, Bongani Hlope wrote:
>
> > I think Ingo is using sys_sched_yield(); instead of yield. I will still
> > be carefull about it though.
>
> Hmm, I guess it is kind of important to use the same name
> for yielding the CPU that ingo is using ;)

Ingo is using yield() as well.

--
Dan Chen [email protected]
GPG key: http://www.unc.edu/~crimsun/pubkey.gpg.asc


Attachments:
(No filename) (451.00 B)
(No filename) (232.00 B)
Download all attachments