linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH v2 0/7] signal: sigprocmask fixes
@ 2011-04-18 13:44 Oleg Nesterov
  2011-04-18 13:44 ` [PATCH v2 1/7] signal: introduce retarget_shared_pending() Oleg Nesterov
                   ` (8 more replies)
  0 siblings, 9 replies; 90+ messages in thread
From: Oleg Nesterov @ 2011-04-18 13:44 UTC (permalink / raw)
  To: Tejun Heo, Linus Torvalds, Andrew Morton
  Cc: Nikita V. Youshchenko, Matt Fleming, linux-kernel

Andrew, please drop V1:

	signal-introduce-retarget_shared_pending.patch
	signal-retarget_shared_pending-consider-shared-unblocked-signals-only.patch
	signal-sigprocmask-narrow-the-scope-of-sigloc.patch
	signal-sigprocmask-should-do-retarget_shared_pending.patch
	x86-signal-handle_signal-should-use-sigprocmask.patch
	x86-signal-sys_rt_sigreturn-should-use-sigprocmask.patch

Changes in V2:

	- 2/7 change retarget_shared_pending() to accept mask, not ~mask

	- 3/7 is new, it adds the optimization promised in 2/7

	- 4/7 add the small comment about current->blocked as Matt
	      suggested

	- 5/7 add the new helper, set_current_blocked(), suggested
	      by Linus

	- 8/7 is the new and a bit off-topic cleanup, but sys_rt_sigprocmask()
	      looks so annoying

Matt, I didn't dare to keep your reviewed-by tags because of the
changes above, hopefully you can re-ack.

Once again: if we need this, then we need a lot more (trivial) changes
like 6/7 and 7/7. Basically every change of ->blocked should be converted
to use set_current_blocked(). OTOH, perhaps this makes sense by itself.

Oleg.


