Re: [PATCH v1 3/5] mem-pool: fill out functionality

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

 



On Tue, 17 Apr 2018 16:34:42 +0000
Jameson Miller <jamill@xxxxxxxxxxxxx> wrote:

> @@ -19,8 +19,27 @@ struct mem_pool {
>  
>  	/* The total amount of memory allocated by the pool. */
>  	size_t pool_alloc;
> +
> +	/*
> +	 * Array of pointers to "custom size" memory allocations.
> +	 * This is used for "large" memory allocations.
> +	 * The *_end variables are used to track the range of memory
> +	 * allocated.
> +	 */
> +	void **custom, **custom_end;
> +	int nr, nr_end, alloc, alloc_end;

This seems overly complicated - the struct mem_pool already has a linked
list of pages, so couldn't you create a custom page and insert it behind
the current front page instead whenever you needed a large-size page?

Also, when combining, there could be some wasted space on one of the
pages. I'm not sure if that's worth calling out, though.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux