mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: Andrew Morton <akpm@osdl.org>
Cc: andrea@suse.de, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Shrink rbtree
Date: Sat, 22 Apr 2006 02:29:44 +0100	[thread overview]
Message-ID: <1145669384.16166.130.camel@shinybook.infradead.org> (raw)
In-Reply-To: <20060421180915.1f2d61a4.akpm@osdl.org>

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


  parent reply	other threads:[~2006-04-22  1:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-21 12:47 David Woodhouse
2006-04-21 13:06 ` Nick Piggin
2006-04-21 19:08   ` David Woodhouse
2006-04-21 20:57     ` Hugh Dickins
2006-04-21 22:12       ` David Woodhouse
2006-04-23 13:03         ` Hugh Dickins
2006-04-21 18:24 ` Zach Brown
2006-04-21 19:06   ` David Woodhouse
2006-04-21 19:25     ` Zach Brown
2006-04-22  1:09 ` Andrew Morton
2006-04-22  1:10   ` Andrew Morton
2006-04-22  1:21     ` Andrew Morton
2006-04-22  1:29   ` David Woodhouse [this message]
2006-04-22 12:29     ` Ingo Oeser
2006-04-22 13:38       ` David Woodhouse
2006-04-22 22:55         ` Ingo Oeser
2006-04-23 16:36   ` Steven Rostedt
2006-04-23 17:20     ` Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1145669384.16166.130.camel@shinybook.infradead.org \
    --to=dwmw2@infradead.org \
    --cc=akpm@osdl.org \
    --cc=andrea@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®