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 5 of 9] libxl: only use interactive PyGrub mode w

To: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 5 of 9] libxl: only use interactive PyGrub mode when a console is attached
From: Roger Pau Monné <roger.pau@xxxxxxxxxxxxx>
Date: Tue, 11 Oct 2011 12:45:44 +0200
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Delivery-date: Tue, 11 Oct 2011 03:46:32 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=UtjyK5NzVmuBl+DlGUMXIhdSmTD2F1Q+UvtCOWBtzE8=; b=bdWs/95sZbYlQ0Sg0/0XLooWJQTtaTfmJZWao9c91eqNbFZ4gsy1WiduLVyzjNDi+l cVloblWw5v6yngfYbU48A70fRzA7EviFce32r+nwdMbhNMzxNTWNIXBZmOe1038Shmu6 x87YD3BcDx7cRzoK/zFU6WHIR2nlOz38X92IQ=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1318322434.21903.504.camel@xxxxxxxxxxxxxxxxxxxxxx>
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: <patchbomb.1317386580@loki> <84a27a9f39f29194a734.1317386585@loki> <20109.55057.491612.998568@xxxxxxxxxxxxxxxxxxxxxxxx> <CAPLaKK5AwPnrvfoPdbc8Ap6pyFqiBuvEWfFUmqSeN_-QR-TZQw@xxxxxxxxxxxxxx> <20115.499.220667.547225@xxxxxxxxxxxxxxxxxxxxxxxx> <CAPLaKK7ZBR9twbU=6nt1RXPh0a5uzw_jBRHMi1V4YLVuTxghqA@xxxxxxxxxxxxxx> <1318322434.21903.504.camel@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
2011/10/11 Ian Campbell <Ian.Campbell@xxxxxxxxxx>:
> On Mon, 2011-10-10 at 15:51 +0100, Roger Pau Monné wrote:
>> > That sounds unfortunate.  I agree with you.
>>
>> Well Ian Campbell proposed to use a timeout in select and drop data
>> when the timeout is hit, that what I've implemented in
>>
>> libxl: drop bootloader output if xenconsole file descriptor is not
>> available for writing
>>
>> The patch is quite simple and solves the problem, I don't think it
>> interferes with normal boot process, since a 1s timeout is quite high
>> for data to be delivered from xenconsoled_fd to the user if the
>> console is attached.
>
> The case where a user types
>        xl create /a/domain
>        xl console adomain
>
> might have a reasonably long delay in it before the console is
> connected. Increasing the libxl buffer size would mitigate that but
> you'd still have the problem of not reading from an fd if the cons is !=
> 0.
>
> Can you print out the actual values of the various producers and
> consumers at the point of the hang? (maybe track total bytes too for
> debug?)


The process gets stuck after writing 1022 bytes to xenconsole_fd, and
the buffer is 24 consumed 48 produced (although that varies, sometimes
I get ~700 produced and ~20 consumed, but the total written bits is
1022 always).

> Perhaps where we have:
>        if (xenconsoled_prod == xenconsoled_cons)
>            xenconsoled_prod = xenconsoled_cons = 0;
>        if (bootloader_prod == bootloader_cons)
>            bootloader_prod = bootloader_cons = 0;
> We could also add some suitable memmoves and associated prod/cons
> manipulation, such that the unconsumed data is always pulled to the head
> of the buffer. That might be a reasonably simple way to improve things
> and allow larger buffers to be used? More often than not the memmove
> won't be getting called since either XXX_prod == XXX_cons or XXX_cons is
> already 0, IOW having a partially consumed buffer would be unusual?

I don't really like moving memory around, since it's slow, but I think
implementing a circular buffer would really complicate things. I will
post a new patch that implements the following:

1. Increase buffer.
2. Use memmove to move memory to the head of the buffer and fill it
until the buffer is full.
3. On timeout and full buffer, drop data from the head of the buffer
(older data) and fill it with new data (move the buffer and append new
data at the end).

Do you thing this should be applied to both xenconsoled and
bootloader? since the only one giving problems is xenconsoled.

> Once we have a larger buffer which we always try to fill discarding data
> after a timeout when the buffer is full won't be so critical.

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