Re: [patch 2/6] epoll keyed wakeups v2 - introduce new *_poll()wakeup macros

From: Andrew Morton
Date: Tue Feb 03 2009 - 03:15:12 EST


On Sun, 01 Feb 2009 12:04:23 -0800 Davide Libenzi <davidel@xxxxxxxxxxxxxxx> 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?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/