Messages in this thread | | | From | Nick Piggin <> | Subject | Re: RFC: one-bit mutexes (was: Re: [PATCH 2/3] Memory management livelock) | Date | Sat, 11 Oct 2008 23:06:17 +1100 |
| |
On Monday 06 October 2008 09:11, Mikulas Patocka wrote: > Hi > > I removed the repeated code and create a new bit mutexes. They are > space-efficient mutexes that consume only one bit. See the next 3 patches.
Pretty reasonable to have.
> If you are concerned about the size of an inode, I can convert other > mutexes to bit mutexes: i_mutex and inotify_mutex.
I wouldn't worry for now. mutexes can be unlocked much faster than bit mutexes, especially in the fastpath. And due to slab, it would be unlikely to actually save any space.
> I could also create > bit_spinlock (one-bit spinlock that uses test_and_set_bit) and save space > for address_space->tree_lock, address_space->i_mmap_lock, > address_space->private_lock, inode->i_lock.
We have that already. It is much much faster to unlock spinlocks than bit spinlocks in general (if you own the word exclusively, then it's not, but then you would be less likely to save space), and we can also do proper FIFO ticket locks with a larger word.
> Look at it and say what you think about the idea of condensing mutexes > into single bits.
Looks pretty good to me.
| |