22 Apr, 2015

1 commit

  • The hrtimer code is interested whether the added timer is the first
    one to expire and whether the removed timer was the last one in the
    tree. The add/del routines have that information already. So we can
    return it right away instead of reevaluating it at the call site.

    Signed-off-by: Thomas Gleixner
    Acked-by: Peter Zijlstra
    Cc: Preeti U Murthy
    Cc: Viresh Kumar
    Cc: Marcelo Tosatti
    Cc: Frederic Weisbecker
    Cc: John Stultz
    Link: http://lkml.kernel.org/r/20150414203501.579063647@linutronix.de
    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     

09 Oct, 2012

1 commit

  • Empty nodes have no color. We can make use of this property to simplify
    the code emitted by the RB_EMPTY_NODE and RB_CLEAR_NODE macros. Also,
    we can get rid of the rb_init_node function which had been introduced by
    commit 88d19cf37952 ("timers: Add rb_init_node() to allow for stack
    allocated rb nodes") to avoid some issue with the empty node's color not
    being initialized.

    I'm not sure what the RB_EMPTY_NODE checks in rb_prev() / rb_next() are
    doing there, though. axboe introduced them in commit 10fd48f2376d
    ("rbtree: fixed reversed RB_EMPTY_NODE and rb_next/prev"). The way I
    see it, the 'empty node' abstraction is only used by rbtree users to
    flag nodes that they haven't inserted in any rbtree, so asking the
    predecessor or successor of such nodes doesn't make any sense.

    One final rb_init_node() caller was recently added in sysctl code to
    implement faster sysctl name lookups. This code doesn't make use of
    RB_EMPTY_NODE at all, and from what I could see it only called
    rb_init_node() under the mistaken assumption that such initialization was
    required before node insertion.

    [sfr@canb.auug.org.au: fix net/ceph/osd_client.c build]
    Signed-off-by: Michel Lespinasse
    Cc: Andrea Arcangeli
    Acked-by: David Woodhouse
    Cc: Rik van Riel
    Cc: Peter Zijlstra
    Cc: Daniel Santos
    Cc: Jens Axboe
    Cc: "Eric W. Biederman"
    Cc: John Stultz
    Signed-off-by: Stephen Rothwell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michel Lespinasse
     

27 Apr, 2011

1 commit

  • In cases where a timerqueue_node or some structure that utilizes
    a timerqueue_node is allocated on the stack, gcc would give warnings
    caused by the timerqueue_init()'s calling RB_CLEAR_NODE, which
    self-references the nodes uninitialized data.

    The solution is to create an rb_init_node() function that zeros
    the rb_node structure out and then calls RB_CLEAR_NODE(), and
    then call the new init function from timerqueue_init().

    CC: Thomas Gleixner
    Acked-by: Arnd Bergmann
    Signed-off-by: John Stultz

    John Stultz
     

31 Mar, 2011

1 commit


11 Dec, 2010

2 commits