Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1695241 > unrolled thread

[PATCH v2 07/23] percpu: setup_first_chunk rename schunk/dchunk to chunk

Started byDennis Zhou <dennisz@fb.com>
First post2017-07-25 01:10 +0200
Last post2017-07-25 20:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v2 07/23] percpu: setup_first_chunk rename schunk/dchunk to chunk Dennis Zhou <dennisz@fb.com> - 2017-07-25 01:10 +0200
    Re: [PATCH v2 07/23] percpu: setup_first_chunk rename schunk/dchunk  to chunk Josef Bacik <josef@toxicpanda.com> - 2017-07-25 20:20 +0200

#1695241 — [PATCH v2 07/23] percpu: setup_first_chunk rename schunk/dchunk to chunk

FromDennis Zhou <dennisz@fb.com>
Date2017-07-25 01:10 +0200
Subject[PATCH v2 07/23] percpu: setup_first_chunk rename schunk/dchunk to chunk
Message-ID<u6UEa-3ig-27@gated-at.bofh.it>
From: "Dennis Zhou (Facebook)" <dennisszhou@gmail.com>

There is no need to have the static chunk and dynamic chunk be named
separately as the allocations are sequential. This preemptively solves
the misnomer problem with the base_addrs being moved up in the following
patch. It also removes a ternary operation deciding the first chunk.

Signed-off-by: Dennis Zhou <dennisszhou@gmail.com>
---
 mm/percpu.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/mm/percpu.c b/mm/percpu.c
index 1d2c980..e08ed61 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -1602,7 +1602,7 @@ int __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai,
 	static int smap[PERCPU_DYNAMIC_EARLY_SLOTS] __initdata;
 	static int dmap[PERCPU_DYNAMIC_EARLY_SLOTS] __initdata;
 	size_t size_sum = ai->static_size + ai->reserved_size + ai->dyn_size;
-	struct pcpu_chunk *schunk, *dchunk = NULL;
+	struct pcpu_chunk *chunk;
 	unsigned long *group_offsets;
 	size_t *group_sizes;
 	unsigned long *unit_off;
@@ -1720,22 +1720,22 @@ int __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai,
 	 */
 	start_offset = ai->static_size;
 	map_size = ai->reserved_size ?: ai->dyn_size;
-	schunk = pcpu_alloc_first_chunk(base_addr, start_offset, map_size,
-					smap, ARRAY_SIZE(smap));
+	chunk = pcpu_alloc_first_chunk(base_addr, start_offset, map_size, smap,
+				       ARRAY_SIZE(smap));
 
 	/* init dynamic chunk if necessary */
 	if (ai->reserved_size) {
-		pcpu_reserved_chunk = schunk;
+		pcpu_reserved_chunk = chunk;
 
 		start_offset = ai->static_size + ai->reserved_size;
 		map_size = ai->dyn_size;
-		dchunk = pcpu_alloc_first_chunk(base_addr, start_offset,
-						map_size, dmap,
-						ARRAY_SIZE(dmap));
+		chunk = pcpu_alloc_first_chunk(base_addr, start_offset,
+					       map_size, dmap,
+					       ARRAY_SIZE(dmap));
 	}
 
 	/* link the first chunk in */
-	pcpu_first_chunk = dchunk ?: schunk;
+	pcpu_first_chunk = chunk;
 	i = (pcpu_first_chunk->start_offset) ? 1 : 0;
 	pcpu_nr_empty_pop_pages +=
 		pcpu_count_occupied_pages(pcpu_first_chunk, i);
-- 
2.9.3

[toc] | [next] | [standalone]


#1696001 — Re: [PATCH v2 07/23] percpu: setup_first_chunk rename schunk/dchunk to chunk

FromJosef Bacik <josef@toxicpanda.com>
Date2017-07-25 20:20 +0200
SubjectRe: [PATCH v2 07/23] percpu: setup_first_chunk rename schunk/dchunk to chunk
Message-ID<u7cB3-6fC-5@gated-at.bofh.it>
In reply to#1695241
On Mon, Jul 24, 2017 at 07:02:04PM -0400, Dennis Zhou wrote:
> From: "Dennis Zhou (Facebook)" <dennisszhou@gmail.com>
> 
> There is no need to have the static chunk and dynamic chunk be named
> separately as the allocations are sequential. This preemptively solves
> the misnomer problem with the base_addrs being moved up in the following
> patch. It also removes a ternary operation deciding the first chunk.
> 
> Signed-off-by: Dennis Zhou <dennisszhou@gmail.com>

Reviewed-by: Josef Bacik <jbacik@fb.com>

Thanks,

Josef

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web