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] [day] [month] [year] [list]
Date:	8 May 2014 15:24:05 -0400
From:	"George Spelvin" <linux@...izon.com>
To:	cl@...ux.com, rientjes@...gle.com
Cc:	iamjoonsoo.kim@....com, linux-kernel@...r.kernel.org,
	linux-mm@...ck.org, linux@...izon.com
Subject: Re: [PATCH v2 03/10] slab: move up code to get kmem_cache_node in free_block()

>>> @@ -3362,17 +3359,12 @@ static void free_block(struct kmem_cache *cachep, void **objpp, int nr_objects,
>>>  		       int node)
>>>  {
>>>  	int i;
>>> -	struct kmem_cache_node *n;
>>> +	struct kmem_cache_node *n = cachep->node[node];
>>>
>>>  	for (i = 0; i < nr_objects; i++) {
>>> -		void *objp;
>>> -		struct page *page;
>>> -
>>> -		clear_obj_pfmemalloc(&objpp[i]);
>>> -		objp = objpp[i];
>>> +		void *objp = clear_obj_pfmemalloc(&objpp[i]);
>>> +		struct page *page = virt_to_head_page(objp);
>>>
>>> -		page = virt_to_head_page(objp);
>>> -		n = cachep->node[node];
>>>  		list_del(&page->lru);
>>>  		check_spinlock_acquired_node(cachep, node);
>>>  		slab_put_obj(cachep, page, objp, node);
>>
>> I think this unnecessarily obfuscates the code.

> It takes the lookup out of the loop. What does the obfuscation?

Taking the lookup of n out was the original cleanup patch; that part is
not my doing.

I changed clear_obj_pfmemalloc to return the modified pointer.
(As well as storing it back in version 1 which you quoted, instead of
storing it back in version 2.)
--
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