login
Header Space

 
 

Re: + aio-completion-signal-notification.patch added to -mm tree

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Sebastien Dugue <sebastien.dugue@...>, Laurent Vivier <laurent.vivier@...>
Cc: Zach Brown <zach.brown@...>, Suparna Bhattacharya <suparna@...>, Benjamin LaHaise <bcrl@...>, Ulrich Drepper <drepper@...>, Ingo Molnar <mingo@...>, Thomas Gleixner <tglx@...>, Andrew Morton <akpm@...>, <linux-kernel@...>
Date: Thursday, January 25, 2007 - 12:21 pm

Sebastien Dugue wrote:

We don't need tasklist_lock, we can use rcu_read_lock() instead.


PF_EXITING check is racy and unneded. In fact, it is wrong. If the main
thread is already died, we can only use SIGEV_THREAD_ID signals, because
otherwise good_sigevent() returns ->group_leader.


We should not use sigqueue_free() here. It takes current->sighand->siglock
to remove sigqueue from "struct sigpending". But current is just a "random"
process here.

Yes, if I understand this patch correctly, it is not possible that this
sigqueue is pending, but still this is bad imho.


Oh, this is not nice. Could we change send_sigqueue/send_group_sigqueue
instead ?

-	BUG_ON(!(q->flags & SIGQUEUE_PREALLOC));
+	BUG_ON(!(q->flags & SIGQUEUE_PREALLOC) && q->info.si_code != SI_ASYNCIO);

This way aio can use __sigqueue_alloc/__sigqueue_free directly and forget
about SIGQUEUE_PREALLOC.

On the other hand, imho this patch takes a wrong direction.

The purpose of SIGQUEUE_PREALLOC + send_sigqueue() is to re-use the same
sigqueue while sending a stream of signals. But in aio case we allocate
sigqueue to send only 1 signal, then it freed after the delivery like
the regular sigqueue. So what is the point?

I'd suggest to not use this interface. Just use group_send_sig_info() or
specific_send_sig_info(). Yes, this way we will do GFP_ATOMIC allocation
of sigqueue in interrupt context, but is this so bad in this case?

Oleg.

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: + aio-completion-signal-notification.patch added to -mm ..., Oleg Nesterov, (Thu Jan 25, 12:21 pm)
Re: + aio-completion-signal-notification.patch added to -mm ..., Sébastien Dugué, (Fri Jan 26, 7:14 am)
Re: + aio-completion-signal-notification.patch added to -mm ..., Sébastien Dugué, (Fri Jan 26, 9:05 am)
speck-geostationary