mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bart Trojanowski <bart@jukie.net>
To: LKML <linux-kernel@vger.kernel.org>
Subject: 'SIG: sigpending lied' on 2.2.14 (Cobalt Networks)
Date: Wed, 6 Jun 2001 15:34:32 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.33.0106061517390.1787-100000@localhost> (raw)


I have been seeing 'SIG: sigpending lied' when I change the current->blocked
value to ignore 'non shutdown' signals.  The messages does not show up on
2.2.16.

Searching with google I found a lot of problems being reported but no
solutions... Is this a 2.2.14 "feature"?  I ask because we have clients
that still rely on the Cobalt build of 2.2.14.

Here is the long explonation...

I have a driver for a device that processes a steady stream of commands to
a PCI device.  The calls come in on an ioctl and are send to the device.
While the command is being processed the user space process sleeps (in the
kernel).  To prevent this sleep from waking up on non threatening
signals (like thread debugging) I added this code...

  #define SHUTDOWN_SIGS \
    (sigmask(SIGKILL) | sigmask(SIGINT) | sigmask(SIGQUIT))

  spin_lock_irqsave(&current->sigmask_lock, irqflags);
  sigset = current->blocked;
  siginitsetinv(&current->blocked, SHUTDOWN_SIGS & ~sigset.sig[0]);
  recalc_sigpending(current);
  spin_unlock_irqrestore(&current->sigmask_lock, irqflags);

It is executed before I put the task on a wait queue and set it's state to
TASK_INTERRUPTIBLE.  After the command is finished the h/w interrupt will
wake up the waitqueue and the task will be set to TASK_RUNNING again.
Finally the following is done to restore the signal state.

  spin_lock_irqsave(&current->sigmask_lock, irqflags);
  current->blocked = sigset;
  recalc_sigpending(current);
  spin_unlock_irqrestore(&current->sigmask_lock, irqflags);

When I comment out these two blocks, or when I switch to 2.2.16 my problem
goes away.

Thanks for reading this far,
Bart.

-- 
	WebSig: http://www.jukie.net/~bart/sig/



                 reply	other threads:[~2001-06-06 19:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.33.0106061517390.1787-100000@localhost \
    --to=bart@jukie.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®