WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-3.4-testing] Adjust non-default sized console ring

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.4-testing] Adjust non-default sized console ring allocation
From: "Xen patchbot-3.4-testing" <patchbot-3.4-testing@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 03 Sep 2009 05:10:37 -0700
Delivery-date: Thu, 03 Sep 2009 05:15:23 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1251968743 -3600
# Node ID c0263626c810e3bdb496ed0473fbef5d57073ec0
# Parent  19e1a1c5ac1ab82ac2f4c41eff364bbdaeb45c45
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@xxxxxxxxxx>
xen-unstable changeset:   20130:bff9f3e5ad94
xen-unstable date:        Mon Aug 31 09:51:05 2009 +0100
---
 xen/drivers/char/console.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff -r 19e1a1c5ac1a -r c0263626c810 xen/drivers/char/console.c
--- a/xen/drivers/char/console.c        Thu Sep 03 10:05:03 2009 +0100
+++ b/xen/drivers/char/console.c        Thu Sep 03 10:05:43 2009 +0100
@@ -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 = ring;
+    wmb(); /* Allow users of console_force_unlock() to see larger buffer. */
     conring_size = opt_conring_size;
-    conring = ring;
     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)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-3.4-testing] Adjust non-default sized console ring allocation, Xen patchbot-3.4-testing <=