lkml.org 
[lkml]   [2014]   [May]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 03/10] slab: move up code to get kmem_cache_node in free_block()
On Wed, 7 May 2014, David Rientjes wrote:

> > @@ -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?




\
 
 \ /
  Last update: 2014-05-08 16:21    [W:0.083 / U:0.744 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site