From: Dan Magenheimer Subject: RE: page_list_splice Date: Fri, 6 Mar 2009 16:09:17 +0000 (GMT) Message-ID: <0a3e4e53-2852-4e81-9e9a-45cd50351ff2@default> References: <49B0E876.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=Windows-1252 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <49B0E876.76E4.0078.0@novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jan Beulich , Keir Fraser Cc: "Xen-Devel (E-mail)" List-Id: xen-devel@lists.xenproject.org > >Without this clause, I get a null-pointer (actually null+4)=20 > >dereference... I think I must be missing some basic > >difference between normal list code and page_list code. >=20 > The basic difference is that page_list_head has NULL pointers=20 > when empty, > whereas 'normal' lists heads have pointers to itself. So as=20 > 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 >=20 > 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=20 > 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=20 > 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=20 > splicing to the > beginning is indeed intended I'd favor calling it=20 > 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