lkml.org 
[lkml]   [2014]   [Jul]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
SubjectRe: [RFC 2/7] hrtimer: don't check for active hrtimer after adding it
From
On 9 July 2014 16:04, Chris Redpath <Chris.Redpath@arm.com> wrote:
> On 09/07/14 07:55, Viresh Kumar wrote:
>> diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
>> index cf40209..a76f962 100644
>> --- a/kernel/hrtimer.c
>> +++ b/kernel/hrtimer.c
>> @@ -1555,8 +1555,6 @@ static int __sched do_nanosleep(struct
>> hrtimer_sleeper *t, enum hrtimer_mode mod
>> do {
>> set_current_state(TASK_INTERRUPTIBLE);
>> hrtimer_start_expires(&t->timer, mode);
>> - if (!hrtimer_active(&t->timer))
>> - t->task = NULL;
>>
>> if (likely(t->task))
>> freezable_schedule();
>> @@ -1837,8 +1835,6 @@ schedule_hrtimeout_range_clock(ktime_t *expires,
>> unsigned long delta,
>> hrtimer_init_sleeper(&t, current);
>>
>> hrtimer_start_expires(&t.timer, mode);
>> - if (!hrtimer_active(&t.timer))
>> - t.task = NULL;
>>
>> if (likely(t.task))
>> schedule();
>>
>
> Maybe safe to remove this if condition too.


Included following diff to this patch:

diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index a76f962..ae7b5cf 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -1556,8 +1556,7 @@ static int __sched do_nanosleep(struct
hrtimer_sleeper *t, enum hrtimer_mode mod
set_current_state(TASK_INTERRUPTIBLE);
hrtimer_start_expires(&t->timer, mode);

- if (likely(t->task))
- freezable_schedule();
+ freezable_schedule();

hrtimer_cancel(&t->timer);
mode = HRTIMER_MODE_ABS;
@@ -1836,8 +1835,7 @@ schedule_hrtimeout_range_clock(ktime_t *expires,
unsigned long delta,

hrtimer_start_expires(&t.timer, mode);

- if (likely(t.task))
- schedule();
+ schedule();

hrtimer_cancel(&t.timer);
destroy_hrtimer_on_stack(&t.timer);


Latest changes are pushed to my branch in case someone is looking to
test them.


\
 
 \ /
  Last update: 2014-07-13 06:43    [W:0.078 / U:26.416 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site