Re: [RFC][PATCH 0/3] fork: Add the ability to create tasks withgiven pids

From: Tejun Heo
Date: Tue Nov 22 2011 - 10:29:45 EST


On Tue, Nov 22, 2011 at 07:23:12AM -0800, Tejun Heo wrote:
> I think the question should usually be the other way around. Why
> deviate when the deviation doesn't earn any tangible benefit? If you
> think setting it explicitly is justified, explain why in the comment
> of the setter and places where those explicit settings are.

Hmmm... I think I trimmed a bit too much. Let me add back a bit.

So, either just use set_last_pid() or explain in the comment of
set_last_pid() that there are other places which set last_pid but it
won't race because they're synchronized through outer lock and similar
comment where the explicit setting of last_pid is too. As it
currently stands, it really is difficult to find out who else would be
changing last_pid - it's buried in an argument to a proc parse
function. IMHO just using set_last_pid() would be better here.

Thanks.

--
tejun
--
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/