From: linux@horizon.com
To: gk@garethknight.com, linux-kernel@vger.kernel.org
Cc: ak@suse.de, linux@horizon.com, torvalds@osdl.org
Subject: Re: [PATCH] generic signal code (small new feature - userspace signal mask), kernel 2.6.16
Date: 17 Oct 2006 05:24:10 -0400 [thread overview]
Message-ID: <20061017092410.16731.qmail@science.horizon.com> (raw)
> This is a proposed addition to the linux kernel to reduce the
> overhead required to mask signals. The intended usage is an
> application with critical sections that need to be guarded against
> deadlock by preventing signals from being delivered whilst inside one
> of the critical sections. Currently such applications may be very
> heavy users of the sigprocmask syscall, this proposal provides an
> additional signal mask stored in userspace that can be updated with a
> simple store rather than a syscall.
Wouldn't a simpler solution be to provide a way to cancel signal
delivery after it's hit user-space?
Then user space can keep its own block mask, which is maintained as
a superset of the kernel block mask. Then a critical section would,
in the fast path, proceed like:
- Block signals -> Noted in user-space only
- Do critical section (part 1)
- Do critical section (part 2)
- Unblock signals -> Noted in user-space only
- More code
And if something bad happened
- Block signals -> Noted in user-space only
- Do critical section (part 1)
- Signal arrives
- Test against user-space mask
- Tell kernel about all blocked signals -> Note new kernel mask
- Return "please try again later" from signal handler
- Do critical section (part 2)
- Unblock signals -> Note that it's less than kernel mask
- Tell kernel about newly unblocked signals
- Signal arrives (again)
- Test against user-space mask
- Call registered signal handler
- Return "signal handled"
- More code
This does do the whole signal delivery dance twice if it gets unlucky,
but keeps a conceptually simpler kernel interface.
The one thing that might be complicated is pthread signal delivery.
"Please try again later" could need to go back to the process layer and
immediately re-deliver it to a different thread.
next reply other threads:[~2006-10-17 9:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-17 9:24 linux [this message]
2006-10-17 12:32 ` Gareth Knight
-- strict thread matches above, loose matches on Subject: below --
2006-10-16 3:04 Gareth Knight
2006-10-16 3:37 ` Linus Torvalds
2006-10-16 3:50 ` Gareth Knight
2006-10-16 13:28 ` Andi Kleen
2006-10-16 23:15 ` Nicholas Miell
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=20061017092410.16731.qmail@science.horizon.com \
--to=linux@horizon.com \
--cc=ak@suse.de \
--cc=gk@garethknight.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.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®