mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Luong Ngo" <luong.ngo@gmail.com>
To: "Sergey Vlasov" <vsu@altlinux.ru>
Cc: "Parav K Pandit" <parav_pandit@mindtree.com>,
	"Robert Hancock" <hancockr@shaw.ca>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	tglx@linutronix.de
Subject: Re: Sleeping thread not receive signal until it wakes up
Date: Sat, 10 Mar 2007 02:54:00 -0800	[thread overview]
Message-ID: <1b2aacd80703100254w35c3420co5318541d336e1708@mail.gmail.com> (raw)
In-Reply-To: <20070310112203.33c638ee.vsu@altlinux.ru>

On 3/10/07, Sergey Vlasov <vsu@altlinux.ru> wrote:
> On Fri, 9 Mar 2007 16:10:29 -0800 Luong Ngo wrote:
>
> > Thanks Parav, adding singal_allow(SIGALRM) wakeup the blocking
> > interruptible_sleep_on and checking the signal_pending would return
> > true now.
>
> This means that there is also a bug in your userspace program -
> somehow when it invokes ioctl(), it has SIGALRM blocked.  Use
> sigprocmask() (or pthread_sigmask() if your program is multithreaded)
> to ensure that SIGALRM is not blocked when you are expecting it to be
> processed.  (Even if your program does not block SIGALRM, it may
> inherit a blocked SIGALRM from another program which have started it,
> so the safest way is to unblock SIGALRM explicitly.)
>
When creating the thread, which would make ioctl call, the parent
thread does not call any sigprocmask so I assume that means none of
the signals is masked. Hence SIGALRM should be received by the thread.
But this did not happen until I call allow_signal explicitly in the
ioctl handler of the driver. I did not call sigprocmask with
SIG_BLOCK.

> Using allow_signal() is needed only if you create a kernel thread and
> want that thread to handle signals.
>
Could the execution of ioctl in the driver be done in a kernel thread
that created to handle the user ioctl request and therefore it needs
allow_signal?


Thanks a lot,
LNgo

  reply	other threads:[~2007-03-10 10:54 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <fa.kb3wuhac4W+1DqK61+sKe9uZwto@ifi.uio.no>
     [not found] ` <fa.cyXmbtXvYymKHdI0rEXZCxyk+KE@ifi.uio.no>
     [not found]   ` <fa.zPDT1vfJF5MjVXXQH/l+YSaLl84@ifi.uio.no>
     [not found]     ` <fa.HmQN7RhZNBRsiJYADMOsY8DL67k@ifi.uio.no>
     [not found]       ` <fa.PDmHwxZ3arhmED5SLuEONyxUlz4@ifi.uio.no>
     [not found]         ` <fa.ygLhZcCLgDxnwAYYVse/Xshr9IE@ifi.uio.no>
2007-03-09  1:10           ` Robert Hancock
2007-03-09  3:24             ` Luong Ngo
2007-03-09  3:45               ` Parav K Pandit
2007-03-10  0:10                 ` Luong Ngo
2007-03-10  8:22                   ` Sergey Vlasov
2007-03-10 10:54                     ` Luong Ngo [this message]
2007-03-07  5:31 Luong Ngo
2007-03-07 13:19 ` linux-os (Dick Johnson)
2007-03-07 19:28   ` Luong Ngo
2007-03-07 20:08     ` linux-os (Dick Johnson)
2007-03-07 21:03       ` Lee Revell
2007-03-08  0:40         ` Luong Ngo
2007-03-08  0:28       ` Luong Ngo
2007-03-08 13:01         ` linux-os (Dick Johnson)
2007-03-08 13:53           ` Thomas Gleixner
2007-03-08 22:52             ` Luong Ngo
2007-03-09 14:58               ` Sergey Vlasov
2007-03-09 19:50                 ` Luong Ngo
2007-03-07 20:20   ` Jan Engelhardt
2007-03-07 18:09 ` Sergey Vlasov

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=1b2aacd80703100254w35c3420co5318541d336e1708@mail.gmail.com \
    --to=luong.ngo@gmail.com \
    --cc=hancockr@shaw.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=parav_pandit@mindtree.com \
    --cc=tglx@linutronix.de \
    --cc=vsu@altlinux.ru \
    /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®