[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 6/8] evtchn: alter internal object handling scheme



>>> On 09.08.13 at 20:08, David Vrabel <david.vrabel@xxxxxxxxxx> wrote:
> +#define BUCKETS_PER_GROUP  (PAGE_SIZE/sizeof(struct evtchn *))
> +/* Round size of struct evtchn up to power of 2 size */
> +#define b2(x)   (   (x) | (   (x) >> 1) )
> +#define b4(x)   ( b2(x) | ( b2(x) >> 2) )
> +#define b8(x)   ( b4(x) | ( b4(x) >> 4) )
> +#define b16(x)  ( b8(x) | ( b8(x) >> 8) )
> +#define b32(x)  (b16(x) | (b16(x) >>16) )

The names of these are too generic.

> +#define next_power_of_2(x)      (b32(x-1) + 1)

x needs to be parenthesized.

> +/* Maximum number of event channels for any ABI. */
> +#define MAX_NR_EVTCHNS (max_t(unsigned, NR_EVENT_CHANNELS,  \
> +                              1 << EVTCHN_FIFO_LINK_BITS))

I don't recall EVTCHN_FIFO_LINK_BITS having got defined in earlier
patches, and it certainly doesn't get defined in this one.

> +#define EVTCHNS_PER_BUCKET (PAGE_SIZE / next_power_of_2(sizeof(struct 
> evtchn)))
> +#define EVTCHNS_PER_GROUP  (BUCKETS_PER_GROUP * EVTCHNS_PER_BUCKET)
> +#define NR_EVTCHN_GROUPS   DIV_ROUND_UP(MAX_NR_EVTCHNS, EVTCHNS_PER_GROUP)

So for the 2-level case this still results in a full page allocation for
the top level structure. Not too nice...

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.