From: Joonsoo Kim <js1304@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, Pekka Enberg <penberg@kernel.org>,
Christoph Lameter <cl@linux.com>,
Fengguang Wu <fengguang.wu@intel.com>,
Joonsoo Kim <js1304@gmail.com>
Subject: [PATCH for-next] mm/sl[au]b: correct allocation type check in kmalloc_slab()
Date: Mon, 4 Feb 2013 23:46:46 +0900 [thread overview]
Message-ID: <1359989206-16116-1-git-send-email-js1304@gmail.com> (raw)
In-Reply-To: <20130202125952.GE16114@localhost>
commit "slab: Common Kmalloc cache determination" made mistake
in kmalloc_slab(). SLAB_CACHE_DMA is for kmem_cache creation,
not for allocation. For allocation, we should use GFP_XXX to identify
type of allocation. So, change SLAB_CACHE_DMA to GFP_DMA.
Cc: Christoph Lameter <cl@linux.com>
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Joonsoo Kim <js1304@gmail.com>
diff --git a/mm/slab_common.c b/mm/slab_common.c
index 6d73f0b..2f0e7d5 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -382,7 +382,7 @@ struct kmem_cache *kmalloc_slab(size_t size, gfp_t flags)
index = fls(size - 1);
#ifdef CONFIG_ZONE_DMA
- if (unlikely((flags & SLAB_CACHE_DMA)))
+ if (unlikely((flags & GFP_DMA)))
return kmalloc_dma_caches[index];
#endif
--
1.7.9.5
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2013-02-04 14:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <510bae53.+nWBFPQ3bGiTzPs/%fengguang.wu@intel.com>
[not found] ` <0000013c971ab472-8542127a-19e8-4f6a-8b7e-5f5ab8bcd8fd-000000@email.amazonses.com>
2013-02-02 12:59 ` [slab:slab/next 11/13] mm/slab_common.c:385:13: sparse: restricted gfp_t degrades to integer Fengguang Wu
2013-02-04 14:46 ` Joonsoo Kim [this message]
2013-02-04 19:00 ` [PATCH for-next] mm/sl[au]b: correct allocation type check in kmalloc_slab() Christoph Lameter
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=1359989206-16116-1-git-send-email-js1304@gmail.com \
--to=js1304@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=cl@linux.com \
--cc=fengguang.wu@intel.com \
--cc=linux-mm@kvack.org \
--cc=penberg@kernel.org \
/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).