* Davide Libenzi <davidel@xmailserver.org> wrote:

> > If this is going to be a generic AIO subsystem:
> > 
> > - Cancellation of peding request
> 
> What about the busy_async_threads list becoming a hash/rb_tree indexed 
> by syslet_atom ptr. A cancel would lookup the thread and send a signal 
> (of course, signal handling of the async threads should be set 
> properly)?

well, each async syslet has a separate TID at the moment, so if we want 
a submitted syslet to be cancellable then we could return the TID of the 
syslet handler (instead of the NULL) in sys_async_exec(). Then 
user-space could send a signal the old-fashioned way, via sys_tkill(), 
if it so wishes.

the TID could also be used in a sys_async_wait_on() API. I.e. it would 
be a natural, readily accessible 'cookie' for the pending work. TIDs can 
be looked up lockless via RCU, so it's reasonably fast as well.

( Note that there's already a way to 'signal' pending syslets: do_exit() 
  in the user context will signal all async contexts (which results in 
  -EINTR of currently executing syscalls, wherever possible) and will 
  tear them down. But that's too crude for aio_cancel() i guess. )

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

Reply via email to