svn commit: r204413 - head/sys/kern

Jilles Tjoelker jilles at stack.nl
Sat Feb 27 22:08:56 UTC 2010


On Sat, Feb 27, 2010 at 03:32:49PM +0000, Konstantin Belousov wrote:
> Author: kib
> Date: Sat Feb 27 15:32:49 2010
> New Revision: 204413
> URL: http://svn.freebsd.org/changeset/base/204413

> Log:
>   For kinfo_proc in kp->ki_siglist, return the set of the signals pending
>   in the process queue when gathering information for the process, and set
>   of signals pending for the thread, when gathering information for the
>   thread. Previously, the sysctl returned a union of the process and some
>   arbitrary thread pending set for the process, and union of the process
>   and the thread pending set for the thread.

Although the new way provides maximum information and the old way was
definitely broken for processes, I think the new way may not be what I
expect. In particular, 'ps O pending' and 'ps HO pending' now give
(usually) disjunct answers, even for single-threaded processes. I
suppose these different answers can be useful for kernel debugging, but
it should be documented.

Most interesting stuff will be in the process queue so the change will
not be very noticeable. Signals directed at threads are usually traps
(which do not stay pending very long), pthread_kill() or
SIGEV_THREAD_ID. SIGPIPE and SIGSYS (not from kill/sigqueue) may be
expected to be thread-directed but they are process-directed.

In 7.x, process-directed signals are often delivered directly to a
thread queue, but this usually only happens for signals that will be
delivered right away.

Somewhat related, ki_sigmask could be the logical AND of all threads'
td_sigmask when gathering information for the process, instead of the
td_sigmask of the most recently created thread; fill_kinfo_aggregate()
could handle this.

-- 
Jilles Tjoelker


More information about the svn-src-all mailing list