Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933204AbdGXXI7 (ORCPT ); Mon, 24 Jul 2017 19:08:59 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:59548 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756958AbdGXXCs (ORCPT ); Mon, 24 Jul 2017 19:02:48 -0400 From: Dennis Zhou To: Tejun Heo , Christoph Lameter , Josef Bacik CC: , , , Dennis Zhou Subject: [PATCH v2 07/23] percpu: setup_first_chunk rename schunk/dchunk to chunk Date: Mon, 24 Jul 2017 19:02:04 -0400 Message-ID: <20170724230220.21774-8-dennisz@fb.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170724230220.21774-1-dennisz@fb.com> References: <20170724230220.21774-1-dennisz@fb.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [192.168.52.123] X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-07-24_14:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2093 Lines: 57 From: "Dennis Zhou (Facebook)" 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 --- 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