* BLK_TN_PROCESS events not delivered for all devices
@ 2013-09-16 9:23 Jan Kara
2013-09-17 14:29 ` Jens Axboe
0 siblings, 1 reply; 5+ messages in thread
From: Jan Kara @ 2013-09-16 9:23 UTC (permalink / raw)
To: axboe; +Cc: LKML
Hi,
I've been looking into a problem where BLK_TN_PROCESS events are not
delivered to all devices which are being traced. This results in process
name being (null) when trace for a single device is parsed.
The reason for this problem is that trace_note_tsk() is called only if
tsk->btrace_seq != blktrace_seq and it updates tsk->btrace_seq to
blktrace_seq. Thus after a trace for another device is started
BLK_TN_PROCESS event is sent only on behalf of the first device with which
the task interacts. That isn't necessarily the new device thus traces for
some devices accumulate several BLK_TN_PROCESS events for one task while
other have none. Is this a known problem and is this intended to work
better?
I was thinking how to fix that for a while and it doesn't seem to be
possible without tracking with each block trace which tasks it has been
notified about. And that is relatively expensive...
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: BLK_TN_PROCESS events not delivered for all devices
2013-09-16 9:23 BLK_TN_PROCESS events not delivered for all devices Jan Kara
@ 2013-09-17 14:29 ` Jens Axboe
2013-09-17 17:10 ` Jan Kara
0 siblings, 1 reply; 5+ messages in thread
From: Jens Axboe @ 2013-09-17 14:29 UTC (permalink / raw)
To: Jan Kara; +Cc: LKML
On 09/16/2013 03:23 AM, Jan Kara wrote:
> Hi,
>
> I've been looking into a problem where BLK_TN_PROCESS events are not
> delivered to all devices which are being traced. This results in process
> name being (null) when trace for a single device is parsed.
>
> The reason for this problem is that trace_note_tsk() is called only if
> tsk->btrace_seq != blktrace_seq and it updates tsk->btrace_seq to
> blktrace_seq. Thus after a trace for another device is started
> BLK_TN_PROCESS event is sent only on behalf of the first device with which
> the task interacts. That isn't necessarily the new device thus traces for
> some devices accumulate several BLK_TN_PROCESS events for one task while
> other have none. Is this a known problem and is this intended to work
> better?
>
> I was thinking how to fix that for a while and it doesn't seem to be
> possible without tracking with each block trace which tasks it has been
> notified about. And that is relatively expensive...
It is unfortunately a known issue... I have not come up with a good way
to fix it either, while keeping it cheap. So if you think of something,
do let me know.
--
Jens Axboe
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: BLK_TN_PROCESS events not delivered for all devices
2013-09-17 14:29 ` Jens Axboe
@ 2013-09-17 17:10 ` Jan Kara
2013-09-17 18:23 ` Jens Axboe
0 siblings, 1 reply; 5+ messages in thread
From: Jan Kara @ 2013-09-17 17:10 UTC (permalink / raw)
To: Jens Axboe; +Cc: Jan Kara, LKML
On Tue 17-09-13 08:29:07, Jens Axboe wrote:
> On 09/16/2013 03:23 AM, Jan Kara wrote:
> > Hi,
> >
> > I've been looking into a problem where BLK_TN_PROCESS events are not
> > delivered to all devices which are being traced. This results in process
> > name being (null) when trace for a single device is parsed.
> >
> > The reason for this problem is that trace_note_tsk() is called only if
> > tsk->btrace_seq != blktrace_seq and it updates tsk->btrace_seq to
> > blktrace_seq. Thus after a trace for another device is started
> > BLK_TN_PROCESS event is sent only on behalf of the first device with which
> > the task interacts. That isn't necessarily the new device thus traces for
> > some devices accumulate several BLK_TN_PROCESS events for one task while
> > other have none. Is this a known problem and is this intended to work
> > better?
> >
> > I was thinking how to fix that for a while and it doesn't seem to be
> > possible without tracking with each block trace which tasks it has been
> > notified about. And that is relatively expensive...
>
> It is unfortunately a known issue... I have not come up with a good way
> to fix it either, while keeping it cheap. So if you think of something,
> do let me know.
Hum... How about linking all running block traces (struct blk_trace) in a
linked list and sending BLK_TN_PROCESS to all the traces? Sure we will be
spamming with BLK_TN_PROCESS a bit but starting a trace isn't such a common
thing so it shouldn't be too bad. What do you think?
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: BLK_TN_PROCESS events not delivered for all devices
2013-09-17 17:10 ` Jan Kara
@ 2013-09-17 18:23 ` Jens Axboe
2013-09-17 20:31 ` Jan Kara
0 siblings, 1 reply; 5+ messages in thread
From: Jens Axboe @ 2013-09-17 18:23 UTC (permalink / raw)
To: Jan Kara; +Cc: LKML
On 09/17/2013 11:10 AM, Jan Kara wrote:
> On Tue 17-09-13 08:29:07, Jens Axboe wrote:
>> On 09/16/2013 03:23 AM, Jan Kara wrote:
>>> Hi,
>>>
>>> I've been looking into a problem where BLK_TN_PROCESS events are not
>>> delivered to all devices which are being traced. This results in process
>>> name being (null) when trace for a single device is parsed.
>>>
>>> The reason for this problem is that trace_note_tsk() is called only if
>>> tsk->btrace_seq != blktrace_seq and it updates tsk->btrace_seq to
>>> blktrace_seq. Thus after a trace for another device is started
>>> BLK_TN_PROCESS event is sent only on behalf of the first device with which
>>> the task interacts. That isn't necessarily the new device thus traces for
>>> some devices accumulate several BLK_TN_PROCESS events for one task while
>>> other have none. Is this a known problem and is this intended to work
>>> better?
>>>
>>> I was thinking how to fix that for a while and it doesn't seem to be
>>> possible without tracking with each block trace which tasks it has been
>>> notified about. And that is relatively expensive...
>>
>> It is unfortunately a known issue... I have not come up with a good way
>> to fix it either, while keeping it cheap. So if you think of something,
>> do let me know.
> Hum... How about linking all running block traces (struct blk_trace) in a
> linked list and sending BLK_TN_PROCESS to all the traces? Sure we will be
> spamming with BLK_TN_PROCESS a bit but starting a trace isn't such a common
> thing so it shouldn't be too bad. What do you think?
That might be good enough. I'm not worried about start/stop type
expenses, those things generally don't matter. And the list wont add any
fast path overhead when tracing.
--
Jens Axboe
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: BLK_TN_PROCESS events not delivered for all devices
2013-09-17 18:23 ` Jens Axboe
@ 2013-09-17 20:31 ` Jan Kara
0 siblings, 0 replies; 5+ messages in thread
From: Jan Kara @ 2013-09-17 20:31 UTC (permalink / raw)
To: Jens Axboe; +Cc: Jan Kara, LKML
On Tue 17-09-13 12:23:33, Jens Axboe wrote:
> On 09/17/2013 11:10 AM, Jan Kara wrote:
> > On Tue 17-09-13 08:29:07, Jens Axboe wrote:
> >> On 09/16/2013 03:23 AM, Jan Kara wrote:
> >>> Hi,
> >>>
> >>> I've been looking into a problem where BLK_TN_PROCESS events are not
> >>> delivered to all devices which are being traced. This results in process
> >>> name being (null) when trace for a single device is parsed.
> >>>
> >>> The reason for this problem is that trace_note_tsk() is called only if
> >>> tsk->btrace_seq != blktrace_seq and it updates tsk->btrace_seq to
> >>> blktrace_seq. Thus after a trace for another device is started
> >>> BLK_TN_PROCESS event is sent only on behalf of the first device with which
> >>> the task interacts. That isn't necessarily the new device thus traces for
> >>> some devices accumulate several BLK_TN_PROCESS events for one task while
> >>> other have none. Is this a known problem and is this intended to work
> >>> better?
> >>>
> >>> I was thinking how to fix that for a while and it doesn't seem to be
> >>> possible without tracking with each block trace which tasks it has been
> >>> notified about. And that is relatively expensive...
> >>
> >> It is unfortunately a known issue... I have not come up with a good way
> >> to fix it either, while keeping it cheap. So if you think of something,
> >> do let me know.
> > Hum... How about linking all running block traces (struct blk_trace) in a
> > linked list and sending BLK_TN_PROCESS to all the traces? Sure we will be
> > spamming with BLK_TN_PROCESS a bit but starting a trace isn't such a common
> > thing so it shouldn't be too bad. What do you think?
>
> That might be good enough. I'm not worried about start/stop type
> expenses, those things generally don't matter. And the list wont add any
> fast path overhead when tracing.
OK, I've sent you a patch which does the trick for me.
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-09-17 20:31 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-16 9:23 BLK_TN_PROCESS events not delivered for all devices Jan Kara
2013-09-17 14:29 ` Jens Axboe
2013-09-17 17:10 ` Jan Kara
2013-09-17 18:23 ` Jens Axboe
2013-09-17 20:31 ` Jan Kara
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox