linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Jungseok Lee <jungseoklee85@gmail.com>
To: catalin.marinas@arm.com, will.deacon@arm.com, cl@linux.com,
	tj@kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-mm@kvack.org
Cc: james.morse@arm.com, takahiro.akashi@linaro.org,
	mark.rutland@arm.com, barami97@gmail.com,
	linux-kernel@vger.kernel.org
Subject: [PATCH v6 2/3] percpu: add PERCPU_ATOM_SIZE for a generic percpu area setup
Date: Sun,  1 Nov 2015 07:46:16 +0000	[thread overview]
Message-ID: <1446363977-23656-3-git-send-email-jungseoklee85@gmail.com> (raw)
In-Reply-To: <1446363977-23656-1-git-send-email-jungseoklee85@gmail.com>

There is no room to adjust 'atom_size' now when a generic percpu area
is used. It would be redundant to write down an architecture-specific
setup_per_cpu_areas() in order to only change the 'atom_size'. Thus,
this patch adds a new definition, PERCPU_ATOM_SIZE, which is PAGE_SIZE
by default. The value could be updated if needed by architecture.

Signed-off-by: Jungseok Lee <jungseoklee85@gmail.com>
---
 include/linux/percpu.h | 4 ++++
 mm/percpu.c            | 6 +++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index 4bc6daf..57a2f16 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -18,6 +18,10 @@
 #define PERCPU_MODULE_RESERVE		0
 #endif
 
+#ifndef PERCPU_ATOM_SIZE
+#define PERCPU_ATOM_SIZE		PAGE_SIZE
+#endif
+
 /* minimum unit size, also is the maximum supported allocation size */
 #define PCPU_MIN_UNIT_SIZE		PFN_ALIGN(32 << 10)
 
diff --git a/mm/percpu.c b/mm/percpu.c
index a63b4d8..cd1e0ec 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -2201,8 +2201,8 @@ void __init setup_per_cpu_areas(void)
 	 * what the legacy allocator did.
 	 */
 	rc = pcpu_embed_first_chunk(PERCPU_MODULE_RESERVE,
-				    PERCPU_DYNAMIC_RESERVE, PAGE_SIZE, NULL,
-				    pcpu_dfl_fc_alloc, pcpu_dfl_fc_free);
+				    PERCPU_DYNAMIC_RESERVE, PERCPU_ATOM_SIZE,
+				    NULL, pcpu_dfl_fc_alloc, pcpu_dfl_fc_free);
 	if (rc < 0)
 		panic("Failed to initialize percpu areas.");
 
@@ -2231,7 +2231,7 @@ void __init setup_per_cpu_areas(void)
 
 	ai = pcpu_alloc_alloc_info(1, 1);
 	fc = memblock_virt_alloc_from_nopanic(unit_size,
-					      PAGE_SIZE,
+					      PERCPU_ATOM_SIZE,
 					      __pa(MAX_DMA_ADDRESS));
 	if (!ai || !fc)
 		panic("Failed to allocate memory for percpu areas.");
-- 
2.5.0

--
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:[~2015-11-01  7:46 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-01  7:46 [PATCH v6 0/3] Introduce IRQ stack on arm64 with percpu changes Jungseok Lee
2015-11-01  7:46 ` [PATCH v6 1/3] percpu: remove PERCPU_ENOUGH_ROOM which is stale definition Jungseok Lee
2015-11-02 16:08   ` Christoph Lameter
2015-11-02 19:10   ` Tejun Heo
2015-11-03 14:12     ` Jungseok Lee
2015-11-03 22:07       ` Tejun Heo
2015-11-04 13:19         ` Jungseok Lee
2015-11-01  7:46 ` Jungseok Lee [this message]
2015-11-02 16:10   ` [PATCH v6 2/3] percpu: add PERCPU_ATOM_SIZE for a generic percpu area setup Christoph Lameter
2015-11-02 16:22     ` Catalin Marinas
2015-11-02 16:48       ` Christoph Lameter
2015-11-02 17:35         ` Catalin Marinas
2015-11-02 18:11           ` Christoph Lameter
2015-11-02 18:31             ` Catalin Marinas
2015-11-03 13:49       ` Jungseok Lee
2015-11-03 17:58         ` James Morse
2015-11-04 13:35           ` Jungseok Lee
2015-11-03 14:11     ` Jungseok Lee
2015-11-01  7:46 ` [PATCH v6 3/3] arm64: Introduce IRQ stack Jungseok Lee

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=1446363977-23656-3-git-send-email-jungseoklee85@gmail.com \
    --to=jungseoklee85@gmail.com \
    --cc=barami97@gmail.com \
    --cc=catalin.marinas@arm.com \
    --cc=cl@linux.com \
    --cc=james.morse@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mark.rutland@arm.com \
    --cc=takahiro.akashi@linaro.org \
    --cc=tj@kernel.org \
    --cc=will.deacon@arm.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 NNTP newsgroup(s).