All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm/slub.c: replace cpu_slab->partial with wrapped APIs
@ 2020-02-17 15:04 qiwuchen55
  2020-02-26 18:15 ` Vlastimil Babka
  0 siblings, 1 reply; 3+ messages in thread
From: qiwuchen55 @ 2020-02-17 15:04 UTC (permalink / raw)
  To: cl, penberg, rientjes, iamjoonsoo.kim, akpm; +Cc: linux-mm, chenqiwu

From: chenqiwu <chenqiwu@xiaomi.com>

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.

Signed-off-by: chenqiwu <chenqiwu@xiaomi.com>
---
 mm/slub.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/slub.c b/mm/slub.c
index 17dc00e..15bb0ba 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -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) {
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mm/slub.c: replace cpu_slab->partial with wrapped APIs
  2020-02-17 15:04 [PATCH] mm/slub.c: replace cpu_slab->partial with wrapped APIs qiwuchen55
@ 2020-02-26 18:15 ` Vlastimil Babka
  2020-02-26 18:26   ` Christopher Lameter
  0 siblings, 1 reply; 3+ messages in thread
From: Vlastimil Babka @ 2020-02-26 18:15 UTC (permalink / raw)
  To: qiwuchen55, cl, penberg, rientjes, iamjoonsoo.kim, akpm
  Cc: linux-mm, chenqiwu

On 2/17/20 4:04 PM, qiwuchen55@gmail.com wrote:
> From: chenqiwu <chenqiwu@xiaomi.com>
> 
> 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.
> 
> Signed-off-by: chenqiwu <chenqiwu@xiaomi.com>

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.

> ---
>  mm/slub.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/slub.c b/mm/slub.c
> index 17dc00e..15bb0ba 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -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) {
> 



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mm/slub.c: replace cpu_slab->partial with wrapped APIs
  2020-02-26 18:15 ` Vlastimil Babka
@ 2020-02-26 18:26   ` Christopher Lameter
  0 siblings, 0 replies; 3+ messages in thread
From: Christopher Lameter @ 2020-02-26 18:26 UTC (permalink / raw)
  To: Vlastimil Babka
  Cc: qiwuchen55, penberg, rientjes, iamjoonsoo.kim, akpm, linux-mm, chenqiwu

On Wed, 26 Feb 2020, Vlastimil Babka wrote:

> 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.

I agree. Lets drop this.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-02-26 18:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-17 15:04 [PATCH] mm/slub.c: replace cpu_slab->partial with wrapped APIs qiwuchen55
2020-02-26 18:15 ` Vlastimil Babka
2020-02-26 18:26   ` Christopher Lameter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.