On Mon, Jul 29, 2019 at 10:03:40PM +0000, Song Liu wrote: > > +/* If you add more flags, increment FGP_ORDER_SHIFT */ > > +#define FGP_ORDER_SHIFT 7 > > +#define FGP_PMD ((PMD_SHIFT - PAGE_SHIFT) << FGP_ORDER_SHIFT) > > +#define FGP_PUD ((PUD_SHIFT - PAGE_SHIFT) << FGP_ORDER_SHIFT) > > +#define fgp_get_order(fgp) ((fgp) >> FGP_ORDER_SHIFT) > > This looks like we want support order up to 25 (32 - 7). I guess we don't > need that many. How about we specify the highest order to support here? We can support all the way up to order 64 with just 6 bits, leaving 32 - 6 - 7 = 19 bits free. We haven't been adding FGP flags very quickly, so I doubt we'll need anything larger. > Also, fgp_flags is signed int, so we need to make sure fgp_flags is not > negative. If we ever get there, I expect people to convert the parameter from signed int to unsigned long.