All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: Christopher Lameter <cl@linux.com>, qiwuchen55@gmail.com
Cc: penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com,
	akpm@linux-foundation.org, linux-mm@kvack.org,
	chenqiwu <chenqiwu@xiaomi.com>
Subject: Re: [PATCH v2] mm/slub.c: replace kmem_cache->cpu_partial with wrapped APIs
Date: Wed, 26 Feb 2020 19:13:31 +0100	[thread overview]
Message-ID: <182f5569-cda6-80b2-45fe-dd1f4ae66956@suse.cz> (raw)
In-Reply-To: <alpine.DEB.2.21.2002220339100.2000@www.lameter.com>

On 2/22/20 4:40 AM, Christopher Lameter wrote:
> On Wed, 19 Feb 2020, qiwuchen55@gmail.com wrote:
> 
>> diff --git a/mm/slub.c b/mm/slub.c
>> index 17dc00e..1eb888c 100644
>> --- a/mm/slub.c
>> +++ b/mm/slub.c
>> @@ -2284,7 +2284,7 @@ static void put_cpu_partial(struct kmem_cache *s, struct page *page, int drain)
>>  		if (oldpage) {
>>  			pobjects = oldpage->pobjects;
>>  			pages = oldpage->pages;
>> -			if (drain && pobjects > s->cpu_partial) {
>> +			if (drain && pobjects > slub_cpu_partial(s)) {
>>  				unsigned long flags;
>>  				/*
>>  				 * partial array is full. Move the existing
> 
> Maybe its better to not generate code for put_cpu_partial() instead of
> using macros there if per cpu partials are disabled?

The whole code of put_cpu_partial() is already under
#ifdef CONFIG_SLUB_CPU_PARTIAL.

I agree that the wrapper shouldn't be used in a function that deals only with
the case that the partials do exist. It just obscures the code unnecessarily.



  reply	other threads:[~2020-02-26 18:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-19  2:32 [PATCH v2] mm/slub.c: replace kmem_cache->cpu_partial with wrapped APIs qiwuchen55
2020-02-22  3:40 ` Christopher Lameter
2020-02-26 18:13   ` Vlastimil Babka [this message]
2020-02-27  1:47     ` Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=182f5569-cda6-80b2-45fe-dd1f4ae66956@suse.cz \
    --to=vbabka@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=chenqiwu@xiaomi.com \
    --cc=cl@linux.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-mm@kvack.org \
    --cc=penberg@kernel.org \
    --cc=qiwuchen55@gmail.com \
    --cc=rientjes@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.