[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7c86c4470908101401k49f42788o25eb1efaa631f065@mail.gmail.com>
Date: Mon, 10 Aug 2009 23:01:36 +0200
From: stephane eranian <eranian@...glemail.com>
To: Oleg Nesterov <oleg@...hat.com>
Cc: Jamie Lokier <jamie@...reable.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>, mingo@...e.hu,
linux-kernel@...r.kernel.org, tglx@...utronix.de,
robert.richter@....com, paulus@...ba.org, andi@...stfloor.org,
mpjohn@...ibm.com, cel@...ibm.com, cjashfor@...ibm.com,
mucci@...s.utk.edu, terpstra@...s.utk.edu,
perfmon2-devel@...ts.sourceforge.net, mtk.manpages@...glemail.com,
roland@...hat.com
Subject: Re: F_SETOWN_TID: F_SETOWN was thread-specific for a while
On Mon, Aug 10, 2009 at 7:03 PM, Oleg Nesterov<oleg@...hat.com> wrote:
> On 08/10, stephane eranian wrote:
>>
>> You must use F_SETSIG on SIGIO if you want your signal handler to
>> receive the file descriptor in siginfo. This is useful if you want to perform
>> some actions on the descriptor. That is the case in perfmon and this is
>> the case in certain situations with perfcounters as well.
>>
>> Setting SA_SIGINFO provides siginfo, but the si_fd field is NOT set
>> correctly without F_SETSIG. I have verified this with perfcounters, and
>> this is indeed the case.
>>
>> This behavior seems kind of odd to me.
>
> Agreed, this looks a bit odd. But at least this is documented. From
> man 2 fcntl:
>
> By using F_SETSIG with a nonzero value, and setting SA_SIGINFO for the
> signal handler (see sigac- tion(2)), extra information about I/O events
> is passed to the handler in a siginfo_t structure. If the si_code
> field indicates the source is SI_SIGIO, the si_fd field gives the file
> descriptor associated with the event. Otherwise, there is no indication
> which file descriptors are pending,
>
> Not sure if it is safe to change the historical behaviour.
>
Don't need to change it.
But for SIGIO, if you see SA_SIGINFO, then pass the si_fd.
>From Jamie, it seems F_SETSIG was not added just for this file descriptor trick.
The initial goal seems orthogonal to the file descriptor passing in si_fd.
> (the manpage is not exactly right though, and the comment in send_sigio_to_task()
> is not right too: SI_SIGIO (and, btw, SI_QUEUE/SI_DETHREAD) is never used).
>
> Oleg.
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists