From: Pekka Enberg Date: Fri, 11 Mar 2011 16:10:45 +0000 (+0200) Subject: Merge branch 'slab/rcu' into slab/next X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c9149556756d56c68451a4a8735c37e7062fd3d7;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git Merge branch 'slab/rcu' into slab/next Conflicts: mm/slub.c --- c9149556756d56c68451a4a8735c37e7062fd3d7 diff --cc mm/slub.c index ea6f0390996f,ebba3eb19369..e841d8921c22 --- a/mm/slub.c +++ b/mm/slub.c @@@ -281,35 -281,16 +281,40 @@@ static inline int slab_index(void *p, s return (p - addr) / s->size; } +static inline size_t slab_ksize(const struct kmem_cache *s) +{ +#ifdef CONFIG_SLUB_DEBUG + /* + * Debugging requires use of the padding between object + * and whatever may come after it. + */ + if (s->flags & (SLAB_RED_ZONE | SLAB_POISON)) + return s->objsize; + +#endif + /* + * If we have the need to store the freelist pointer + * back there or track user information then we can + * only use the space before that information. + */ + if (s->flags & (SLAB_DESTROY_BY_RCU | SLAB_STORE_USER)) + return s->inuse; + /* + * Else we can use all the padding etc for the allocation + */ + return s->size; +} + + static inline int order_objects(int order, unsigned long size, int reserved) + { + return ((PAGE_SIZE << order) - reserved) / size; + } + static inline struct kmem_cache_order_objects oo_make(int order, - unsigned long size) + unsigned long size, int reserved) { struct kmem_cache_order_objects x = { - (order << OO_SHIFT) + (PAGE_SIZE << order) / size + (order << OO_SHIFT) + order_objects(order, size, reserved) }; return x;