lkml.org 
[lkml]   [2006]   [Apr]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    SubjectRe: [PATCH] Shrink rbtree
    From
    Date
    On Fri, 2006-04-21 at 18:09 -0700, Andrew Morton wrote:
    > #define HRTIMER_INACTIVE ((void *)1UL)

    Ah. That's newer than the kernel I tested on. Your patch isn't going to
    make kernel/hrtimer.c compile though, surely? Let's do it the same way
    everyone else marks off-tree nodes -- by setting its parent pointer to
    point to itself....

    diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
    index 306acf1..7d2a1b9 100644
    --- a/include/linux/hrtimer.h
    +++ b/include/linux/hrtimer.h
    @@ -127,7 +127,7 @@ #endif

    static inline int hrtimer_active(const struct hrtimer *timer)
    {
    - return timer->node.rb_parent != HRTIMER_INACTIVE;
    + return rb_parent(&timer->node) != &timer->node;
    }

    /* Forward a hrtimer so it expires after now: */
    diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
    index d2a7296..04ab27d 100644
    --- a/kernel/hrtimer.c
    +++ b/kernel/hrtimer.c
    @@ -393,7 +393,7 @@ static void __remove_hrtimer(struct hrti
    if (base->first == &timer->node)
    base->first = rb_next(&timer->node);
    rb_erase(&timer->node, &base->active);
    - timer->node.rb_parent = HRTIMER_INACTIVE;
    + rb_set_parent(&timer->node, &timer->node);
    }

    /*
    @@ -578,7 +578,7 @@ void hrtimer_init(struct hrtimer *timer,
    clock_id = CLOCK_MONOTONIC;

    timer->base = &bases[clock_id];
    - timer->node.rb_parent = HRTIMER_INACTIVE;
    + rb_set_parent(&timer->node, &timer->node);
    }

    /**
    --
    dwmw2

    -
    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: 2006-04-22 03:32    [W:3.510 / U:0.076 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site