lkml.org 
[lkml]   [2009]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 2/6] epoll keyed wakeups v2 - introduce new *_poll() wakeup macros
On Tue, 3 Feb 2009, Davide Libenzi wrote:

> On Tue, 3 Feb 2009, Andrew Morton wrote:
>
> > On Sun, 01 Feb 2009 12:04:23 -0800 Davide Libenzi <davidel@xmailserver.org> wrote:
> >
> > > +#define wake_up_nested_poll(x, m, s) \
> > > +do { \
> > > + unsigned long flags; \
> > > + \
> > > + spin_lock_irqsave_nested(&(x)->lock, flags, (s)); \
> > > + wake_up_locked_poll(x, m); \
> > > + spin_unlock_irqrestore(&(x)->lock, flags); \
> > > +} while (0)
> >
> > I had to go and find the callsite to work out the type of `x' :(
> >
> > - this macro can be passed the address of any structure which has a
> > `spinlock_t lock;' in it, which seems strange.
> >
> > - It references its first arg three times.
> >
> > Is there any reason why we can't implement this in C?
>
> I don't see any reason why these two couldn't be normal functions (I
> just referenced wake_up_nested(), that was a macro in the first place).

Actually reading the comments helps :) It triggers an include-hell, if you
make them inline. Since they're lockdep debug thingies, I think it's kinda
wasted turn them into non-inline real functions, so they'd better remain
macros IMO.



- Davide




\
 
 \ /
  Last update: 2009-02-03 20:23    [W:0.060 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site