All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Thumshirn <jthumshirn@suse.de>
To: Christoph Lameter <cl@linux.com>,
	Pekka Enberg <penberg@kernel.org>,
	David Rientjes <rientjes@google.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Damien Le Moal <damien.lemoal@wdc.com>,
	Christoph Hellwig <hch@lst.de>,
	Johannes Thumshirn <jthumshirn@suse.de>
Subject: [PATCH 2/6] block: use kmalloc_array_node
Date: Wed, 27 Sep 2017 10:20:34 +0200	[thread overview]
Message-ID: <20170927082038.3782-3-jthumshirn@suse.de> (raw)
In-Reply-To: <20170927082038.3782-1-jthumshirn@suse.de>

Now that we have a NUMA-aware version of kmalloc_array() we can use it
instead of kmalloc_node() without an overflow check in the size
calculation.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
---
 block/blk-mq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 98a18609755e..49f9dc0eb47c 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1979,7 +1979,7 @@ static int blk_mq_init_hctx(struct request_queue *q,
 	 * Allocate space for all possible cpus to avoid allocation at
 	 * runtime
 	 */
-	hctx->ctxs = kmalloc_node(nr_cpu_ids * sizeof(void *),
+	hctx->ctxs = kmalloc_array_node(nr_cpu_ids, sizeof(void *),
 					GFP_KERNEL, node);
 	if (!hctx->ctxs)
 		goto unregister_cpu_notifier;
-- 
2.13.5

WARNING: multiple messages have this Message-ID (diff)
From: Johannes Thumshirn <jthumshirn@suse.de>
To: Christoph Lameter <cl@linux.com>,
	Pekka Enberg <penberg@kernel.org>,
	David Rientjes <rientjes@google.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Damien Le Moal <damien.lemoal@wdc.com>,
	Christoph Hellwig <hch@lst.de>,
	Johannes Thumshirn <jthumshirn@suse.de>
Subject: [PATCH 2/6] block: use kmalloc_array_node
Date: Wed, 27 Sep 2017 10:20:34 +0200	[thread overview]
Message-ID: <20170927082038.3782-3-jthumshirn@suse.de> (raw)
In-Reply-To: <20170927082038.3782-1-jthumshirn@suse.de>

Now that we have a NUMA-aware version of kmalloc_array() we can use it
instead of kmalloc_node() without an overflow check in the size
calculation.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
---
 block/blk-mq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 98a18609755e..49f9dc0eb47c 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1979,7 +1979,7 @@ static int blk_mq_init_hctx(struct request_queue *q,
 	 * Allocate space for all possible cpus to avoid allocation at
 	 * runtime
 	 */
-	hctx->ctxs = kmalloc_node(nr_cpu_ids * sizeof(void *),
+	hctx->ctxs = kmalloc_array_node(nr_cpu_ids, sizeof(void *),
 					GFP_KERNEL, node);
 	if (!hctx->ctxs)
 		goto unregister_cpu_notifier;
-- 
2.13.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>

  parent reply	other threads:[~2017-09-27  8:22 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-27  8:20 [PATCH 0/6] Add kmalloc_array_node() and kcalloc_node() Johannes Thumshirn
2017-09-27  8:20 ` Johannes Thumshirn
2017-09-27  8:20 ` [PATCH 1/6] mm: add kmalloc_array_node and kcalloc_node Johannes Thumshirn
2017-09-27  8:20   ` Johannes Thumshirn
2017-09-27  8:42   ` Michal Hocko
2017-09-27  8:42     ` Michal Hocko
2017-09-27  9:03     ` Christopher Lameter
2017-09-27  9:16       ` Michal Hocko
2017-09-27  9:16         ` Michal Hocko
2017-09-27  8:56   ` Christopher Lameter
2017-09-29 12:00   ` Vlastimil Babka
2017-09-29 12:00     ` Vlastimil Babka
2017-09-27  8:20 ` Johannes Thumshirn [this message]
2017-09-27  8:20   ` [PATCH 2/6] block: use kmalloc_array_node Johannes Thumshirn
2017-09-27  8:57   ` Christopher Lameter
2017-09-27  8:20 ` [PATCH 3/6] IB/qib: " Johannes Thumshirn
2017-09-27  8:20   ` Johannes Thumshirn
2017-09-27  8:58   ` Christopher Lameter
2017-09-27  8:20 ` [PATCH 4/6] IB/rdmavt: " Johannes Thumshirn
2017-09-27  8:20   ` Johannes Thumshirn
2017-09-27  9:04   ` Christopher Lameter
2017-09-27  8:20 ` [PATCH 5/6] mm, mempool: " Johannes Thumshirn
2017-09-27  8:20   ` Johannes Thumshirn
2017-09-27  9:04   ` Christopher Lameter
2017-09-27  8:20 ` [PATCH 6/6] rds: ib: " Johannes Thumshirn
2017-09-27  8:20   ` Johannes Thumshirn
2017-09-27  9:03   ` Christopher 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=20170927082038.3782-3-jthumshirn@suse.de \
    --to=jthumshirn@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=damien.lemoal@wdc.com \
    --cc=hch@lst.de \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=penberg@kernel.org \
    --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.