lkml.org 
[lkml]   [2007]   [Oct]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC/PATCH 2/5] rt: list_splice2


    --
    On Tue, 23 Oct 2007, Peter Zijlstra wrote:
    >
    > /**
    > @@ -341,7 +341,13 @@ static inline void __list_splice(struct
    > static inline void list_splice(struct list_head *list, struct list_head *head)
    > {
    > if (!list_empty(list))
    > - __list_splice(list, head);
    > + __list_splice(list, head, head->next);
    > +}
    > +


    > Index: linux-2.6/lib/lock_list.c
    > ===================================================================
    > --- linux-2.6.orig/lib/lock_list.c
    > +++ linux-2.6/lib/lock_list.c
    > @@ -128,7 +128,7 @@ void lock_list_splice_init(struct lock_l
    > lock = __lock_list_reverse(list);
    > if (!list_empty(&list->head)) {
    > spin_lock_nested(&head->lock, LOCK_LIST_NESTING_NEXT);
    > - __list_splice(&list->head, &head->head);
    > + __list_splice(&list->head, &head->head, head->head.next);

    Can't this just now be list_splice and not __list_splice?

    Yes it tests for list_empty again, but that should (hopefully) be
    optimized out.

    -- Steve

    > INIT_LIST_HEAD(&list->head);
    > spin_unlock(&head->lock);
    > }
    >
    > --
    >
    >
    >
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2007-10-23 16:11    [W:0.025 / U:0.040 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site