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] xen-4.1: PV domain hanging at startup, jiffies stopped

To: Dan Magenheimer <dan.magenheimer@xxxxxxxxxx>
Subject: Re: [Xen-devel] xen-4.1: PV domain hanging at startup, jiffies stopped
From: Marek Marczykowski <marmarek@xxxxxxxxxxxx>
Date: Wed, 31 Aug 2011 22:49:45 +0200
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, Rafal Wojtczuk <rafal@xxxxxxxxxxxxxxxxxxxxxx>, Joanna Rutkowska <joanna@xxxxxxxxxxxxxxxxxxxxxx>, Konrad Wilk <konrad.wilk@xxxxxxxxxx>
Delivery-date: Wed, 31 Aug 2011 13:50:17 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1d3855c2-56be-4ea7-8e14-52157afd69ff@default>
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: <4E5A3F0A.8060700@xxxxxxxxxxxx> <20110829200749.GA17265@xxxxxxxxxxxx> <4E5BF4C3.2050108@xxxxxxxxxxxx> <20110829205938.GB18697@xxxxxxxxxxxx> <4E5D1B57.7040106@xxxxxxxxxxxx 4E5E610A.1010501@xxxxxxxxxxxx> <1d3855c2-56be-4ea7-8e14-52157afd69ff@default>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110621 Fedora/3.1.11-1.fc14 Lightning/1.0b3pre Thunderbird/3.1.11
On 31.08.2011 22:00, Dan Magenheimer wrote:
>>> I've tried also xenpm set-max-cstate 0 and tsc_mode=1 in domU config,
>>> but it doesn't help. Also pinning vcpu doesn't help (this domUs have
>>> only 1 vcpu). Is 'xenpm set-max-cstate 0' the same as booting xen with
>>> max_cstate=0?
>>
>> Looks like tsc_mode=2 solves the problem.
> 
> It's unlikely that it SOLVES the problem, but only changes
> timings so that it effectively works around whatever the real
> problem is.

Some additional information I've found during debugging this problem:
clockevent_program_event returns -ETIME:
------------ kernel/time/clockevents.c:
/**
 * clockevents_program_event - Reprogram the clock event device.
 * @expires:    absolute expiry time (monotonic clock)
 *
 * Returns 0 on success, -ETIME when the event is in the past.
 */
int clockevents_program_event(struct clock_event_device *dev, ktime_t
expires,
                  ktime_t now)
-------------

xen_vcpuop_set_next_event schedules event by getting current time
(xen_clocksource_read()) (*1) adding delta (expires-now) and programming
event with VCPUOP_set_singleshot_timer hypercall. Then xen gets current
time (*2) and in some rare cases this time is after expected timer
expiration... Even after VCPUOP_set_singleshot_timer hypercal,
xen_clocksource_read() reports time slightly in the past comparing to
xen time (reported by NOW() macro).

I think this is because "current" time is calculated different way in *1
and *2. The *1 way is controlled by tsc_mode, which is described here:
http://lxr.xensource.com/lxr/source/docs/misc/tscmode.txt. Default
tsc_mode=0 is "smart" and I think because of that can be slightly before
NOW() time. tsc_mode=2 looks almost the same as NOW() macro works.

Is this reasoning correct?

-- 
Pozdrawiam / Best Regards,
Marek Marczykowski         | RLU #390519
marmarek at mimuw edu pl   | xmpp:marmarek at staszic waw pl

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

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