Good point. I was figuring that it could disappear when the task
clearly can't be exiting or setuid'ing while forking.
> IMHO you should add a spinlock to user_struct and take it.
> A clear solution that doesn't hurt the common case.
That _is_ a pretty clear solution. It looks like there are grand
plans for struct user, so it might come in handy in the future. But,
a spinlock _will_ hurt the common case. With the atomic incs, we have
2 of them in the common case and, at most, 4 in the failure case.
Adding a spinlock will require more lock instructions, which are the
most costly operations in either a spinlock or atomic op.
Either of these are _incredibly_ small prices to pay in any case.
Forks are slow anyway. A spinlock would be just fine with me.
-- Dave Hansen haveblue@us.ibm.com- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/