* Re: linux-next: Tree for February 25 (mm/slub.c) [not found] <20110225175924.a95d616d.sfr@canb.auug.org.au> @ 2011-02-25 18:52 ` Randy Dunlap 2011-02-26 19:10 ` [PATCH] slub: fix ksize() build error Mariusz Kozlowski 0 siblings, 1 reply; 5+ messages in thread From: Randy Dunlap @ 2011-02-25 18:52 UTC (permalink / raw) To: Stephen Rothwell, linux-mm; +Cc: linux-next, LKML On Fri, 25 Feb 2011 17:59:24 +1100 Stephen Rothwell wrote: > Hi all, > > Changes since 20110224: when CONFIG_SLUB_DEBUG is not enabled: mm/slub.c:2728: error: implicit declaration of function 'slab_ksize' --- ~Randy *** Remember to use Documentation/SubmitChecklist when testing your code *** -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] slub: fix ksize() build error 2011-02-25 18:52 ` linux-next: Tree for February 25 (mm/slub.c) Randy Dunlap @ 2011-02-26 19:10 ` Mariusz Kozlowski 2011-02-26 22:39 ` Randy Dunlap 2011-02-27 5:32 ` David Rientjes 0 siblings, 2 replies; 5+ messages in thread From: Mariusz Kozlowski @ 2011-02-26 19:10 UTC (permalink / raw) To: Randy Dunlap Cc: Stephen Rothwell, Eric Dumazet, linux-next, linux-mm, linux-kernel, Mariusz Kozlowski mm/slub.c: In function 'ksize': mm/slub.c:2728: error: implicit declaration of function 'slab_ksize' slab_ksize() needs to go out of CONFIG_SLUB_DEBUG section. Signed-off-by: Mariusz Kozlowski <mk@lab.zgora.pl> --- Maybe something like this? Compile tested for slub debug enabled/disabled. mm/slub.c | 48 ++++++++++++++++++++++++------------------------ 1 files changed, 24 insertions(+), 24 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index 217b5b5..ea6f039 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -281,6 +281,30 @@ static inline int slab_index(void *p, struct kmem_cache *s, void *addr) 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 struct kmem_cache_order_objects oo_make(int order, unsigned long size) { @@ -797,30 +821,6 @@ static inline int slab_pre_alloc_hook(struct kmem_cache *s, gfp_t flags) return should_failslab(s->objsize, flags, s->flags); } -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 void slab_post_alloc_hook(struct kmem_cache *s, gfp_t flags, void *object) { flags &= gfp_allowed_mask; -- 1.7.0.4 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] slub: fix ksize() build error 2011-02-26 19:10 ` [PATCH] slub: fix ksize() build error Mariusz Kozlowski @ 2011-02-26 22:39 ` Randy Dunlap 2011-02-27 5:32 ` David Rientjes 1 sibling, 0 replies; 5+ messages in thread From: Randy Dunlap @ 2011-02-26 22:39 UTC (permalink / raw) To: Mariusz Kozlowski Cc: Stephen Rothwell, Eric Dumazet, linux-next, linux-mm, linux-kernel On 02/26/11 11:10, Mariusz Kozlowski wrote: > mm/slub.c: In function 'ksize': > mm/slub.c:2728: error: implicit declaration of function 'slab_ksize' > > slab_ksize() needs to go out of CONFIG_SLUB_DEBUG section. > > Signed-off-by: Mariusz Kozlowski <mk@lab.zgora.pl> Acked-by: Randy Dunlap <randy.dunlap@oracle.com> Thanks. > --- > Maybe something like this? Compile tested for slub debug enabled/disabled. > > mm/slub.c | 48 ++++++++++++++++++++++++------------------------ > 1 files changed, 24 insertions(+), 24 deletions(-) > > diff --git a/mm/slub.c b/mm/slub.c > index 217b5b5..ea6f039 100644 > --- a/mm/slub.c > +++ b/mm/slub.c > @@ -281,6 +281,30 @@ static inline int slab_index(void *p, struct kmem_cache *s, void *addr) > 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 struct kmem_cache_order_objects oo_make(int order, > unsigned long size) > { > @@ -797,30 +821,6 @@ static inline int slab_pre_alloc_hook(struct kmem_cache *s, gfp_t flags) > return should_failslab(s->objsize, flags, s->flags); > } > > -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 void slab_post_alloc_hook(struct kmem_cache *s, gfp_t flags, void *object) > { > flags &= gfp_allowed_mask; -- ~Randy *** Remember to use Documentation/SubmitChecklist when testing your code *** -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] slub: fix ksize() build error 2011-02-26 19:10 ` [PATCH] slub: fix ksize() build error Mariusz Kozlowski 2011-02-26 22:39 ` Randy Dunlap @ 2011-02-27 5:32 ` David Rientjes 2011-02-27 10:07 ` Pekka Enberg 1 sibling, 1 reply; 5+ messages in thread From: David Rientjes @ 2011-02-27 5:32 UTC (permalink / raw) To: Mariusz Kozlowski Cc: Randy Dunlap, Stephen Rothwell, Eric Dumazet, linux-next, linux-mm, linux-kernel On Sat, 26 Feb 2011, Mariusz Kozlowski wrote: > mm/slub.c: In function 'ksize': > mm/slub.c:2728: error: implicit declaration of function 'slab_ksize' > > slab_ksize() needs to go out of CONFIG_SLUB_DEBUG section. > > Signed-off-by: Mariusz Kozlowski <mk@lab.zgora.pl> Acked-by: David Rientjes <rientjes@google.com> -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] slub: fix ksize() build error 2011-02-27 5:32 ` David Rientjes @ 2011-02-27 10:07 ` Pekka Enberg 0 siblings, 0 replies; 5+ messages in thread From: Pekka Enberg @ 2011-02-27 10:07 UTC (permalink / raw) To: David Rientjes Cc: Mariusz Kozlowski, Randy Dunlap, Stephen Rothwell, Eric Dumazet, linux-next, linux-mm, linux-kernel, Christoph Lameter Hi, [ Please CC me for slab allocator patches in the future. ] On Sun, Feb 27, 2011 at 7:32 AM, David Rientjes <rientjes@google.com> wrote: > On Sat, 26 Feb 2011, Mariusz Kozlowski wrote: > >> mm/slub.c: In function 'ksize': >> mm/slub.c:2728: error: implicit declaration of function 'slab_ksize' >> >> slab_ksize() needs to go out of CONFIG_SLUB_DEBUG section. >> >> Signed-off-by: Mariusz Kozlowski <mk@lab.zgora.pl> > > Acked-by: David Rientjes <rientjes@google.com> Applied, thanks! Pekka -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-02-27 10:07 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <20110225175924.a95d616d.sfr@canb.auug.org.au> 2011-02-25 18:52 ` linux-next: Tree for February 25 (mm/slub.c) Randy Dunlap 2011-02-26 19:10 ` [PATCH] slub: fix ksize() build error Mariusz Kozlowski 2011-02-26 22:39 ` Randy Dunlap 2011-02-27 5:32 ` David Rientjes 2011-02-27 10:07 ` Pekka Enberg
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).