2013-09-10 06:36:13

by Li Bin

[permalink] [raw]
Subject: [PATCH] workqueue: remove redundant timer_stats_timer_set_start_info() call

From: Li Bin <[email protected]>

There is a redundant call for timer_stats_timer_set_start_info(),
because it is the responsibility of the 'timer add' function:

add_timer_on()
|- timer_stats_timer_set_start_info()

add_timer()
|- mod_timer()
|- __mod_timer()
|- timer_stats_timer_set_start_info()

So the calling here is redundant, remove it.

Signed-off-by: Li Bin <[email protected]>
---
kernel/workqueue.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 987293d..51ca50e 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -1462,8 +1462,6 @@ static void __queue_delayed_work(int cpu, struct workqueue_struct *wq,
return;
}

- timer_stats_timer_set_start_info(&dwork->timer);
-
dwork->wq = wq;
dwork->cpu = cpu;
timer->expires = jiffies + delay;
--
1.8.2.1


2013-09-10 13:45:38

by Tejun Heo

[permalink] [raw]
Subject: Re: [PATCH] workqueue: remove redundant timer_stats_timer_set_start_info() call

On Tue, Sep 10, 2013 at 02:35:27PM +0800, Libin wrote:
> From: Li Bin <[email protected]>
>
> There is a redundant call for timer_stats_timer_set_start_info(),
> because it is the responsibility of the 'timer add' function:
>
> add_timer_on()
> |- timer_stats_timer_set_start_info()
>
> add_timer()
> |- mod_timer()
> |- __mod_timer()
> |- timer_stats_timer_set_start_info()
>
> So the calling here is redundant, remove it.

I think it's intentional to record the caller's address so that timers
from delayed_work items can be distinguished.

Thanks.

--
tejun

2013-09-11 00:49:55

by Li Bin

[permalink] [raw]
Subject: Re: [PATCH] workqueue: remove redundant timer_stats_timer_set_start_info() call

On 2013/9/10 21:45, Tejun Heo wrote:
> On Tue, Sep 10, 2013 at 02:35:27PM +0800, Libin wrote:
>> From: Li Bin <[email protected]>
>>
>> There is a redundant call for timer_stats_timer_set_start_info(),
>> because it is the responsibility of the 'timer add' function:
>>
>> add_timer_on()
>> |- timer_stats_timer_set_start_info()
>>
>> add_timer()
>> |- mod_timer()
>> |- __mod_timer()
>> |- timer_stats_timer_set_start_info()
>>
>> So the calling here is redundant, remove it.
>
> I think it's intentional to record the caller's address so that timers
> from delayed_work items can be distinguished.
>

Indeed the case, thank you tejun.
Libin

> Thanks.
>