[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] fix page_list_splice()


  • To: Jan Beulich <JBeulich@xxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxx>
  • From: Keir Fraser <keir@xxxxxxx>
  • Date: Wed, 06 Jun 2012 10:02:12 +0100
  • Cc: Jisoo Yang <jisooy@xxxxxxxxx>
  • Delivery-date: Wed, 06 Jun 2012 09:02:42 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>
  • Thread-index: Ac1Dww9rlU/aMLekvkacNJmqutiRlA==
  • Thread-topic: [Xen-devel] [PATCH] fix page_list_splice()

On 06/06/2012 09:23, "Jan Beulich" <JBeulich@xxxxxxxx> wrote:

> Other than in __list_splice(), the first element's prev pointer doesn't
> need adjustment here - it already is PAGE_LIST_NULL. Rather than fixing
> the assignment (to formally match __list_splice()), simply assert that
> this assignment is really unnecessary.
>
> Reported-by: Jisoo Yang <jisooy@xxxxxxxxx>
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> 
> --- a/xen/include/xen/mm.h
> +++ b/xen/include/xen/mm.h
> @@ -270,7 +270,8 @@ page_list_splice(struct page_list_head *
>      last = list->tail;
>      at = head->next;
>  
> -    first->list.prev = page_to_pdx(head->next);
> +    /* Both first->list.prev and at->list.prev are PAGE_LIST_NULL. */

ASSERT(first->list.prev == PAGE_LIST_NULL); ?

It seems odd to have one assumption encoded as an ASSERTion, and one as a
code comment... A second assertion makes the assumption explicit, and
run-time checked in debug builds.

 -- Keir

> +    ASSERT(first->list.prev == at->list.prev);
>      head->next = first;
>  
>      last->list.next = page_to_pdx(at);
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxx
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.