lkml.org 
[lkml]   [2008]   [Feb]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/3] Consolidate send_sigqueue and send_group_sigqueue
On 02/28, Thomas Gleixner wrote:
>
> On Fri, 22 Feb 2008, Oleg Nesterov wrote:
> > > -
> > > - if (unlikely(!list_empty(&q->list))) {
> > > - /*
> > > - * If an SI_TIMER entry is already queue just increment
> > > - * the overrun count.
> > > - */
> > > - BUG_ON(q->info.si_code != SI_TIMER);
> > > - q->info.si_overrun++;
> > > - goto out;
> > > - }
> > > - /* Short-circuit ignored signals. */
> > > - if (sig_ignored(p, sig)) {
> > > - ret = 1;
> > > - goto out;
> > > - }
>
> > > send_group_sigqueue(int sig, struct sigqueue *q, struct task_struct *p)
>
> > > - /* Short-circuit ignored signals. */
> > > - if (sig_ignored(p, sig)) {
> > > - ret = 1;
> > > - goto out;
> > > - }
> > > -
> > > - if (unlikely(!list_empty(&q->list))) {
> > > - /*
> > > - * If an SI_TIMER entry is already queue just increment
> > > - * the overrun count. Other uses should not try to
> > > - * send the signal multiple times.
> > > - */
> > > - BUG_ON(q->info.si_code != SI_TIMER);
> > > - q->info.si_overrun++;
> > > - goto out;
> > > - }
> >
> > Personally, I think this change is very good. But send_sigqueue() and
> > send_group_sigqueue() have a very subtle difference which I was never
> > able to understand.
> >
> > Let's suppose that sigqueue is already queued, and the signal is ignored
> > (the latter means we should re-schedule cpu timer or handle overrruns).
> > In that case send_sigqueue() returns 0, but send_group_sigqueue() returns 1.
> >
> > I think this is not the problem (in fact, I think this patch makes the
> > behaviour more correct), but I hope Thomas can take a look and confirm.
>
> It should not change anything. We should never have a signal enqueued
> when it's ignored anyway.

Well, it _is_ possible. Suppose that the signal is both ignored and blocked.
Now, if the task unblocks the signal, it could be ignored, queued, and
sig_ignored() == T.

But yes, I think you are right, this can't change anything. I just wanted
to be sure there is no subtle reason to prefer one way or another.

> Roland, any insight why this is different aside of a copy and paste
> error ?

I guess this was the reason for the difference.

Oleg.



\
 
 \ /
  Last update: 2008-02-28 07:21    [W:0.079 / U:0.680 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site