mm/slub.c: replace cpu_slab->partial with wrapped APIs
Subsystems (2)
PATCH 1/1 mm/slub.c: replace cpu_slab->partial with wrapped APIs
From: chenqiwu <[email protected]>
There are slub_percpu_partial() and slub_set_percpu_partial() APIs to wrap kmem_cache->cpu_partial. This patch will use the two to replace cpu_slab->partial in slub code.
--- mm/slub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
mm/slub.c +2 -2
@@ -2207,11 +2207,11 @@ static void unfreeze_partials(struct kmem_cache *s,struct kmem_cache_node *n =NULL , *n2 =NULL ;struct page *page, *discard_page =NULL ; -while ((page = c->partial)) { +while ((page =slub_percpu_partial (c))) {struct page new;struct page old; - c->partial = page->next; +slub_set_percpu_partial (c, page); n2 =get_node (s,page_to_nid (page));if (n != n2) {
Signature · 1 line
1.9.1
Quoted 7 lines · On 2/17/20 4:04 PM, [email protected] wrote:
From: chenqiwu <[email protected]>
There are
slub_percpu_partial()andslub_set_percpu_partial()APIs to wrapkmem_cache->cpu_partial. This patch will use the two to replacecpu_slab->partialin slub code.Signed-off-by chenqiwu <[email protected]>
Same comment as for "[PATCH v2] mm/slub.c: replace kmem_cache->cpu_partial with wrapped APIs". This function generates code only with CONFIG_SLUB_CPU_PARTIAL and so the wrapper just obfuscates the code unnecessarily.
Quoted 23 lines
--- mm/slub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)mm/slub.c +2
-2@@ -2207,11 +2207,11 @@ static void unfreeze_partials(struct kmem_cache *s,struct kmem_cache_node *n =NULL , *n2 =NULL ;struct page *page, *discard_page =NULL ; -while ((page = c->partial)) { +while ((page =slub_percpu_partial (c))) {struct page new;struct page old; - c->partial = page->next; +slub_set_percpu_partial (c, page); n2 =get_node (s,page_to_nid (page));if (n != n2) {
Quoted 3 lines · Vlastimil Babka
Same comment as for "[PATCH v2]
mm/slub.c: replacekmem_cache->cpu_partialwith wrapped APIs". This function generates code only withCONFIG_SLUB_CPU_PARTIALand so the wrapper just obfuscates the code unnecessarily.
I agree. Lets drop this.