From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: [RFC][PATCH] walking the page lists needs the page_alloc lock Date: Fri, 13 Aug 2010 08:20:00 +0100 Message-ID: <4C650E40020000780000FAB4@vpn.id2.novell.com> References: <4C650B17020000780000FAA2@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: Tim Deegan , "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org >>> On 13.08.10 at 09:10, Keir Fraser wrote: > On 13/08/2010 08:06, "Jan Beulich" wrote: >=20 >>>> But then, to avoid a hanging system, these should be trylock-s >>>> rather than plain locks, shouldn't they? >>>=20 >>> Why? The handler is called in softirq context. It should be safe to = spin. >>=20 >> Hmm, indeed. I was looking at others, and at least >> domain_dump_evtchn_info() also uses a trylock - apparently for >> no good reason. >=20 > 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. Jan Signed-off-by: Jan Beulich --- 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 =20 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); =20 for ( port =3D 1; port < MAX_EVTCHNS(d); ++port ) {