[lkml]   [2003]   [Jul]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH]2.6 test1 mm2 user.c race (?)
On Mon, 28 Jul 2003, Andrew Morton wrote:

> <> wrote:
> >
> > + spin_lock(&uidhash_lock);
> > uid_hash_insert(&root_user, uidhashentry(0));
> > + spin_unlock(&uidhash_lock);
> This code runs within an initcall, so it is very unlikely that anything
> will race with us here.
> But SMP is up, and this code gets dropped out of memory later (the
> out-of-line spinlock code doesn't get dropped though).
> So yes, I'd prefer that the locking be there, if only for documentary
> purposes. A /* comment */ which explains why the locking was omitted would
> also be suitabe.

I like the locking better than the comment, I trust the analysis today,
but with SMP and preempt, the lock protects the future (and you may be
missing something even today).

bill davidsen <>
CTO, TMR Associates, Inc
Doing interesting things with little computers since 1979.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:47    [W:0.042 / U:0.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site