Re: [patch V3 4/7] rtmutex: Siplify remove_waiter()

From: Lai Jiangshan
Date: Mon Jun 09 2014 - 23:31:08 EST


On 06/10/2014 08:53 AM, Steven Rostedt wrote:
> On Mon, 09 Jun 2014 20:28:08 -0000
> Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:
>
>> Exit right away, when the removed waiter was not the top prioriy
>> waiter on the lock. Get rid of the extra indent level.
>>
>> Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
>> ---
>> kernel/locking/rtmutex.c | 26 ++++++++++----------------
>> 1 file changed, 10 insertions(+), 16 deletions(-)
>>
>> Index: tip/kernel/locking/rtmutex.c
>> ===================================================================
>> --- tip.orig/kernel/locking/rtmutex.c
>> +++ tip/kernel/locking/rtmutex.c
>> @@ -780,7 +780,7 @@ static void remove_waiter(struct rt_mute
>> {
>> int first = (waiter == rt_mutex_top_waiter(lock));
>> struct task_struct *owner = rt_mutex_owner(lock);
>> - struct rt_mutex *next_lock = NULL;
>> + struct rt_mutex *next_lock;
>> unsigned long flags;
>>
>> raw_spin_lock_irqsave(&current->pi_lock, flags);
>> @@ -788,28 +788,22 @@ static void remove_waiter(struct rt_mute
>> current->pi_blocked_on = NULL;
>> raw_spin_unlock_irqrestore(&current->pi_lock, flags);
>>
>
> Add comment here, something like...
>
> /*
> * Only update priority if this task was the highest priority
> * task waiting on the lock, and there is an owner to update.
> */
>
> Rest looks good.
>
> Reviewed-by: Steven Rostedt <rostedt@xxxxxxxxxxx>

Reviewed-by: Lai Jiangshan <laijs@xxxxxxxxxxxxxx>

Thanks,
Lai
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/