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-devel

Re: [Xen-devel] [PATCH 03/11] Xen: Rename the balloon lock

To: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 03/11] Xen: Rename the balloon lock
From: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Date: Tue, 12 May 2009 11:47:15 +0900
Cc: Ingo Molnar <mingo@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, the arch/x86 maintainers <x86@xxxxxxxxxx>, Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>, Linux Kernel Mailing List <linux-kernel@xxxxxxxxxxxxxxx>
Delivery-date: Mon, 11 May 2009 19:47:46 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4A0875C7.7070305@xxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1241732737-7669-1-git-send-email-jeremy@xxxxxxxx> <1241732737-7669-4-git-send-email-jeremy@xxxxxxxx> <20090508020123.GE25512%yamahata@xxxxxxxxxxxxx> <4A0875C7.7070305@xxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.6i
On Mon, May 11, 2009 at 12:00:23PM -0700, Jeremy Fitzhardinge wrote:
> Isaku Yamahata wrote:
> >Hi. Please please don't move the arch common variable
> >into x86 specific file. It causes link error on ia64.
> >
> >Before I sent the patches to fix it twice or so,
> >but it seems to be dropped.
> >  
> 
> Sorry, I can't seem to find them.  Could you resend?
> 
> I guess there's the larger issue of whether the 
> xen_create_contiguous_region() code is also useful on ia64.  It seems to 
> me the options are:
> 
>    * it is, so we should move the code somewhere common (along with the
>      lock)
>    * it isn't so ia64 will have its own version (in which case it can
>      define its own version of the lock without much impact)
>    * or we could move the lock anyway, but there's no very obvious
>      place to put it
> 

I see now the issue. My choice at the moment is the last option.
The copyright notice was taken from drivers/xen/balloon.c.
I don't have strong opinion about the place, so feel free to move it
as long as it is linked on IA64.

Non-pv_ops ia64 xen kernel has its own xen_create_contiguous_region().
But I suppose the code can be consolidated if you accept sprinkle some
if (xen_feature(XENFEAT_auto_translated_physmap)), so I'm willing to work on
the first option once the x86 pv_ops dom0 is stabilized/committed.

thanks,

commit 2017dc931ca350eaad9cacd97e74b9c2eb4990b9
Author: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Date:   Tue May 12 11:22:05 2009 +0900

    Impact: link fix on ia64
    
    Move the variable, xen_reservation_lock, to common place.
    IA64 also needs it.
    
    Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>

diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index 360e546..e25a78e 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -65,13 +65,6 @@
 
 #define MMU_UPDATE_HISTO       30
 
-/*
- * Protects atomic reservation decrease/increase against concurrent increases.
- * Also protects non-atomic updates of current_pages and driver_pages, and
- * balloon lists.
- */
-DEFINE_SPINLOCK(xen_reservation_lock);
-
 #ifdef CONFIG_XEN_DEBUG_FS
 
 static struct {
diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
index ff8accc..ec6ddab 100644
--- a/drivers/xen/Makefile
+++ b/drivers/xen/Makefile
@@ -1,4 +1,4 @@
-obj-y  += grant-table.o features.o events.o manage.o
+obj-y  += grant-table.o features.o events.o manage.o reslock.o
 obj-y  += xenbus/
 
 obj-$(CONFIG_HOTPLUG_CPU)      += cpu_hotplug.o
diff --git a/drivers/xen/reslock.c b/drivers/xen/reslock.c
new file mode 100644
index 0000000..cfe0638
--- /dev/null
+++ b/drivers/xen/reslock.c
@@ -0,0 +1,36 @@
+/******************************************************************************
+ * revlock.c
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this source file (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy, modify,
+ * merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <linux/spinlock.h>
+
+/*
+ * Protects atomic reservation decrease/increase against concurrent increases.
+ * Also protects non-atomic updates of current_pages and driver_pages, and
+ * balloon lists.
+ */
+DEFINE_SPINLOCK(xen_reservation_lock);


-- 
yamahata

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