mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Roman Zippel <zippel@linux-m68k.org>
Cc: Andrew Morton <akpm@osdl.org>,
	tglx@linutronix.de, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 08/13] hrtimer: remove data field
Date: Tue, 14 Feb 2006 00:22:37 +0100	[thread overview]
Message-ID: <20060213232237.GA25449@elte.hu> (raw)
In-Reply-To: <Pine.LNX.4.61.0602132213270.30994@scrub.home>


* Roman Zippel <zippel@linux-m68k.org> wrote:

> On Mon, 13 Feb 2006, Ingo Molnar wrote:
> 
> > > The nanosleep cleanup allows to remove the data field of hrtimer. The 
> > > callback function can use container_of() to get it's own data. Since 
> > > the hrtimer structure is usually embedded in other structures, the 
> > > code also becomes a bit simpler.
> > 
> > i addressed this when you first raised this issue (back in the ktimers 
> > flamewars), and generally the feeling of people i asked was that doing 
> > the container_of() approach is less readable than an explicit 'data' 
> > field. It also deviates from struct timer_list, which we wanted to stay 
> > close to. Furthermore, for standalone hrtimers this creates the need to 
> > generate a wrapper structure. So i dont really like this change - but no 
> > strong feelings either way.
> 
> With the complete size reduction struct hrtimer becomes 32 bytes on 32 
> bits archs and so we can fit the basic hrtimer into one or two cache 
> lines. container_of() is becoming more and more common in the kernel, 
> so I don't know who asked, it's not that difficult to use. I agree it 
> makes simple test modules a bit more difficult, but so far the more 
> common case is that this structure is embedded in other structures and 
> container_of() creates simpler code. Additionally you get type 
> checking for free, which you don't get with a void pointer.

yeah, i agreed with you back then too. (in fact i raised doing the same 
for timer_list, which is embedded in other structs quite frequently too, 
but this thought didnt acquire much traction either.)

But clearly this is not a must-have item for 2.6.16.

	Ingo

      reply	other threads:[~2006-02-13 23:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-13  1:11 Roman Zippel
2006-02-13 13:54 ` Ingo Molnar
2006-02-13 21:22   ` Roman Zippel
2006-02-13 23:22     ` Ingo Molnar [this message]

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=20060213232237.GA25449@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=zippel@linux-m68k.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

Powered by JetHome