lkml.org 
[lkml]   [2007]   [Feb]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [patch 05/11] syslets: core code
Ingo Molnar a écrit :
> + if (unlikely(signal_pending(t) || need_resched()))
> + goto stop;
>

So, this is how you'll prevent me from running an infinite loop ;-)
The attached patch adds a cond_resched() instead, to allow infinite
loops without DoS. I dropped the unlikely() as it's already in the
definition of signal_pending().

> +asmlinkage long sys_async_wait(unsigned long min_wait_events)
>

Here I would expect:

sys_async_wait_for_all(struct syslet_atom *atoms, long nr_atoms)

and

sys_async_wait_for_any(struct syslet_atom *atoms, long nr_atoms).

This way syslets can be used by different parts of a program without
having them waiting for each other.

Thanks.

--
Guillaume

--- linux-2.6/kernel/async.c
+++ linux-2.6/kernel/async.c
@@ -433,9 +433,10 @@

last_uatom = uatom;
ret = __exec_atom(t, &atom);
- if (unlikely(signal_pending(t) || need_resched()))
+ if (signal_pending(t))
goto stop;

+ cond_resched();
uatom = next_uatom(&atom, uatom, ret);
if (uatom)
goto run_next;


\
 
 \ /
  Last update: 2007-02-14 13:45    [W:1.120 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site