lkml.org 
[lkml]   [2016]   [Oct]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 2/3] sched: Introduce Window-Assisted CPU utilization Tracking
On 2016-10-28 00:46, Peter Zijlstra wrote:
> On Fri, Oct 28, 2016 at 12:10:41AM -0700, Vikram Mulukutla wrote:
>> +void walt_finish_migrate(struct task_struct *p, struct rq *dest_rq,
>> bool locked)
>> +{
>> + u64 wallclock;
>> + unsigned long flags;
>> +
>> + if (!p->on_rq && p->state != TASK_WAKING)
>> + return;
>> +
>> + if (locked == false)
>> + raw_spin_lock_irqsave(&dest_rq->lock, flags);
>> +
>
>> +
>> + if (locked == false)
>> + raw_spin_unlock_irqrestore(&dest_rq->lock, flags);
>> +}
>> +
>> +void walt_prepare_migrate(struct task_struct *p, struct rq *src_rq,
>> bool locked)
>> +{
>> + u64 wallclock;
>> + unsigned long flags;
>> +
>> + if (!p->on_rq && p->state != TASK_WAKING)
>> + return;
>> +
>> + if (locked == false)
>> + raw_spin_lock_irqsave(&src_rq->lock, flags);
>> +
>
>> +
>> + if (locked == false)
>> + raw_spin_unlock_irqrestore(&src_rq->lock, flags);
>> +}
>
> Seriously bad style that. Please, less bonghits before writing code.

This was my bad personal attempt at eliminating double-locking from the
original code.
This was pointed out earlier and shall go away once I can come up with a
way to merge
this into enqeue/dequeue sans bonghits :-)

\
 
 \ /
  Last update: 2016-10-28 10:04    [W:0.046 / U:24.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site