Re: [PATCH] zsmalloc: drop unused member 'mapping_area->huge'

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

 



Hello,

On (02/17/16 09:56), YiPing Xu wrote:
>  static int create_handle_cache(struct zs_pool *pool)
> @@ -1127,11 +1126,9 @@ static void __zs_unmap_object(struct mapping_area *area,
>  		goto out;
>  
>  	buf = area->vm_buf;
> -	if (!area->huge) {
> -		buf = buf + ZS_HANDLE_SIZE;
> -		size -= ZS_HANDLE_SIZE;
> -		off += ZS_HANDLE_SIZE;
> -	}
> +	buf = buf + ZS_HANDLE_SIZE;
> +	size -= ZS_HANDLE_SIZE;
> +	off += ZS_HANDLE_SIZE;
>  
>  	sizes[0] = PAGE_SIZE - off;
>  	sizes[1] = size - sizes[0];


hm, indeed.

shouldn't it depend on class->huge?

void *zs_map_object()
{
	void *ret = __zs_map_object(area, pages, off, class->size);

	if (!class->huge)
		ret += ZS_HANDLE_SIZE;  /* area->vm_buf + ZS_HANDLE_SIZE */

	return ret;
}

static void __zs_unmap_object(struct mapping_area *area...)
{
	char *buf = area->vm_buf;

	/* handle is in page->private for class->huge */

	buf = buf + ZS_HANDLE_SIZE;
	size -= ZS_HANDLE_SIZE;
	off += ZS_HANDLE_SIZE;

	memcpy(..);
}

	-ss

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]