All of lore.kernel.org
 help / color / mirror / Atom feed
From: Randy Dunlap <randy.dunlap@oracle.com>
To: Yasunori Goto <y-goto@jp.fujitsu.com>
Cc: linux-mm@kvack.org
Subject: Re: [PATCH]Re: build error: sparsemem + SLOB
Date: Mon, 20 Nov 2006 09:02:47 -0800	[thread overview]
Message-ID: <4561DFB7.5090108@oracle.com> (raw)
In-Reply-To: <20061120201955.97DB.Y-GOTO@jp.fujitsu.com>

Yasunori Goto wrote:
>>   LD      .tmp_vmlinux1
>> mm/built-in.o: In function `sparse_index_init':
>> sparse.c:(.text.sparse_index_init+0x19): undefined reference to `slab_is_available'
>> make: *** [.tmp_vmlinux1] Error 1
>>
>>
>> mm/sparse.c: line 35 uses slab_is_available() but SLAB=n, SLOB=y.
> 
> 
> Hmm.
> To be honest, I don't know that embedded people would like to use sparsemem.
> mem_section[] array might be too big for them.
> But, they may expect reduce power consumption of memory by memory hotplug.
> 
> Anyway, this is fix.

Acked-by: Randy Dunlap <randy.dunlap@oracle.com>

> ------------
> This patch is to fix compile error when SLOB is on with sparsemem.
> 
>   LD      .tmp_vmlinux1
> mm/built-in.o: In function `sparse_index_init':
> sparse.c:(.text.sparse_index_init+0x19): undefined reference to `slab_is_available'
> make: *** [.tmp_vmlinux1] Error 1
> 
> mm/sparse.c: line 35 uses slab_is_available() but SLAB=n, SLOB=y.
> 
> This patch is for 2.6.19-rc5-mm2.
> 
> 
> Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com>
> 
> ------------
>  include/linux/slab.h |    9 +++++++++
>  mm/slob.c            |    4 ++++
>  mm/sparse.c          |    2 +-
>  3 files changed, 14 insertions(+), 1 deletion(-)
> 
> Index: 19-rc5-mm2/include/linux/slab.h
> ===================================================================
> --- 19-rc5-mm2.orig/include/linux/slab.h	2006-11-17 15:21:10.000000000 +0900
> +++ 19-rc5-mm2/include/linux/slab.h	2006-11-20 19:07:20.000000000 +0900
> @@ -210,6 +210,8 @@ static inline void *kcalloc(size_t n, si
>  	return kzalloc(n * size, flags);
>  }
>  
> +#define kmem_is_available() slab_is_available()
> +
>  extern void kfree(const void *);
>  extern unsigned int ksize(const void *);
>  extern int slab_is_available(void);
> @@ -260,6 +262,13 @@ extern void kmem_set_shrinker(kmem_cache
>  #else /* CONFIG_SLOB */
>  
>  /* SLOB allocator routines */
> +extern int slob_initialized;
> +
> +#define kmem_is_available() slob_is_available()
> +static inline int slob_is_available(void)
> +{
> +	return slob_initialized;
> +}
>  
>  void kmem_cache_init(void);
>  struct kmem_cache *kmem_cache_create(const char *c, size_t, size_t,
> Index: 19-rc5-mm2/mm/slob.c
> ===================================================================
> --- 19-rc5-mm2.orig/mm/slob.c	2006-11-17 15:20:47.000000000 +0900
> +++ 19-rc5-mm2/mm/slob.c	2006-11-20 18:37:10.000000000 +0900
> @@ -61,6 +61,8 @@ static DEFINE_SPINLOCK(block_lock);
>  
>  static void slob_free(void *b, int size);
>  
> +int slob_initialized= 0;
> +
>  static void *slob_alloc(size_t size, gfp_t gfp, int align)
>  {
>  	slob_t *prev, *cur, *aligned = 0;
> @@ -337,4 +339,6 @@ void kmem_cache_init(void)
>  		free_page((unsigned long)p);
>  
>  	mod_timer(&slob_timer, jiffies + HZ);
> +	slob_initialized = 1;
> +
>  }
> Index: 19-rc5-mm2/mm/sparse.c
> ===================================================================
> --- 19-rc5-mm2.orig/mm/sparse.c	2006-11-17 15:21:10.000000000 +0900
> +++ 19-rc5-mm2/mm/sparse.c	2006-11-20 16:20:56.000000000 +0900
> @@ -50,7 +50,7 @@ static struct mem_section *sparse_index_
>  	unsigned long array_size = SECTIONS_PER_ROOT *
>  				   sizeof(struct mem_section);
>  
> -	if (slab_is_available())
> +	if (kmem_is_available())
>  		section = kmalloc_node(array_size, GFP_KERNEL, nid);
>  	else
>  		section = alloc_bootmem_node(NODE_DATA(nid), array_size);
> 
> 


-- 
~Randy

--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2006-11-20 17:02 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-20  5:05 build error: sparsemem + SLOB Randy Dunlap
2006-11-20 11:22 ` [PATCH]Re: " Yasunori Goto
2006-11-20 17:02   ` Randy Dunlap [this message]
2006-11-20 17:03 ` Christoph Lameter
2006-11-20 17:08   ` Randy Dunlap
2006-11-20 17:28   ` Hugh Dickins
2006-11-20 18:36     ` Matt Mackall
2006-11-21  5:57       ` Yasunori Goto
2006-11-21  6:59         ` Randy Dunlap
2006-11-21 13:34         ` Hugh Dickins
2006-11-21 19:14         ` Matt Mackall
2006-11-21 19:32           ` Christoph Lameter
2006-11-21 19:29             ` Matt Mackall
2006-11-21 19:54           ` Hugh Dickins
2006-11-20 21:22     ` Christoph Lameter
2006-11-21 13:31       ` Hugh Dickins

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4561DFB7.5090108@oracle.com \
    --to=randy.dunlap@oracle.com \
    --cc=linux-mm@kvack.org \
    --cc=y-goto@jp.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.