[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20080228165608.de7c8ae4.akpm@linux-foundation.org>
Date: Thu, 28 Feb 2008 16:56:08 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Andrea Arcangeli <andrea@...ranet.com>
Cc: Christoph Lameter <clameter@....com>,
Jack Steiner <steiner@....com>, Nick Piggin <npiggin@...e.de>,
Robin Holt <holt@....com>, Avi Kivity <avi@...ranet.com>,
Izik Eidus <izike@...ranet.com>,
kvm-devel@...ts.sourceforge.net,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
general@...ts.openfabrics.org,
Steve Wise <swise@...ngridcomputing.com>,
Roland Dreier <rdreier@...co.com>,
Kanoj Sarcar <kanojsarcar@...oo.com>,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
daniel.blueman@...drics.com
Subject: Re: [PATCH] mmu notifiers #v7
On Fri, 29 Feb 2008 01:40:01 +0100 Andrea Arcangeli <andrea@...ranet.com> wrote:
> > > +#define mmu_notifier(function, mm, args...) \
> > > + do { \
> > > + struct mmu_notifier *__mn; \
> > > + struct hlist_node *__n; \
> > > + \
> > > + if (unlikely(!hlist_empty(&(mm)->mmu_notifier.head))) { \
> > > + rcu_read_lock(); \
> > > + hlist_for_each_entry_rcu(__mn, __n, \
> > > + &(mm)->mmu_notifier.head, \
> > > + hlist) \
> > > + if (__mn->ops->function) \
> > > + __mn->ops->function(__mn, \
> > > + mm, \
> > > + args); \
> > > + rcu_read_unlock(); \
> > > + } \
> > > + } while (0)
> >
> > Andrew recomended local variables for parameters used multile times. This
> > means the mm parameter here.
>
> I don't exactly see what "buggy macro" meant?
multiple refernces to the argument, so
mmu_notifier(foo, bar(), zot);
will call bar() either once or twice.
Unlikely in this case, but bad practice. Easily fixable by using another
temporary.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists