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/
Home Products Support Community News


Re: [Xen-devel] [RFC][PATCH] walking the page lists needs the page_alloc

To: "Keir Fraser" <keir.fraser@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [RFC][PATCH] walking the page lists needs the page_alloc lock
From: "Jan Beulich" <JBeulich@xxxxxxxxxx>
Date: Fri, 13 Aug 2010 08:20:00 +0100
Cc: Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 13 Aug 2010 00:19:43 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <C88AAE59.1D986%keir.fraser@xxxxxxxxxxxxx>
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: <4C650B17020000780000FAA2@xxxxxxxxxxxxxxxxxx> <C88AAE59.1D986%keir.fraser@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
>>> On 13.08.10 at 09:10, Keir Fraser <keir.fraser@xxxxxxxxxxxxx> wrote:
> On 13/08/2010 08:06, "Jan Beulich" <JBeulich@xxxxxxxxxx> wrote:
>>>> But then, to avoid a hanging system, these should be trylock-s
>>>> rather than plain locks, shouldn't they?
>>> Why? The handler is called in softirq context. It should be safe to spin.
>> Hmm, indeed. I was looking at others, and at least
>> domain_dump_evtchn_info() also uses a trylock - apparently for
>> no good reason.
> Well, since you wrote that function, would you like me to switch
> domain_dump_evtchn_info() to do a proper spin_lock()?

Yes. I'd want to do a little cleanup to the initial printk()-s at once,
like in the patch below.


Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

--- 2010-08-12.orig/xen/common/event_channel.c
+++ 2010-08-12/xen/common/event_channel.c
@@ -1123,14 +1123,11 @@ static void domain_dump_evtchn_info(stru
     bitmap_scnlistprintf(keyhandler_scratch, sizeof(keyhandler_scratch),
                          d->poll_mask, d->max_vcpus);
-    printk("Domain %d polling vCPUs: {%s}\n",
-           d->domain_id, keyhandler_scratch);
-    if ( !spin_trylock(&d->event_lock) )
-        return;
     printk("Event channel information for domain %d:\n"
-           "    port [p/m]\n", d->domain_id);
+           "Polling vCPUs: {%s}\n"
+           "    port [p/m]\n", d->domain_id, keyhandler_scratch);
+    spin_lock(&d->event_lock);
     for ( port = 1; port < MAX_EVTCHNS(d); ++port )

Xen-devel mailing list