Re: Question regarding list_for_each_entry_safe usage inmove_one_task

From: Peter Zijlstra
Date: Mon Sep 09 2013 - 07:15:27 EST


On Mon, Sep 02, 2013 at 02:26:45PM +0800, Lei Wen wrote:
> Hi Peter,
>
> I find one list API usage may not be correct in current fair.c code.
> In move_one_task function, it may iterate through whole cfs_tasks
> list to get one task to move.
>
> But in dequeue_task(), it would delete one task node from list
> without the lock protection. So that we could see from
> list_for_each_entry_safe API definitoin:

Both sites hold the required rq->lock.
--
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/