From: Joonsoo Kim <js1304@gmail.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
David Rientjes <rientjes@google.com>,
LKML <linux-kernel@vger.kernel.org>,
Linux Memory Management List <linux-mm@kvack.org>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Takashi Iwai <tiwai@suse.com>,
Chris Metcalf <cmetcalf@ezchip.com>,
Christoph Lameter <cl@linux.com>,
linux-api@vger.kernel.org, Joonsoo Kim <iamjoonsoo.kim@lge.com>
Subject: Re: [PATCH 2/5] mm/slub: query dynamic DEBUG_PAGEALLOC setting
Date: Fri, 5 Feb 2016 01:21:12 +0900 [thread overview]
Message-ID: <CAAmzW4Oce1zeVj=cjcgNVYV8CSE6JbQgdDbxroTrBMt02C13Yw@mail.gmail.com> (raw)
In-Reply-To: <56B30C52.7040907@de.ibm.com>
2016-02-04 17:31 GMT+09:00 Christian Borntraeger <borntraeger@de.ibm.com>:
> On 02/04/2016 06:56 AM, Joonsoo Kim wrote:
>> We can disable debug_pagealloc processing even if the code is complied
>> with CONFIG_DEBUG_PAGEALLOC. This patch changes the code to query
>> whether it is enabled or not in runtime.
>>
>> Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
>> ---
>> mm/slub.c | 11 ++++++-----
>> 1 file changed, 6 insertions(+), 5 deletions(-)
>>
>> diff --git a/mm/slub.c b/mm/slub.c
>> index 7d4da68..7b5a965 100644
>> --- a/mm/slub.c
>> +++ b/mm/slub.c
>> @@ -256,11 +256,12 @@ static inline void *get_freepointer_safe(struct kmem_cache *s, void *object)
>> {
>> void *p;
>>
>> -#ifdef CONFIG_DEBUG_PAGEALLOC
>> - probe_kernel_read(&p, (void **)(object + s->offset), sizeof(p));
>> -#else
>> - p = get_freepointer(s, object);
>> -#endif
>> + if (debug_pagealloc_enabled()) {
>> + probe_kernel_read(&p,
>> + (void **)(object + s->offset), sizeof(p));
>
> Hmm, this might be a good case for a line longer than 80 chars....
>
> As an alternative revert the logic and return early:
>
>
> if (!debug_pagealloc_enabled())
> return get_freepointer(s, object);
> probe_kernel_read(&p, (void **)(object + s->offset), sizeof(p));
> return p;
>
Looks better!
I will fix it on next version.
Thanks.
next prev parent reply other threads:[~2016-02-04 16:21 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-04 5:56 [PATCH 0/5] follow-up "Optimize CONFIG_DEBUG_PAGEALLOC" Joonsoo Kim
2016-02-04 5:56 ` [PATCH 1/5] mm/vmalloc: query dynamic DEBUG_PAGEALLOC setting Joonsoo Kim
2016-02-04 8:32 ` Christian Borntraeger
2016-02-04 22:18 ` David Rientjes
2016-02-05 16:13 ` Joonsoo Kim
2016-02-04 5:56 ` [PATCH 2/5] mm/slub: " Joonsoo Kim
2016-02-04 8:31 ` Christian Borntraeger
2016-02-04 16:21 ` Joonsoo Kim [this message]
2016-02-04 5:56 ` [PATCH 3/5] sound: " Joonsoo Kim
2016-02-04 22:19 ` David Rientjes
2016-02-05 9:26 ` Takashi Iwai
2016-02-04 5:56 ` [PATCH 4/5] powerpc: " Joonsoo Kim
2016-02-04 22:22 ` David Rientjes
2016-02-04 5:56 ` [PATCH 5/5] tile: " Joonsoo Kim
2016-02-09 16:56 ` Chris Metcalf
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='CAAmzW4Oce1zeVj=cjcgNVYV8CSE6JbQgdDbxroTrBMt02C13Yw@mail.gmail.com' \
--to=js1304@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=benh@kernel.crashing.org \
--cc=borntraeger@de.ibm.com \
--cc=cl@linux.com \
--cc=cmetcalf@ezchip.com \
--cc=iamjoonsoo.kim@lge.com \
--cc=linux-api@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=rientjes@google.com \
--cc=tiwai@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).