kernel/user.c suggestion

bobcook@gsaix2.cc.gasou.edu
Wed, 23 Apr 2003 14:55:37 US/Eastern


lxr.linux.no/source/kernel/user.c?v=2.5.56#L81

81 struct user_struct * alloc_uid(uid_t uid)
82 {
83 struct list_head *hashent = uidhashentry(uid);
84 struct user_struct *up;
85
86 spin_lock(&uidhash_lock);
87 up = uid_hash_find(uid, hashent);
88 spin_unlock(&uidhash_lock);


The code uses a hash table with multiple chains to reduce search time but then
uses a single lock for the whole table??

Suggest one lock per chain for better concurrency so code mod would be
spin_lock(&uidhash_lock[hashent])

Bob Cook

---------------------------------------------
This message was sent using GSWeb Mail Services.
http://www.gasou.edu/gsumail

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