Re: [PATCH v3 2/3] resource: Add release_mem_region_adjustable()

From: David Rientjes
Date: Wed Apr 10 2013 - 18:08:36 EST

On Wed, 10 Apr 2013, Toshi Kani wrote:

> > I'll switch it to GFP_ATOMIC. Which is horridly lame but the
> > allocation is small and alternatives are unobvious.
> Great! Again, thanks for the update!

release_mem_region_adjustable() allocates at most one struct resource, so
why not do kmalloc(sizeof(struct resource), GFP_KERNEL) before taking
resource_lock and then testing whether it's NULL or not when splitting?
It unnecessarily allocates memory when there's no split, but
__remove_pages() shouldn't be a hotpath.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at