Hi Mathieu, On 8/22/07, Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> wrote:Heh, that's an understatement, as now slub is starting to look a bit like slab... ;-) We need to hide that if-else maze into helper functions for sure. On 8/22/07, Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> wrote: I haven't been following on the cmpxchg_local() discussion too much so the obvious question is: why do we do local_irq_save() for the _has_ cmpxchg() case here... On 8/22/07, Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> wrote: ...and preempt_disable() here? On 8/22/07, Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> wrote: If you move the preempt_enable/local_irq_restore pair outside of the if-else block, you can make a static inline function slob_get_object() that does: static inline bool slob_get_object(struct kmem_cache *c, void **object) { if (have_arch_cmpxchg()) { if (unlikely(cmpxchg_local(&c->freelist, object, object[c->offset]) != object)) return false; } else { c->freelist = object[c->offset]; } return true; } And let the compiler optimize out the branch for the non-cmpxchg case. Same for the reverse case too (i.e. slob_put_object). Pekka -
| Ingo Molnar | [patch 02/13] syslets: add syslet.h include file, user API/ABI definitions |
| Heiko Carstens | Re: 2.6.25-rc6-git6: Reported regressions from 2.6.24 |
| Greg Kroah-Hartman | [PATCH 010/196] Chinese: add translation of Codingstyle |
| Rafael J. Wysocki | [Bug #10629] 2.6.26-rc1-$sha1: RIP __d_lookup+0x8c/0x160 |
git: | |
| Gerrit Renker | [PATCH 0/37] dccp: Feature negotiation - last call for comments |
| Linus Torvalds | Re: [GIT]: Networking |
| Mark Lord | Re: [BUG] New Kernel Bugs |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
