lkml.org 
[lkml]   [2003]   [Apr]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subjectkernel/user.c suggestion
Date
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/

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