From: Thomas Gleixner <tglx@linutronix.de>
To: Al Viro <viro@ftp.linux.org.uk>
Cc: Linus Torvalds <torvalds@osdl.org>,
linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC] timers, pointers to functions and type safety
Date: Sat, 02 Dec 2006 15:45:12 +0100 [thread overview]
Message-ID: <1165070713.24604.50.camel@localhost.localdomain> (raw)
In-Reply-To: <20061202140521.GJ3078@ftp.linux.org.uk>
On Sat, 2006-12-02 at 14:05 +0000, Al Viro wrote:
> On Sat, Dec 02, 2006 at 01:59:30PM +0100, Thomas Gleixner wrote:
> > On Fri, 2006-12-01 at 17:21 +0000, Al Viro wrote:
> > > Now, there's another question: how do we get there? Or, at least, from
> > > current void (*)(unsigned long) to void (*)(void *)...
> >
> > I think the real solution should be
> >
> > void (*function)(struct timer_list *timer);
> >
> > and hand the timer itself to the callback. Most of the timers are
> > embedded into data structures anyway and for the rest we can easily
> > build one.
>
> Ewwwwwww....
>
> Let's not. It means more cruft in callbacks for no good reason.
What's the cruft ?
struct bla = container_of(timer, struct bla, timer); ???
> And more cruft in code setting it up, while we are at it.
Err, you remove the timer->data = (unsigned long) hackery. Why is this
adding cruft ?
I looked deeper into it. We have following timer usage:
- timers which don't use data at all - no change except for the callback
argument of the function.
- timers which point to the data structure which embedds them - only the
callback has to get a container_of()
- static single instance timers, which use .data as local storage for
some value. That can be done with a simple static variable near the
timer and using that variable instead of .data
- some rather seldom multi instance timers, which need then to become a
data structure.
> > > "A fscking huge patch flipping everything at once" is obviously not an
> > > answer; too much PITA merging and impossible to review.
> >
> > There are ~ 500 files affected and this is in the range of cleanups we
> > did recently at the end of the merge window already. I'd volunteer to
> > hack this up and keep the patch up to date until the final merge. I have
> > done that before and I'm not scared about it. The patches are a couple
> > of lines per file and I do not agree that this is impossible to review.
>
> I'd rather see that as patch series, TYVM. And no, it won't be a couple
> of lines per file with your variant.
It will. Just some random files:
arch/alpha/kernel/srmcons.c | 7 +++--
arch/arm/mach-pxa/lubbock.c | 7 +++--
arch/i386/kernel/tsc.c | 2 -
arch/i386/mach-voyager/voyager_thread.c | 2 -
arch/ia64/kernel/mca.c | 8 +++---
arch/ia64/kernel/salinfo.c | 2 -
arch/ia64/sn/kernel/mca.c | 2 -
arch/ia64/sn/kernel/xpc_channel.c | 3 --
arch/ia64/sn/kernel/xpc_main.c | 5 +++-
arch/mips/lasat/picvue_proc.c | 2 -
arch/mips/sgi-ip22/ip22-reset.c | 17 +++++++------
include/asm-ia64/sn/xpc.h | 2 -
> Anyway, I'm doing that series in my tree, will post when it's over...
Same here :)
tglx
next prev parent reply other threads:[~2006-12-02 14:42 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-01 17:21 [RFC] timers, pointers to functions and type safety Al Viro
2006-12-02 6:29 ` Daniel Berlin
2006-12-02 12:36 ` Al Viro
2006-12-02 9:23 ` Kyle Moffett
2006-12-02 12:42 ` Al Viro
2006-12-02 20:53 ` Kyle Moffett
2006-12-02 10:47 ` Arnd Bergmann
2006-12-02 12:59 ` Thomas Gleixner
2006-12-02 14:05 ` Al Viro
2006-12-02 14:45 ` Thomas Gleixner [this message]
2006-12-02 16:02 ` Matthew Wilcox
2006-12-02 18:06 ` Thomas Gleixner
2006-12-02 18:19 ` Al Viro
2006-12-02 18:27 ` Thomas Gleixner
2006-12-02 18:40 ` Al Viro
2006-12-02 18:48 ` Al Viro
2006-12-02 21:43 ` Roman Zippel
2006-12-02 21:59 ` Al Viro
2006-12-02 22:13 ` Roman Zippel
2006-12-02 22:40 ` Al Viro
2006-12-02 23:06 ` Roman Zippel
2006-12-03 10:21 ` Pavel Machek
2006-12-03 11:27 ` Russell King
2006-12-03 15:21 ` Roman Zippel
2006-12-03 21:01 ` Pavel Machek
2006-12-03 22:52 ` Roman Zippel
2006-12-03 23:15 ` Pavel Machek
2006-12-04 11:14 ` David Howells
2006-12-04 12:16 ` Russell King
2006-12-04 13:03 ` David Howells
2006-12-04 13:29 ` Russell King
2006-12-04 14:17 ` David Howells
2006-12-04 14:22 ` Russell King
2006-12-04 11:48 ` Ingo Molnar
2006-12-04 12:22 ` David Howells
2006-12-06 0:24 ` Al Viro
2006-12-06 10:20 ` David Howells
2006-12-12 9:59 ` Ingo Molnar
2006-12-02 21:32 ` Roman Zippel
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=1165070713.24604.50.camel@localhost.localdomain \
--to=tglx@linutronix.de \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
--cc=viro@ftp.linux.org.uk \
/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