Cc: Andrew Morton <akpm@...>, Austin Clements <amdragon+kernelbugzilla@...>, Ingo Molnar <mingo@...>, john stultz <johnstul@...>, Michael Kerrisk <mtk.manpages@...>, Roland McGrath <roland@...>, Thomas Gleixner <tglx@...>, <linux-kernel@...>
Yes, this is another reason for a separate patch.
Initially, I did
q->flags |= SIGQUEUE_CANCELLED;
spin_lock_irqsave(lock, flags);
q->flags &= ~SIGQUEUE_PREALLOC;
to document the fact that SIGQUEUE_CANCELLED can be set lockless, but
then "optimized" the code, couldn't help myself... Besides, the code
above looks really confusing without the fat comment.
Another reason. We are losing the control over "q" here, I don't think
we can have other flags which should be preserved once we set _CANCELLED
and cleared _PREALLOC.
But yes, I agree, this is not a good practice. I'd leave the patch as is
at least for now but I don't mind to redo and resend. Fortunately, this
falls to the "cleanup" category.
Oleg.
--