[Lguest] [PATCH 1/1] Least Recently Used pgdirs

Rusty Russell rusty at rustcorp.com.au
Wed Aug 15 16:24:47 EST 2007


On Tue, 2007-08-14 at 16:24 -0300, Glauber de Oliveira Costa wrote:
> On 8/14/07, Jason Yeh <jasonyeh0908 at gmail.com> wrote:
> > #define LGUEST_DS        (GDT_ENTRY_LGUEST_DS * 8)
> > +/* Number of PGDIR we keep for each guest */
> > +#define PGDIR_MAX 4
> This change is good regardless of the rest. Best to keep in constants
> what can be kept this way. You may want to mail a separate patch
> regardless of the result of this one.

Just a quick note: I don't agree.

The important thing is that the constant is in a single place (it is:
everyone uses ARRAY_SIZE()).  It *is* currently the array size, so that
makes sense.

Adding a separate constant in this case adds an extra level of
indirection: the current code is explicit.

This is all moot if we turn it into a list, of course, but I thought
worthwhile elucidating.

Cheers,
Rusty.





More information about the Lguest mailing list