* [RFC][PATCH] #define yield() for 2.4 scheduler (anticipating O(1))
@ 2002-03-01 16:32 Dan Chen
2002-03-01 18:03 ` Davide Libenzi
2002-03-01 18:58 ` Mike Fedyk
0 siblings, 2 replies; 8+ messages in thread
From: Dan Chen @ 2002-03-01 16:32 UTC (permalink / raw)
To: linux-kernel
[-- Attachment #1.1: Type: text/plain, Size: 348 bytes --]
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
[-- Attachment #1.2: yield.diff --]
[-- Type: text/plain, Size: 13814 bytes --]
diff -uNr linux.orig/arch/alpha/mm/fault.c linux/arch/alpha/mm/fault.c
--- linux.orig/arch/alpha/mm/fault.c Mon Sep 17 19:15:02 2001
+++ linux/arch/alpha/mm/fault.c Fri Mar 1 11:05:19 2002
@@ -196,8 +196,7 @@
*/
out_of_memory:
if (current->pid == 1) {
- current->policy |= SCHED_YIELD;
- schedule();
+ yield();
down_read(&mm->mmap_sem);
goto survive;
}
diff -uNr linux.orig/arch/i386/mm/fault.c linux/arch/i386/mm/fault.c
--- linux.orig/arch/i386/mm/fault.c Thu Feb 28 21:59:44 2002
+++ linux/arch/i386/mm/fault.c Fri Mar 1 11:03:47 2002
@@ -86,8 +86,7 @@
out_of_memory:
if (current->pid == 1) {
- current->policy |= SCHED_YIELD;
- schedule();
+ yield();
goto survive;
}
goto bad_area;
diff -uNr linux.orig/arch/ia64/mm/fault.c linux/arch/ia64/mm/fault.c
--- linux.orig/arch/ia64/mm/fault.c Thu Feb 28 21:59:59 2002
+++ linux/arch/ia64/mm/fault.c Fri Mar 1 11:17:26 2002
@@ -196,8 +196,7 @@
out_of_memory:
up_read(&mm->mmap_sem);
if (current->pid == 1) {
- current->policy |= SCHED_YIELD;
- schedule();
+ yield();
down_read(&mm->mmap_sem);
goto survive;
}
diff -uNr linux.orig/arch/ppc/mm/fault.c linux/arch/ppc/mm/fault.c
--- linux.orig/arch/ppc/mm/fault.c Tue Oct 2 12:12:44 2001
+++ linux/arch/ppc/mm/fault.c Fri Mar 1 11:06:02 2002
@@ -197,8 +197,7 @@
out_of_memory:
up_read(&mm->mmap_sem);
if (current->pid == 1) {
- current->policy |= SCHED_YIELD;
- schedule();
+ yield();
down_read(&mm->mmap_sem);
goto survive;
}
diff -uNr linux.orig/arch/sh/mm/fault.c linux/arch/sh/mm/fault.c
--- linux.orig/arch/sh/mm/fault.c Mon Oct 15 16:36:48 2001
+++ linux/arch/sh/mm/fault.c Fri Mar 1 11:15:44 2002
@@ -207,8 +207,7 @@
out_of_memory:
up_read(&mm->mmap_sem);
if (current->pid == 1) {
- current->policy |= SCHED_YIELD;
- schedule();
+ yield();
down_read(&mm->mmap_sem);
goto survive;
}
diff -uNr linux.orig/drivers/char/drm-4.0/ffb_drv.c linux/drivers/char/drm-4.0/ffb_drv.c
--- linux.orig/drivers/char/drm-4.0/ffb_drv.c Thu Feb 28 21:59:45 2002
+++ linux/drivers/char/drm-4.0/ffb_drv.c Fri Mar 1 10:59:38 2002
@@ -710,8 +710,7 @@
/* Contention */
atomic_inc(&dev->total_sleeps);
current->state = TASK_INTERRUPTIBLE;
- current->policy |= SCHED_YIELD;
- schedule();
+ yield();
if (signal_pending(current)) {
ret = -ERESTARTSYS;
break;
diff -uNr linux.orig/drivers/char/drm-4.0/tdfx_drv.c linux/drivers/char/drm-4.0/tdfx_drv.c
--- linux.orig/drivers/char/drm-4.0/tdfx_drv.c Thu Feb 28 21:59:45 2002
+++ linux/drivers/char/drm-4.0/tdfx_drv.c Fri Mar 1 11:01:46 2002
@@ -578,10 +578,7 @@
/* Contention */
atomic_inc(&dev->total_sleeps);
-#if 1
- current->policy |= SCHED_YIELD;
-#endif
- schedule();
+ yield();
if (signal_pending(current)) {
ret = -ERESTARTSYS;
break;
@@ -604,8 +601,7 @@
when dev->last_context == lock.context
NOTE WE HOLD THE LOCK THROUGHOUT THIS
TIME! */
- current->policy |= SCHED_YIELD;
- schedule();
+ yield();
current->state = TASK_RUNNING;
remove_wait_queue(&dev->context_wait, &entry);
if (signal_pending(current)) {
diff -uNr linux.orig/drivers/ide/ataraid.c linux/drivers/ide/ataraid.c
--- linux.orig/drivers/ide/ataraid.c Thu Oct 25 16:58:35 2001
+++ linux/drivers/ide/ataraid.c Fri Mar 1 11:03:28 2002
@@ -123,8 +123,7 @@
ptr=kmalloc(sizeof(struct buffer_head),GFP_NOIO);
if (!ptr) {
__set_current_state(TASK_RUNNING);
- current->policy |= SCHED_YIELD;
- schedule();
+ yield();
}
}
return ptr;
@@ -139,8 +138,7 @@
ptr=kmalloc(sizeof(struct ataraid_bh_private),GFP_NOIO);
if (!ptr) {
__set_current_state(TASK_RUNNING);
- current->policy |= SCHED_YIELD;
- schedule();
+ yield();
}
}
return ptr;
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)
diff -uNr linux.orig/fs/jbd/journal.c linux/fs/jbd/journal.c
--- linux.orig/fs/jbd/journal.c Thu Feb 28 21:59:47 2002
+++ linux/fs/jbd/journal.c Fri Mar 1 10:40:34 2002
@@ -460,8 +460,7 @@
printk (KERN_NOTICE __FUNCTION__
": ENOMEM at get_unused_buffer_head, "
"trying again.\n");
- current->policy |= SCHED_YIELD;
- schedule();
+ yield();
}
} while (!new_bh);
/* keep subsequent assertions sane */
@@ -1541,8 +1540,7 @@
last_warning = jiffies;
}
- current->policy |= SCHED_YIELD;
- schedule();
+ yield();
}
}
@@ -1600,8 +1598,7 @@
last_warning = jiffies;
}
while (ret == 0) {
- current->policy |= SCHED_YIELD;
- schedule();
+ yield();
ret = kmem_cache_alloc(journal_head_cache, GFP_NOFS);
}
}
diff -uNr linux.orig/fs/jbd/revoke.c linux/fs/jbd/revoke.c
--- linux.orig/fs/jbd/revoke.c Thu Feb 28 21:59:47 2002
+++ linux/fs/jbd/revoke.c Fri Mar 1 10:42:04 2002
@@ -137,8 +137,7 @@
if (!journal_oom_retry)
return -ENOMEM;
jbd_debug(1, "ENOMEM in " __FUNCTION__ ", retrying.\n");
- current->policy |= SCHED_YIELD;
- schedule();
+ yield();
goto repeat;
}
diff -uNr linux.orig/fs/jbd/transaction.c linux/fs/jbd/transaction.c
--- linux.orig/fs/jbd/transaction.c Thu Feb 28 21:59:47 2002
+++ linux/fs/jbd/transaction.c Fri Mar 1 10:42:39 2002
@@ -1379,8 +1379,7 @@
do {
old_handle_count = transaction->t_handle_count;
set_current_state(TASK_RUNNING);
- current->policy |= SCHED_YIELD;
- schedule();
+ yield();
} while (old_handle_count != transaction->t_handle_count);
}
diff -uNr linux.orig/fs/locks.c linux/fs/locks.c
--- linux.orig/fs/locks.c Thu Oct 11 10:52:18 2001
+++ linux/fs/locks.c Fri Mar 1 10:32:16 2002
@@ -445,8 +445,7 @@
/* Let the blocked process remove waiter from the
* block list when it gets scheduled.
*/
- current->policy |= SCHED_YIELD;
- schedule();
+ yield();
} else {
/* Remove waiter from the block list, because by the
* time it wakes up blocker won't exist any more.
diff -uNr linux.orig/fs/nfs/pagelist.c linux/fs/nfs/pagelist.c
--- linux.orig/fs/nfs/pagelist.c Thu Feb 28 21:59:38 2002
+++ linux/fs/nfs/pagelist.c Fri Mar 1 10:35:36 2002
@@ -96,8 +96,7 @@
continue;
if (signalled() && (server->flags & NFS_MOUNT_INTR))
return ERR_PTR(-ERESTARTSYS);
- current->policy = SCHED_YIELD;
- schedule();
+ yield();
}
/* Initialize the request struct. Initially, we assume a
diff -uNr linux.orig/fs/reiserfs/buffer2.c linux/fs/reiserfs/buffer2.c
--- linux.orig/fs/reiserfs/buffer2.c Thu Feb 28 21:59:38 2002
+++ linux/fs/reiserfs/buffer2.c Fri Mar 1 10:37:11 2002
@@ -33,8 +33,7 @@
buffer_journal_dirty(bh) ? ' ' : '!');
}
run_task_queue(&tq_disk);
- current->policy |= SCHED_YIELD;
- schedule();
+ yield();
}
if (repeat_counter > 30000000) {
reiserfs_warning("vs-3051: done waiting, ignore vs-3050 messages for (%b)\n", bh) ;
diff -uNr linux.orig/fs/reiserfs/journal.c linux/fs/reiserfs/journal.c
--- linux.orig/fs/reiserfs/journal.c Thu Feb 28 21:59:47 2002
+++ linux/fs/reiserfs/journal.c Fri Mar 1 10:36:44 2002
@@ -149,8 +149,7 @@
}
bn = allocate_bitmap_node(p_s_sb) ;
if (!bn) {
- current->policy |= SCHED_YIELD ;
- schedule() ;
+ yield();
goto repeat ;
}
return bn ;
diff -uNr linux.orig/include/linux/sched.h linux/include/linux/sched.h
--- linux.orig/include/linux/sched.h Thu Feb 28 22:00:03 2002
+++ linux/include/linux/sched.h Fri Mar 1 10:26:20 2002
@@ -122,6 +122,15 @@
*/
#define SCHED_YIELD 0x10
+/*
+ * Anticipating inclusion of Ingo's O(1) scheduler...
+ */
+#define yield() \
+ do { \
+ current->policy |= SCHED_YIELD; \
+ schedule(); \
+ } while (0)
+
struct sched_param {
int sched_priority;
};
diff -uNr linux.orig/init/do_mounts.c linux/init/do_mounts.c
--- linux.orig/init/do_mounts.c Thu Feb 28 22:00:03 2002
+++ linux/init/do_mounts.c Fri Mar 1 10:43:15 2002
@@ -526,10 +526,8 @@
pid = kernel_thread(do_linuxrc, "/linuxrc", SIGCHLD);
if (pid > 0) {
- while (pid != wait(&i)) {
- current->policy |= SCHED_YIELD;
- schedule();
- }
+ while (pid != wait(&i))
+ yield();
}
if (MAJOR(real_root_dev) != RAMDISK_MAJOR
|| MINOR(real_root_dev) != 0) {
diff -uNr linux.orig/kernel/softirq.c linux/kernel/softirq.c
--- linux.orig/kernel/softirq.c Wed Oct 31 13:26:02 2001
+++ linux/kernel/softirq.c Fri Mar 1 10:48:46 2002
@@ -260,8 +260,7 @@
while (test_and_set_bit(TASKLET_STATE_SCHED, &t->state)) {
current->state = TASK_RUNNING;
do {
- current->policy |= SCHED_YIELD;
- schedule();
+ yield();
} while (test_bit(TASKLET_STATE_SCHED, &t->state));
}
tasklet_unlock_wait(t);
@@ -405,10 +404,8 @@
CLONE_FS | CLONE_FILES | CLONE_SIGNAL) < 0)
printk("spawn_ksoftirqd() failed for cpu %d\n", cpu);
else {
- while (!ksoftirqd_task(cpu_logical_map(cpu))) {
- current->policy |= SCHED_YIELD;
- schedule();
- }
+ while (!ksoftirqd_task(cpu_logical_map(cpu)))
+ yield();
}
}
diff -uNr linux.orig/mm/highmem.c linux/mm/highmem.c
--- linux.orig/mm/highmem.c Thu Feb 28 21:59:39 2002
+++ linux/mm/highmem.c Fri Mar 1 10:51:22 2002
@@ -354,9 +354,8 @@
/* we need to wait I/O completion */
run_task_queue(&tq_disk);
- current->policy |= SCHED_YIELD;
__set_current_state(TASK_RUNNING);
- schedule();
+ yield();
goto repeat_alloc;
}
@@ -392,9 +391,8 @@
/* we need to wait I/O completion */
run_task_queue(&tq_disk);
- current->policy |= SCHED_YIELD;
__set_current_state(TASK_RUNNING);
- schedule();
+ yield();
goto repeat_alloc;
}
diff -uNr linux.orig/mm/oom_kill.c linux/mm/oom_kill.c
--- linux.orig/mm/oom_kill.c Sat Nov 3 20:05:25 2001
+++ linux/mm/oom_kill.c Fri Mar 1 10:51:35 2002
@@ -188,8 +188,7 @@
* killing itself before someone else gets the chance to ask
* for more memory.
*/
- current->policy |= SCHED_YIELD;
- schedule();
+ yield();
return;
}
diff -uNr linux.orig/mm/page_alloc.c linux/mm/page_alloc.c
--- linux.orig/mm/page_alloc.c Thu Feb 28 22:00:03 2002
+++ linux/mm/page_alloc.c Fri Mar 1 10:49:38 2002
@@ -429,9 +429,8 @@
return NULL;
/* Yield for kswapd, and try again */
- current->policy |= SCHED_YIELD;
__set_current_state(TASK_RUNNING);
- schedule();
+ yield();
goto rebalance;
}
diff -uNr linux.orig/net/ipv4/tcp_output.c linux/net/ipv4/tcp_output.c
--- linux.orig/net/ipv4/tcp_output.c Thu Feb 28 21:59:39 2002
+++ linux/net/ipv4/tcp_output.c Fri Mar 1 10:52:55 2002
@@ -1009,8 +1009,7 @@
skb = alloc_skb(MAX_TCP_HEADER, GFP_KERNEL);
if (skb)
break;
- current->policy |= SCHED_YIELD;
- schedule();
+ yield();
}
/* Reserve space for headers and prepare control bits. */
diff -uNr linux.orig/net/sched/sch_generic.c linux/net/sched/sch_generic.c
--- linux.orig/net/sched/sch_generic.c Fri Aug 18 13:26:25 2000
+++ linux/net/sched/sch_generic.c Fri Mar 1 10:58:07 2002
@@ -475,10 +475,8 @@
dev_watchdog_down(dev);
- while (test_bit(__LINK_STATE_SCHED, &dev->state)) {
- current->policy |= SCHED_YIELD;
- schedule();
- }
+ while (test_bit(__LINK_STATE_SCHED, &dev->state))
+ yield();
spin_unlock_wait(&dev->xmit_lock);
}
diff -uNr linux.orig/net/socket.c linux/net/socket.c
--- linux.orig/net/socket.c Thu Feb 28 21:59:39 2002
+++ linux/net/socket.c Fri Mar 1 10:51:51 2002
@@ -148,8 +148,7 @@
while (atomic_read(&net_family_lockct) != 0) {
spin_unlock(&net_family_lock);
- current->policy |= SCHED_YIELD;
- schedule();
+ yield();
spin_lock(&net_family_lock);
}
diff -uNr linux.orig/net/sunrpc/sched.c linux/net/sunrpc/sched.c
--- linux.orig/net/sunrpc/sched.c Thu Feb 28 21:59:48 2002
+++ linux/net/sunrpc/sched.c Fri Mar 1 10:57:30 2002
@@ -773,8 +773,7 @@
}
if (flags & RPC_TASK_ASYNC)
return NULL;
- current->policy |= SCHED_YIELD;
- schedule();
+ yield();
} while (!signalled());
return NULL;
@@ -1115,8 +1114,7 @@
__rpc_schedule();
if (all_tasks) {
dprintk("rpciod_killall: waiting for tasks to exit\n");
- current->policy |= SCHED_YIELD;
- schedule();
+ yield();
}
}
@@ -1186,8 +1184,7 @@
* wait briefly before checking the process id.
*/
current->sigpending = 0;
- current->policy |= SCHED_YIELD;
- schedule();
+ yield();
/*
* Display a message if we're going to wait longer.
*/
diff -uNr linux.orig/net/unix/af_unix.c linux/net/unix/af_unix.c
--- linux.orig/net/unix/af_unix.c Thu Feb 28 21:59:48 2002
+++ linux/net/unix/af_unix.c Fri Mar 1 10:52:34 2002
@@ -565,10 +565,8 @@
addr->hash)) {
write_unlock(&unix_table_lock);
/* Sanity yield. It is unusual case, but yet... */
- if (!(ordernum&0xFF)) {
- current->policy |= SCHED_YIELD;
- schedule();
- }
+ if (!(ordernum&0xFF))
+ yield();
goto retry;
}
addr->hash ^= sk->type;
[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFC][PATCH] #define yield() for 2.4 scheduler (anticipating O(1))
2002-03-01 16:32 [RFC][PATCH] #define yield() for 2.4 scheduler (anticipating O(1)) Dan Chen
@ 2002-03-01 18:03 ` Davide Libenzi
2002-03-01 18:58 ` Mike Fedyk
1 sibling, 0 replies; 8+ messages in thread
From: Davide Libenzi @ 2002-03-01 18:03 UTC (permalink / raw)
To: Dan Chen; +Cc: linux-kernel
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFC][PATCH] #define yield() for 2.4 scheduler (anticipating O(1))
2002-03-01 16:32 [RFC][PATCH] #define yield() for 2.4 scheduler (anticipating O(1)) Dan Chen
2002-03-01 18:03 ` Davide Libenzi
@ 2002-03-01 18:58 ` Mike Fedyk
2002-03-01 19:03 ` Dan Chen
2002-03-01 21:18 ` Bongani Hlope
1 sibling, 2 replies; 8+ messages in thread
From: Mike Fedyk @ 2002-03-01 18:58 UTC (permalink / raw)
To: Dan Chen; +Cc: linux-kernel
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?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFC][PATCH] #define yield() for 2.4 scheduler (anticipating O(1))
2002-03-01 18:58 ` Mike Fedyk
@ 2002-03-01 19:03 ` Dan Chen
2002-03-01 21:18 ` Bongani Hlope
1 sibling, 0 replies; 8+ messages in thread
From: Dan Chen @ 2002-03-01 19:03 UTC (permalink / raw)
To: Mike Fedyk; +Cc: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 247 bytes --]
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 crimsun@email.unc.edu
GPG key: www.unc.edu/~crimsun/pubkey.gpg.asc
[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFC][PATCH] #define yield() for 2.4 scheduler (anticipating O(1))
2002-03-01 21:18 ` Bongani Hlope
@ 2002-03-01 21:13 ` Rik van Riel
2002-03-02 17:38 ` Dan Chen
2002-03-01 22:28 ` Ken Brownfield
1 sibling, 1 reply; 8+ messages in thread
From: Rik van Riel @ 2002-03-01 21:13 UTC (permalink / raw)
To: Bongani Hlope; +Cc: linux-kernel, Dan Chen
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/
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFC][PATCH] #define yield() for 2.4 scheduler (anticipating O(1))
2002-03-01 18:58 ` Mike Fedyk
2002-03-01 19:03 ` Dan Chen
@ 2002-03-01 21:18 ` Bongani Hlope
2002-03-01 21:13 ` Rik van Riel
2002-03-01 22:28 ` Ken Brownfield
1 sibling, 2 replies; 8+ messages in thread
From: Bongani Hlope @ 2002-03-01 21:18 UTC (permalink / raw)
To: linux-kernel
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.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFC][PATCH] #define yield() for 2.4 scheduler (anticipating O(1))
2002-03-01 21:18 ` Bongani Hlope
2002-03-01 21:13 ` Rik van Riel
@ 2002-03-01 22:28 ` Ken Brownfield
1 sibling, 0 replies; 8+ messages in thread
From: Ken Brownfield @ 2002-03-01 22:28 UTC (permalink / raw)
To: Bongani Hlope; +Cc: linux-kernel
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.
brownfld@irridia.com
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.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFC][PATCH] #define yield() for 2.4 scheduler (anticipating O(1))
2002-03-01 21:13 ` Rik van Riel
@ 2002-03-02 17:38 ` Dan Chen
0 siblings, 0 replies; 8+ messages in thread
From: Dan Chen @ 2002-03-02 17:38 UTC (permalink / raw)
To: Rik van Riel; +Cc: Bongani Hlope, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 465 bytes --]
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 crimsun@email.unc.edu
GPG key: www.unc.edu/~crimsun/pubkey.gpg.asc
[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2002-03-02 17:38 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-03-01 16:32 [RFC][PATCH] #define yield() for 2.4 scheduler (anticipating O(1)) Dan Chen
2002-03-01 18:03 ` Davide Libenzi
2002-03-01 18:58 ` Mike Fedyk
2002-03-01 19:03 ` Dan Chen
2002-03-01 21:18 ` Bongani Hlope
2002-03-01 21:13 ` Rik van Riel
2002-03-02 17:38 ` Dan Chen
2002-03-01 22:28 ` Ken Brownfield
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox