linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Xiongwei Song <sxwjean@me.com>
To: cl@linux.com, penberg@kernel.org, rientjes@google.com,
	iamjoonsoo.kim@lge.com, akpm@linux-foundation.org,
	vbabka@suse.cz
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Xiongwei Song <sxwjean@gmail.com>
Subject: [PATCH] mm: append __GFP_COMP flag for trace_malloc
Date: Tue, 27 Apr 2021 10:43:20 +0800	[thread overview]
Message-ID: <1619491400-1904-1-git-send-email-sxwjean@me.com> (raw)

From: Xiongwei Song <sxwjean@gmail.com>

When calling kmalloc_order, the flags should include __GFP_COMP here,
so that trace_malloc can trace the precise flags.

Signed-off-by: Xiongwei Song <sxwjean@gmail.com>
---
 mm/slab_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/slab_common.c b/mm/slab_common.c
index 585a6f9..c23e1e8 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -928,7 +928,7 @@ EXPORT_SYMBOL(kmalloc_order);
 void *kmalloc_order_trace(size_t size, gfp_t flags, unsigned int order)
 {
 	void *ret = kmalloc_order(size, flags, order);
-	trace_kmalloc(_RET_IP_, ret, size, PAGE_SIZE << order, flags);
+	trace_kmalloc(_RET_IP_, ret, size, PAGE_SIZE << order, flags | __GFP_COMP);
 	return ret;
 }
 EXPORT_SYMBOL(kmalloc_order_trace);
-- 
2.7.4


             reply	other threads:[~2021-04-27  2:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-27  2:43 Xiongwei Song [this message]
2021-04-27  2:53 ` [PATCH] mm: append __GFP_COMP flag for trace_malloc Matthew Wilcox
2021-04-27  3:29   ` Xiongwei Song
2021-04-27  3:36     ` Matthew Wilcox
2021-04-27  4:11       ` Xiongwei Song
2021-04-27  5:30         ` Xiongwei Song
2021-04-27 11:25           ` Matthew Wilcox
2021-04-28  3:05             ` Xiongwei Song
2021-05-03 12:35               ` Vlastimil Babka
2021-05-07  5:41                 ` Xiongwei Song

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=1619491400-1904-1-git-send-email-sxwjean@me.com \
    --to=sxwjean@me.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=penberg@kernel.org \
    --cc=rientjes@google.com \
    --cc=sxwjean@gmail.com \
    --cc=vbabka@suse.cz \
    /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 NNTP newsgroup(s).