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: Jan Beulich <jbeulich@xxxxxxxxxx>, Keir Fraser <Keir.Fraser@xxxxxxxxxxxxx>
Subject: RE: [Xen-devel] page_list_splice
From: Dan Magenheimer <dan.magenheimer@xxxxxxxxxx>
Date: Fri, 6 Mar 2009 16:09:17 +0000 (GMT)
Cc: "Xen-Devel \(E-mail\)" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 06 Mar 2009 08:10:03 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <49B0E876.76E4.0078.0@xxxxxxxxxx>
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
> >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.

Thanks (Keir too) for the confirmation.

> >Anyway, could you take a look at the routine to see if
> 
> 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).

Good feedback.  But I was just adapting the "official" (in
Xen and Linux) list.h list_splice() routine routine which
apparently inserts at the head.  For my usage, head vs
tail doesn't matter.

Thanks,
Dan

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

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