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] page_list_splice

To: "Dan Magenheimer" <dan.magenheimer@xxxxxxxxxx>
Subject: Re: [Xen-devel] page_list_splice
From: "Jan Beulich" <jbeulich@xxxxxxxxxx>
Date: Fri, 06 Mar 2009 08:10:14 +0000
Cc: "Xen-Devel \(E-mail\)" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 06 Mar 2009 00:10:42 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <f6f7b32a-8772-4dd7-ba39-7a726020e24f@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: <f6f7b32a-8772-4dd7-ba39-7a726020e24f@default>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
>>> Dan Magenheimer <dan.magenheimer@xxxxxxxxxx> 05.03.09 21:23 >>>
>Without this clause, I get a null-pointer (actually null+4) 
>dereference... I think I must be missing some basic
>difference between normal list code and page_list code.

The basic difference is that page_list_head has NULL pointers when empty,
whereas 'normal' lists heads have pointers to itself. So as Keir already
stated, yes, the second conditional is needed.

>Anyway, could you take a look at the routine to see if
>I've missed something obvious in the case where neither
>page_list parameter is empty?  It's tough to reproduce
>this condition and you might be able to see a bug
>on inspection.  (Or maybe the differences between normal
>list code and page_list code require the extra
>page_list_empty check and this code will work properly
>regardless of whether one or both page_list is empty.)

The one question I would have is whether you indeed intend this to be
an insertion at the head of the list - inserting at the tail would seem
more natural. The 'normal' list accessors allow doing this by simply
passing &head->prev as the second argument, but since the page lists
aren't symmetric this cannot be done that way by the invoking code (and
hence a suffix-less version of page_list_splice() would seem to more
naturally splice to the end of the existing list, while if splicing to the
beginning is indeed intended I'd favor calling it page_list_splice_head()
or some such).

Jan


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

<Prev in Thread] Current Thread [Next in Thread>