Re: [PATCH] sched: At sched_fork use __set_task_cpu().

From: Rakib Mullick
Date: Wed Feb 01 2012 - 12:07:18 EST


On Wed, Feb 1, 2012 at 7:55 PM, Peter Zijlstra <a.p.zijlstra@xxxxxxxxx> wrote:
> On Tue, 2012-01-31 at 14:18 +0530, Kamalesh Babulal wrote:
>> * Rakib Mullick <rakib.mullick@xxxxxxxxx> [2012-01-29 22:34:37]:
>>
>> >  We don't use select_task_rq() from sched_fork() anymore and no chance of task gets migrated at
>> > this point. Therefore, we can avoid task migration related checking/accounting, so use
>> > __set_task_cpu() instead of set_task_cpu().
>> >
>> > Signed-off-by: Rakib Mullick <rakib.mullick@xxxxxxxxx>
>>   Reviewed-by: Kamalesh Babulal <kamalesh@xxxxxxxxxxxxxxxxxx>
>
> Since we call sched_fork() with preemption enabled _long_ after the
> child is copied from the parent who is to say we (parent) didn't migrate
> away and are now setting a different cpu?
>
If parent gets migrated that should be accounted as parents migration
count not for child offcourse. And if we're counting child's
nr_migration count for parent's getting migrated, we're simply
screwing childs migration count. Isn't it?

> One could argue that that might not be a real migration from the child's
> POV, maybe, but nobody seems to be making that argument.
>
But I'm not seeing it from child's or parent's POV. I'm simply
addressing the point of a task's migration counter
(p->se.nr_migrations), simply this task wasn't moved.

> I really don't see the point of this..
>
I'm hoping, you'll rethink...

Thanks,
Rakib
--
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/