Re: [patch 02/41] cpu alloc: The allocator

From: Andrew Morton
Date: Fri May 30 2008 - 01:31:39 EST


On Thu, 29 May 2008 22:10:25 -0700 (PDT) Christoph Lameter <clameter@xxxxxxx> wrote:

> > > + start++;
> > > + first = 0;
> > > + }
> >
> > This is kinda bitmap_find_free_region(), only bitmap_find_free_region()
> > isn't quite strong enough.
> >
> > Generally I think it would have been better if you had added new
> > primitives to the bitmap library (or enhanced existing ones) and used
> > them here, rather than implementing private functionality.
>
> The scope of the patchset is already fairly large.

It would be a relatively small incremental effort ;)

> The search here is
> different and not performance critical. Not sure if this is useful for
> other purposes.

I think that strengthening bitmap_find_free_region() would end up
giving us a better kernel than open-coding something similar here.

> > > + */
> > > +
> > > +/* Return a pointer to the instance of a object for a particular processor */
> > > +#define CPU_PTR(__p, __cpu) SHIFT_PERCPU_PTR((__p), per_cpu_offset(__cpu))
> >
> > eek, a major interface function which is ALL IN CAPS!
> >
> > can we do this in lower-case? In a C function?
>
> No. This is a macro and therefore uppercase (there is macro magic going on
> that ppl need to be aware of). AFAICR you wanted it this way last year. C
> function not possible because of the type checking.

urgh. This is a C-convention versus kernel-convention thing. The C
convention exists for very good reasons. But it sure does suck.

What do others think?
--
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/