^ permalink raw reply	[flat|nested] 90+ messages in thread
* Re: [PATCH v2 5/6] signal: sys_sigprocmask() needs retarget_shared_pending()
@ 2011-04-27  1:35 George Spelvin
  2011-04-27  2:00 ` Linus Torvalds
  0 siblings, 1 reply; 90+ messages in thread
From: George Spelvin @ 2011-04-27  1:35 UTC (permalink / raw)
  To: torvalds; +Cc: linux, linux-kernel, oleg

> and notice how you now can do that helper function *WITHOUT* any
> conditionals, and just make it do
> 
>     sigprocmask(&clear, &set, NULL);
> 
> which handles all cases correctly (just "andn clear" + "or set") with
> no if's or switch'es.

Gripe: Arrgh, apostrophe disease!  Linus, youre picking up nasty habits.

Suggestion: Actually, the usual, more flexible implementation, is
"andn mask" + "xor set".  That gives all 4 bit operations (nop, set,
clear, and toggle) unique bit combinations.

Not that it's of any use in many cases, but it has better hack value.

That would convert to:
  switch (how) {
  case SIG_BLOCK:
      mask_bits = new_set;
      set_bits = new_set;
      break;
  case SIG_UNBLOCK:
      mask_bits = new_set;
      set_bits = 0;
      break
  case SIG_SET:
     mask_bits = low_bits | new_set;
     set_bits = new_set;
     break;
   default:
     return -EINVAL;
  }

If you prefer separate set & clear fields, with both set meaning "toggle",
which admittedly is a more elegant representation, then it's
"andn (set|clear)" + "xor set".

^ permalink raw reply	[flat|nested] 90+ messages in thread

end of thread, other threads:[~2011-05-19 19:21 UTC | newest]

Thread overview: 90+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-18 13:44 [RFC PATCH v2 0/7] signal: sigprocmask fixes Oleg Nesterov
2011-04-18 13:44 ` [PATCH v2 1/7] signal: introduce retarget_shared_pending() Oleg Nesterov
2011-04-22 12:04   ` Matt Fleming
2011-04-25 10:49   ` Tejun Heo
2011-04-18 13:45 ` [PATCH v2 2/7] signal: retarget_shared_pending: consider shared/unblocked signals only Oleg Nesterov
2011-04-22 12:22   ` Matt Fleming
2011-04-25 10:52   ` Tejun Heo
2011-04-25 15:20     ` Oleg Nesterov
2011-04-25 16:19       ` Tejun Heo
2011-04-25 17:02         ` Oleg Nesterov
2011-04-25 17:11           ` Tejun Heo
2011-04-26 19:45             ` Oleg Nesterov
2011-04-28 15:26               ` [PATCHSET] signals-review branch Oleg Nesterov
2011-04-30 12:51                 ` Tejun Heo
2011-04-18 13:45 ` [PATCH v2 3/7] signal: retarget_shared_pending: optimize while_each_thread() loop Oleg Nesterov
2011-04-22 12:26   ` Matt Fleming
2011-04-25 11:03   ` Tejun Heo
2011-04-18 13:45 ` [PATCH v2 4/7] signal: sigprocmask: narrow the scope of ->siglock Oleg Nesterov
2011-04-22 12:31   ` Matt Fleming
2011-04-25 11:05   ` Tejun Heo
2011-04-18 13:45 ` [PATCH v2 5/7] signal: sigprocmask() should do retarget_shared_pending() Oleg Nesterov
2011-04-22 12:46   ` Matt Fleming
2011-04-25 11:14   ` Tejun Heo
2011-04-18 13:46 ` [PATCH v2 6/7] x86: signal: handle_signal() should use set_current_blocked() Oleg Nesterov
2011-04-22 13:45   ` Matt Fleming
2011-04-25 11:19   ` Tejun Heo
2011-04-18 13:46 ` [PATCH v2 7/7] x86: signal: sys_rt_sigreturn() " Oleg Nesterov
2011-04-22 14:14   ` Matt Fleming
2011-04-23 18:12     ` Oleg Nesterov
2011-04-25 11:21   ` Tejun Heo
2011-04-18 13:47 ` [PATCH v2 8/7] signal: cleanup sys_rt_sigprocmask() Oleg Nesterov
2011-04-22 14:30   ` Matt Fleming
2011-04-23 18:20     ` Oleg Nesterov
2011-04-23 18:47       ` Matt Fleming
2011-04-25 11:26   ` Tejun Heo
2011-04-18 17:16 ` [RFC PATCH v2 0/7] signal: sigprocmask fixes Linus Torvalds
2011-04-18 17:32   ` Oleg Nesterov
2011-04-18 17:40     ` Linus Torvalds
2011-04-23 17:59       ` [PATCH 0/3] do_sigtimedwait() needs retarget_shared_pending() Oleg Nesterov
2011-04-23 17:59         ` [PATCH 1/3] signal: sys_rt_sigtimedwait: simplify the timeout logic Oleg Nesterov
2011-04-25 11:37           ` Tejun Heo
2011-04-25 17:26             ` Oleg Nesterov
2011-04-25 17:34               ` Linus Torvalds
2011-04-25 17:56                 ` Oleg Nesterov
2011-04-25 19:38                   ` Linus Torvalds
2011-04-26 10:18           ` Matt Fleming
2011-04-23 17:59         ` [PATCH 2/3] signal: introduce do_sigtimedwait() to factor out compat/native code Oleg Nesterov
2011-04-25 11:39           ` Tejun Heo
2011-04-25 11:49           ` Tejun Heo
2011-04-25 15:33             ` Oleg Nesterov
2011-04-25 16:25               ` Tejun Heo
2011-04-26 10:28           ` Matt Fleming
2011-04-23 18:00         ` [PATCH 3/3] signal: do_sigtimedwait() needs retarget_shared_pending() Oleg Nesterov
2011-04-25 11:52           ` Tejun Heo
2011-04-25 16:01             ` Oleg Nesterov
2011-04-25 16:27               ` Tejun Heo
2011-04-25 17:07                 ` Oleg Nesterov
2011-04-25 17:12                   ` Tejun Heo
2011-04-26 10:40                   ` Matt Fleming
2011-04-26 10:42           ` Matt Fleming
2011-04-26 19:48         ` [PATCH v2 0/6] sigtimedwait/sigprocmask need retarget_shared_pending() Oleg Nesterov
2011-04-26 19:48           ` [PATCH v2 1/6] signal: sys_rt_sigtimedwait: simplify the timeout logic Oleg Nesterov
2011-04-26 19:49           ` [PATCH v2 2/6] signal: introduce do_sigtimedwait() to factor out compat/native code Oleg Nesterov
2011-04-27 10:09             ` Tejun Heo
2011-04-27 21:24             ` Matt Fleming
2011-05-11 16:21             ` Mike Frysinger
2011-05-12 18:54               ` Oleg Nesterov
2011-05-13 16:44               ` [PATCH] signal: trivial, fix the "timespec declared inside parameter list" warning Oleg Nesterov
2011-05-13 18:09                 ` Mike Frysinger
2011-05-16 12:57                   ` Oleg Nesterov
2011-05-16 12:57                     ` [PATCH v2] " Oleg Nesterov
2011-05-16 17:39                       ` Mike Frysinger
2011-05-18 23:37                       ` Andrew Morton
2011-05-19 18:19                         ` Oleg Nesterov
2011-05-19 19:21                           ` Mike Frysinger
2011-04-26 19:49           ` [PATCH v2 3/6] signal: do_sigtimedwait() needs retarget_shared_pending() Oleg Nesterov
2011-04-26 19:49           ` [PATCH v2 4/6] signal: cleanup sys_sigprocmask() Oleg Nesterov
2011-04-27 10:12             ` Tejun Heo
2011-04-27 21:31             ` Matt Fleming
2011-04-26 19:50           ` [PATCH v2 5/6] signal: sys_sigprocmask() needs retarget_shared_pending() Oleg Nesterov
2011-04-26 21:43             ` Linus Torvalds
2011-04-27 12:57               ` Oleg Nesterov
2011-04-27 13:04                 ` Tejun Heo
2011-05-01 20:07               ` [PATCH v2 0/1] " Oleg Nesterov
2011-05-01 20:08                 ` [PATCH v2 1/1] " Oleg Nesterov
2011-04-26 19:50           ` [PATCH v2 6/6] signal: rename signandsets() to sigandnsets() Oleg Nesterov
2011-04-27 10:11             ` Tejun Heo
2011-04-27 21:43             ` Matt Fleming
  -- strict thread matches above, loose matches on Subject: below --
2011-04-27  1:35 [PATCH v2 5/6] signal: sys_sigprocmask() needs retarget_shared_pending() George Spelvin
2011-04-27  2:00 ` Linus Torvalds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).