[OpenAFS-devel] Very simple patch for libafs CPU hog on signal

Derek Atkins warlord@MIT.EDU
29 Jan 2002 10:24:54 -0500


Nickolai Zeldovich <kolya@MIT.EDU> writes:

> There's another alternative, which is the patch I sent to this list
> in response to your original message; it both avoids the CPU hog
> problem and doesn't lose signals, so regardless of whether the code
> will later be changed to be interruptible, or not, it'll be useful.

Actually, your patch _can_ lose signals if they happen _inside_
the sleep().  For example:

 save_signals           <-- save an "empty" sigset
 sleep                  <-- signal comes in here
 restore_signals        <-- restore the empty sigset, thereby losing
                            the signal that came in above.

I don't know if the Linux kernel can or will deliver a signal
during the interruptible_sleep_on(), but you might want to check
anyways and perhaps "merge" the sigsets, if you can.

-derek

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord@MIT.EDU                        PGP key available