Messages in this thread | | | Date | Wed, 4 Mar 2015 15:03:28 +0100 | From | Daniel Wagner <> | Subject | Re: [RFC v1 0/5] fs/locks: Use plain percpu spinlocks instead of lglock to protect file_lock |
| |
On 03/03/2015 01:29 AM, Jeff Layton wrote: >> Hmm, are you sure about that? I read the code this way that when a lock >> is added to flock_list it stays on that CPU. The locks are not moved >> from one flock_list to another during their existent. >> > > Yes, I'm sure. When a file lock is acquired, we assign the fl_link_cpu > to the current CPU and add it to the current CPU's global list. When > the lock is released, any blocked lock that might have been blocking on > it could acquire it at that point, and that doesn't necessarily occur > on the same CPU as where the lock was originally held. > > So, it's entirely possible that between when you drop the spinlock on > one CPU and pick it up on another, the lock could have been released > and then reacquired on a different CPU.
D'oh. I am an idiot. I didn't really understand it the first time. Yes, you are right.
cheers, daniel
| |