Messages in this thread | | | Date | Wed, 11 Feb 2015 13:07:24 -0600 (CST) | From | Christoph Lameter <> | Subject | Re: [PATCH 2/3] slub: Support for array operations |
| |
On Wed, 11 Feb 2015, Jesper Dangaard Brouer wrote:
> > + > > + > > + spin_lock_irqsave(&n->list_lock, flags); > > This is quite an expensive lock with irqsave.
Yes but we take it for all partial pages.
> Yet another lock cost.
Yup the page access is shared but there is one per page. Contention is unlikely.
> > + spin_unlock_irqrestore(&n->list_lock, flags); > > + return allocated; > > I estimate (on my CPU) the locking cost itself is more than 32ns, plus > the irqsave (which I've also found quite expensive, alone 14ns). Thus, > estimated 46ns. Single elem slub fast path cost is 18-19ns. Thus 3-4 > elem bulking should be enough to amortized the cost, guess we are still > good :-)
We can require that interrupt are off when the functions are called. Then we can avoid the "save" part?
| |