Re: [PATCH 1/2] proc/stat: convert to single_open_size()

From: David Rientjes
Date: Wed Jun 18 2014 - 19:28:57 EST


On Mon, 16 Jun 2014, Heiko Carstens wrote:

> Use seq_file's single_open_size() to preallocate a buffer that is large
> enough to hold the whole output, instead of open coding it.
> Also calculate the requested size using the number of online cpus instead
> of possible cpus, since the size of the output only depends on the number
> of online cpus.
>
> Signed-off-by: Heiko Carstens <heiko.carstens@xxxxxxxxxx>

Acked-by: David Rientjes <rientjes@xxxxxxxxxx>

I have no idea why the check for size > KMALLOC_MAX_SIZE was there, all
slab allocators will fallback to the page allocator and the slowpath will
return NULL.
--
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/