login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
August
»
3
Re: [PATCH 05/25] x86: alloc dyn_array all alltogether
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Johannes Weiner
Subject:
Re: [PATCH 05/25] x86: alloc dyn_array all alltogether
Date: Saturday, August 2, 2008 - 9:16 pm
Hi, Yinghai Lu <yhlu.kernel@gmail.com> writes:
quoted text
> @@ -544,45 +548,78 @@ void __init __weak thread_info_cache_init(void) > void pre_alloc_dyn_array(void) > { > #ifdef CONFIG_HAVE_DYN_ARRAY > - unsigned long size, phys = 0; > + unsigned long total_size = 0, size, phys; > + unsigned long max_align = 1; > struct dyn_array **daa; > + char *ptr; > > + /* get the total size at first */ > for (daa = __dyn_array_start ; daa < __dyn_array_end; daa++) { > struct dyn_array *da = *daa; > > size = da->size * (*da->nr); > - print_fn_descriptor_symbol("dyna_array %s ", da->name); > - printk(KERN_CONT "size:%#lx nr:%d align:%#lx", > + print_fn_descriptor_symbol("dyn_array %s ", da->name);
Is this a correction of a typo you introduced two pages earlier?
quoted text
> + printk(KERN_CONT "size:%#lx nr:%d align:%#lx\n", > da->size, *da->nr, da->align); > - *da->name = __alloc_bootmem_nopanic(size, da->align, phys); > - phys = virt_to_phys(*da->name); > + total_size += roundup(size, da->align); > + if (da->align > max_align) > + max_align = da->align; > + } > + if (total_size) > + printk(KERN_DEBUG "dyn_array total_size: %#lx\n", > + total_size); > + else > + return; > + > + /* allocate them all together */ > + max_align = max_t(unsigned long, max_align, PAGE_SIZE); > + ptr = __alloc_bootmem_nopanic(total_size, max_align, 0); > + if (!ptr) > + panic("Can not alloc dyn_alloc\n");
Uhm... :)
quoted text
> + > + phys = virt_to_phys(ptr); > + for (daa = __dyn_array_start ; daa < __dyn_array_end; daa++) { > + struct dyn_array *da = *daa; > + > + size = da->size * (*da->nr); > + print_fn_descriptor_symbol("dyn_array %s ", da->name); > + > + phys = roundup(phys, da->align); > + *da->name = phys_to_virt(phys); > printk(KERN_CONT " ==> [%#lx - %#lx]\n", phys, phys + size); > > + phys += size; > + > if (da->init_work) > da->init_work(da); > } > #endif > } > > -unsigned long per_cpu_dyn_array_size(void) > +unsigned long per_cpu_dyn_array_size(unsigned long *align) > { > unsigned long total_size = 0; > #ifdef CONFIG_HAVE_DYN_ARRAY > unsigned long size; > struct dyn_array **daa; > + unsigned max_align = 1; > > for (daa = __per_cpu_dyn_array_start ; daa < __per_cpu_dyn_array_end; daa++) { > struct dyn_array *da = *daa; > > size = da->size * (*da->nr); > - print_fn_descriptor_symbol("per_cpu_dyna_array %s ", da->name); > + print_fn_descriptor_symbol("per_cpu_dyn_array %s ", da->name); > printk(KERN_CONT "size:%#lx nr:%d align:%#lx\n", > da->size, *da->nr, da->align); > total_size += roundup(size, da->align); > + if (da->align > max_align) > + max_align = da->align; > } > - if (total_size) > - printk(KERN_DEBUG "per_cpu_dyna_array total_size: %#lx\n", > + if (total_size) { > + printk(KERN_DEBUG "per_cpu_dyn_array total_size: %#lx\n", > total_size);
...
quoted text
> + *align = max_align; > + } > #endif > return total_size; > } > @@ -596,14 +633,11 @@ void per_cpu_alloc_dyn_array(int cpu, char *ptr) > void **array; > > phys = virt_to_phys(ptr); > - > for (daa = __per_cpu_dyn_array_start ; daa < __per_cpu_dyn_array_end; daa++) { > struct dyn_array *da = *daa; > > size = da->size * (*da->nr); > - print_fn_descriptor_symbol("per_cpu_dyna_array %s ", da->name); > - printk(KERN_CONT "size:%#lx nr:%d align:%#lx", > - da->size, *da->nr, da->align); > + print_fn_descriptor_symbol("per_cpu_dyn_array %s ", da->name);
... Hannes --
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH 00/25] dyn_array and nr_irqs support v3
, Yinghai Lu
, (Sat Aug 2, 7:59 pm)
[PATCH 01/25] x86: 64bit support more than 256 irq v2
, Yinghai Lu
, (Sat Aug 2, 7:59 pm)
[PATCH 02/25] x86: remove irq_vectors_limits
, Yinghai Lu
, (Sat Aug 2, 7:59 pm)
[PATCH 03/25] add dyn_array support
, Yinghai Lu
, (Sat Aug 2, 7:59 pm)
[PATCH 04/25] add per_cpu_dyn_array support
, Yinghai Lu
, (Sat Aug 2, 7:59 pm)
[PATCH 05/25] x86: alloc dyn_array all alltogether
, Yinghai Lu
, (Sat Aug 2, 7:59 pm)
[PATCH 06/25] x86: enable dyn_array support
, Yinghai Lu
, (Sat Aug 2, 7:59 pm)
[PATCH 07/25] introduce nr_irqs
, Yinghai Lu
, (Sat Aug 2, 7:59 pm)
[PATCH 08/25] x86: using nr_irqs
, Yinghai Lu
, (Sat Aug 2, 7:59 pm)
[PATCH 09/25] drivers/char to use nr_irqs
, Yinghai Lu
, (Sat Aug 2, 7:59 pm)
[PATCH 10/25] drivers/net to use nr_irqs
, Yinghai Lu
, (Sat Aug 2, 7:59 pm)
[PATCH 11/25] drivers intr remapping to use nr_irqs
, Yinghai Lu
, (Sat Aug 2, 7:59 pm)
[PATCH 12/25] drivers/pcmcia to use nr_irqs
, Yinghai Lu
, (Sat Aug 2, 7:59 pm)
[PATCH 13/25] drivers/rtc to use nr_irqs
, Yinghai Lu
, (Sat Aug 2, 7:59 pm)
[PATCH 14/25] drivers/scsi to use nr_irqs
, Yinghai Lu
, (Sat Aug 2, 7:59 pm)
[PATCH 15/25] drivers/serial to use nr_irqs
, Yinghai Lu
, (Sat Aug 2, 7:59 pm)
[PATCH 16/25] drivers proc to use nr_irqs
, Yinghai Lu
, (Sat Aug 2, 7:59 pm)
[PATCH 17/25] drivers xen events to use nr_irqs
, Yinghai Lu
, (Sat Aug 2, 7:59 pm)
[PATCH 18/25] make irq_timer_state to use dyn_array
, Yinghai Lu
, (Sat Aug 2, 7:59 pm)
[PATCH 19/25] make irq2_iommu to use dyn_array
, Yinghai Lu
, (Sat Aug 2, 7:59 pm)
[PATCH 20/25] make irq_desc to use dyn_array
, Yinghai Lu
, (Sat Aug 2, 7:59 pm)
[PATCH 21/25] serial: change remove NR_IRQS in 8250.c v2
, Yinghai Lu
, (Sat Aug 2, 7:59 pm)
[PATCH 22/25] irq: make irqs in kernel stat use per_cpu_dy ...
, Yinghai Lu
, (Sat Aug 2, 7:59 pm)
[PATCH 23/25] x86: use dyn_array in io_apic_xx.c
, Yinghai Lu
, (Sat Aug 2, 7:59 pm)
[PATCH 24/25] x86: get mp_irqs from madt
, Yinghai Lu
, (Sat Aug 2, 7:59 pm)
[PATCH 25/25] x86: remove nr_irq_vectors
, Yinghai Lu
, (Sat Aug 2, 7:59 pm)
Re: [PATCH 03/25] add dyn_array support
, Johannes Weiner
, (Sat Aug 2, 9:03 pm)
Re: [PATCH 05/25] x86: alloc dyn_array all alltogether
, Johannes Weiner
, (Sat Aug 2, 9:16 pm)
Re: [PATCH 03/25] add dyn_array support
, Yinghai Lu
, (Sat Aug 2, 9:21 pm)
Re: [PATCH 03/25] add dyn_array support
, Johannes Weiner
, (Sat Aug 2, 9:55 pm)
Re: [PATCH 03/25] add dyn_array support
, Yinghai Lu
, (Sat Aug 2, 10:04 pm)
Re: [PATCH 03/25] add dyn_array support
, Johannes Weiner
, (Sat Aug 2, 10:31 pm)
Re: [PATCH 03/25] add dyn_array support
, Yinghai Lu
, (Sat Aug 2, 10:39 pm)
Re: [PATCH 03/25] add dyn_array support
, Yinghai Lu
, (Sat Aug 2, 10:40 pm)
Re: [PATCH 03/25] add dyn_array support
, Johannes Weiner
, (Sat Aug 2, 10:47 pm)
Re: [PATCH 03/25] add dyn_array support
, Yinghai Lu
, (Sat Aug 2, 10:48 pm)
Re: [PATCH 00/25] dyn_array and nr_irqs support v3
, Eric W. Biederman
, (Sat Aug 2, 10:51 pm)
Re: [PATCH 00/25] dyn_array and nr_irqs support v3
, Yinghai Lu
, (Sat Aug 2, 11:04 pm)
Re: [PATCH 00/25] dyn_array and nr_irqs support v3
, Eric W. Biederman
, (Sat Aug 2, 11:39 pm)
Re: [PATCH 00/25] dyn_array and nr_irqs support v3
, Yinghai Lu
, (Sun Aug 3, 1:25 am)
Re: [PATCH 00/25] dyn_array and nr_irqs support v3
, Eric W. Biederman
, (Sun Aug 3, 2:15 am)
Re: [PATCH 15/25] drivers/serial to use nr_irqs
, Alan Cox
, (Sun Aug 3, 6:02 am)
Re: [PATCH 21/25] serial: change remove NR_IRQS in 8250.c v2
, Alan Cox
, (Sun Aug 3, 6:03 am)
Re: [PATCH 21/25] serial: change remove NR_IRQS in 8250.c v2
, Alan Cox
, (Sun Aug 3, 8:14 am)
Re: [PATCH 15/25] drivers/serial to use nr_irqs
, Yinghai Lu
, (Sun Aug 3, 10:43 am)
Re: [PATCH 00/25] dyn_array and nr_irqs support v3
, Yinghai Lu
, (Sun Aug 3, 10:54 am)
Re: [PATCH 00/25] dyn_array and nr_irqs support v3
, Yinghai Lu
, (Sun Aug 3, 12:20 pm)
Re: [PATCH 21/25] serial: change remove NR_IRQS in 8250.c v2
, Eric W. Biederman
, (Sun Aug 3, 12:57 pm)
Re: [PATCH 00/25] dyn_array and nr_irqs support v3
, Yinghai Lu
, (Sun Aug 3, 6:59 pm)
Re: [PATCH 21/25] serial: change remove NR_IRQS in 8250.c v2
, Alan Cox
, (Mon Aug 4, 7:17 am)
Re: [PATCH 00/25] dyn_array and nr_irqs support v3
, Mike Travis
, (Mon Aug 4, 7:31 am)
Re: [PATCH 21/25] serial: change remove NR_IRQS in 8250.c v2
, Yinghai Lu
, (Mon Aug 4, 11:13 am)
Re: [PATCH 21/25] serial: change remove NR_IRQS in 8250.c v2
, Eric W. Biederman
, (Mon Aug 4, 11:51 am)
Re: [PATCH 00/25] dyn_array and nr_irqs support v3
, H. Peter Anvin
, (Tue Aug 5, 4:01 pm)
Re: [PATCH 00/25] dyn_array and nr_irqs support v3
, Yinghai Lu
, (Tue Aug 5, 4:15 pm)
Re: [PATCH 00/25] dyn_array and nr_irqs support v3
, H. Peter Anvin
, (Tue Aug 5, 4:26 pm)
Re: [PATCH 00/25] dyn_array and nr_irqs support v3
, Yinghai Lu
, (Tue Aug 5, 4:53 pm)
[PATCH] serial: Remove NR_IRQS usage
, Alan Cox
, (Wed Aug 6, 6:09 am)
Re: [PATCH] serial: Remove NR_IRQS usage
, Eric W. Biederman
, (Wed Aug 6, 9:10 am)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Michael Trimarchi
Re: [PATCH] VFS: make file->f_pos access atomic on 32bit arch
Miklos Szeredi
[patch 14/15] vfs: more path_permission() conversions
Serge E. Hallyn
Re: [RFC v5][PATCH 7/8] Infrastructure for shared objects
Bernd Schmidt
Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3
Takashi Iwai
[PATCH 2/2] input: Add LED support to Synaptics device
git
:
Junio C Hamano
Re: mingw, windows, crlf/lf, and git
Eyvind Bernhardsen
Re: Where has "git ls-remote" reference pattern matching gone?
Shawn O. Pearce
Re: Switching from CVS to GIT
Todd Zullinger
Re: [PATCH 2/2] send-email: rfc2047-quote subject lines with non-ascii characters
Santi Béjar
Re: How to use git-fmt-merge-msg?
linux-netdev
:
Ramkrishna Vepa
[net-2.6 PATCH 1/10] Neterion: New driver: Driver help file
Mark Anthony
invitation / inquiry
Ingo Molnar
Re: [PATCH 08/16] dma-debug: add core checking functions
David Miller
Re: [PATCH 1/3] f_phonet: dev_kfree_skb instead of dev_kfree_skb_any in TX callback
Sascha Hauer
[PATCH 03/12] fec: do not typedef struct types
git-commits-head
:
Linux Kernel Mailing List
amba: struct device - replace bus_id with dev_name(), dev_set_name()
Linux Kernel Mailing List
MIPS: Yosemite: Convert SMP startup lock to arch spinlock.
Linux Kernel Mailing List
ARM: S5PC100: IRQ and timer
Linux Kernel Mailing List
davinci: edma: clear interrupt status for interrupt enabled channels only
Linux Kernel Mailing List
x86, mm, kprobes: fault.c, simplify notify_page_fault()
openbsd-misc
:
Daniel A. Ramaley
Re: [semi-OT] Can anyone recommend an OpenBSD-compatible colour laser printer?
Matthias Kilian
Re: can't get vesa @ 1280x800 or nv
Tobias Ulmer
Re: Problem after upgrade 4.5 to 4.6: ERR M
Philip Guenther
Re: SIGCHLD and libpthread.so
J.C. Roberts
Re: [semi-OT] Can anyone recommend an OpenBSD-compatible colour laser printer?
Colocation donated by:
Syndicate