linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* kernel/user.c suggestion
@ 2003-04-23 18:43 bobcook
  0 siblings, 0 replies; only message in thread
From: bobcook @ 2003-04-23 18:43 UTC (permalink / raw)
  To: linux-kernel

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



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-04-23 18:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-23 18:43 kernel/user.c suggestion bobcook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).