lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4F98A818.1080106@kernel.org>
Date:	Thu, 26 Apr 2012 10:42:48 +0900
From:	Minchan Kim <minchan@...nel.org>
To:	Nitin Gupta <ngupta@...are.org>
CC:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Seth Jennings <sjenning@...ux.vnet.ibm.com>,
	Dan Magenheimer <dan.magenheimer@...cle.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [PATCH 2/6] zsmalloc: remove unnecessary alignment

On 04/25/2012 09:53 PM, Nitin Gupta wrote:

> On 04/25/2012 02:23 AM, Minchan Kim wrote:
> 
>> It isn't necessary to align pool size with PAGE_SIZE.
>> If I missed something, please let me know it.
>>
>> Signed-off-by: Minchan Kim <minchan@...nel.org>
>> ---
>>  drivers/staging/zsmalloc/zsmalloc-main.c |    5 ++---
>>  1 file changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/staging/zsmalloc/zsmalloc-main.c b/drivers/staging/zsmalloc/zsmalloc-main.c
>> index 504b6c2..b99ad9e 100644
>> --- a/drivers/staging/zsmalloc/zsmalloc-main.c
>> +++ b/drivers/staging/zsmalloc/zsmalloc-main.c
>> @@ -489,14 +489,13 @@ fail:
>>  
>>  struct zs_pool *zs_create_pool(const char *name, gfp_t flags)
>>  {
>> -	int i, error, ovhd_size;
>> +	int i, error;
>>  	struct zs_pool *pool;
>>  
>>  	if (!name)
>>  		return NULL;
>>  
>> -	ovhd_size = roundup(sizeof(*pool), PAGE_SIZE);
>> -	pool = kzalloc(ovhd_size, GFP_KERNEL);
>> +	pool = kzalloc(sizeof(*pool), GFP_KERNEL);
>>  	if (!pool)
>>  		return NULL;
>>  
> 
> 
> pool metadata is rounded-up to avoid potential false-sharing problem
> (though we could just roundup to cache_line_size()).


Do you really have any hurt by false-sharing problem?
If so, we can change it with

kzalloc(ALIGN(sizeof(*pool), cache_line_size()), GFP_KERNEL);

But I am not sure we need this.

> 
> Thanks,
> Nitin
> 
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@...ck.org.  For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
> Don't email: <a href=mailto:"dont@...ck.org"> email@...ck.org </a>
> 



-- 
Kind regards,
Minchan Kim
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