Re: [PATCH] x86: OLPC: speed up device tree creation during boot

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Grant Likely
Date: Wednesday, October 27, 2010 - 3:39 am

On Fri, Oct 22, 2010 at 05:22:47PM -0700, Andres Salomon wrote:

PAGE_SIZE perhaps?


These two hunks should be flipped around so that only one chunk does
the allocation from the pool.  As so:

	/*
	 * To mimimize the number of allocations, grab 4k of memory (that's
	 * an arbitrary choice that matches PAGE_SIZE on the platforms we care
	 * about, and minimizes wasted bootmem) and hand off chunks of it to
	 * callers.
	 */
	if (free_mem < size) {
		free_mem = max(DT_CHUNK_SIZE, size);
		mem = alloc_bootmem(free_mem);
		if (!mem) {
			free_mem = 0;
			return NULL;
		}
		memset(mem, 0, free_mem);
		prom_early_allocated += free_mem;
	}

	res = mem;
	free_mem -= size;
	mem += size;
	return res;

g.
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] x86: OLPC: add OLPC device-tree support (v3), Andres Salomon, (Fri Oct 22, 3:58 pm)
Re: [PATCH] x86: OLPC: speed up device tree creation durin ..., Grant Likely, (Wed Oct 27, 3:39 am)
Re: [PATCH] x86: OLPC: add OLPC device-tree support (v3), Thomas Gleixner, (Wed Oct 27, 6:35 am)
Re: [PATCH] x86: OLPC: add OLPC device-tree support (v3), H. Peter Anvin, (Wed Oct 27, 7:41 am)
Re: [PATCH] x86: OLPC: add OLPC device-tree support (v3), Andres Salomon, (Wed Oct 27, 10:48 am)