diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2009-08-31 09:51:05 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2009-08-31 09:51:05 +0100 |
commit | 77980d7d07979bdc148d78c4c6b57972c9f65c37 (patch) | |
tree | d4bc242ada90294816fc428f12514dabecd65650 /xen/drivers/char/console.c | |
parent | b05c476cf6595bbdc7017e9c2a683fdd5cf72117 (diff) | |
download | xen-77980d7d07979bdc148d78c4c6b57972c9f65c37.tar.gz xen-77980d7d07979bdc148d78c4c6b57972c9f65c37.tar.bz2 xen-77980d7d07979bdc148d78c4c6b57972c9f65c37.zip |
Adjust non-default sized console ring allocation
Using xmalloc() for objects that are guaranteed to be at least as
large as a page is wasteful, as it will always result in more (here:
double the amount) being allocated.
The other adjustments are more cosmetic:
- Updating conring and conring_size can be done so NMI/MCE generated
messages don't use the new (larger) size with the old (smaller)
buffer.
- The size printed can be in KiB (for the value to be easier to grasp)
since it is always a multiple of the default of 16KiB.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Diffstat (limited to 'xen/drivers/char/console.c')
-rw-r--r-- | xen/drivers/char/console.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c index d5a06e7e23..3f83745d86 100644 --- a/xen/drivers/char/console.c +++ b/xen/drivers/char/console.c @@ -608,7 +608,7 @@ void __init console_init_postirq(void) if ( opt_conring_size < conring_size ) return; - ring = xmalloc_bytes(opt_conring_size); + ring = alloc_xenheap_pages(get_order_from_bytes(opt_conring_size), 0); if ( ring == NULL ) { printk("Unable to allocate console ring of %u bytes.\n", @@ -619,11 +619,12 @@ void __init console_init_postirq(void) spin_lock_irq(&console_lock); for ( i = conringc ; i != conringp; i++ ) ring[i & (opt_conring_size - 1)] = conring[i & (conring_size - 1)]; - conring_size = opt_conring_size; conring = ring; + wmb(); /* Allow users of console_force_unlock() to see larger buffer. */ + conring_size = opt_conring_size; spin_unlock_irq(&console_lock); - printk("Allocated console ring of %u bytes.\n", opt_conring_size); + printk("Allocated console ring of %u KiB.\n", opt_conring_size >> 10); } void __init console_endboot(void) |