[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1174488630.21684.5.camel@localhost.localdomain>
Date: Wed, 21 Mar 2007 09:50:30 -0500
From: Adam Litke <agl@...ibm.com>
To: Dave Hansen <hansendc@...ibm.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Arjan van de Ven <arjan@...radead.org>,
William Lee Irwin III <wli@...omorphy.com>,
Christoph Hellwig <hch@...radead.org>,
Ken Chen <kenchen@...gle.com>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/7] Introduce the pagetable_operations and associated
helper macros.
On Tue, 2007-03-20 at 16:24 -0700, Dave Hansen wrote:
> On Mon, 2007-03-19 at 13:05 -0700, Adam Litke wrote:
> >
> > +#define has_pt_op(vma, op) \
> > + ((vma)->pagetable_ops && (vma)->pagetable_ops->op)
> > +#define pt_op(vma, call) \
> > + ((vma)->pagetable_ops->call)
>
> Can you get rid of these macros? I think they make it a wee bit harder
> to read. My brain doesn't properly parse the foo(arg)(bar) syntax.
>
> + if (has_pt_op(vma, copy_vma))
> + return pt_op(vma, copy_vma)(dst_mm, src_mm, vma);
>
> + if (vma->pagetable_ops && vma->pagetable_ops->copy_vma)
> + return vma->pagetable_ops->copy_vma(dst_mm, src_mm, vma);
>
> I guess it does lead to some longish lines. Does it start looking
> really nasty?
Yeah, it starts to look pretty bad. Some of these calls are in code
that is already indented several times.
> If you're going to have them, it might just be best to put a single
> unlikely() around the macro definitions themselves to keep anybody from
> having to open-code it for any of the users.
It should be pretty easy to wrap has_pt_op() with an unlikely(). Good
suggestion.
--
Adam Litke - (agl at us.ibm.com)
IBM Linux Technology Center
-
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