From patchwork Tue Mar 9 10:21:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pingfan Liu X-Patchwork-Id: 12124623 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7A4DDC433E0 for ; Tue, 9 Mar 2021 10:23:43 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0783265268 for ; Tue, 9 Mar 2021 10:23:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0783265268 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=w6anQFFv2nYoao/blmpCY9K1iUUcJRanOdes/OES07w=; b=Fsx+ndxz1xm1Uiqe/OLjHAX+5L R0ptfF7TIyqbKKC5VJOezbb/S2aJ6qGxcDjXG+PjKZwkW3xICQgoE65ryqE5WA+Sokl3L89HQ4zni sg9g3zhbw7VnNXAf0dfDC1SA9pO4NaCJMEVcRPh7S0N7GFR8OdTUcoh+BLJl4ikLu9DDfgC0LcSGQ soig28E+F6m3/VsZQZtyjtu+U3xGLubJ+qiKTYq51omGICm0owy3hiEyK9g4FA8+XxIcCozzSOlrz yGMN3TUfzBtDCxEbNxQmzqUX5axGBqN0a4tr40fqQVvmFc8BAkj+ziUye5NiRV4Px583NZcMQkYqD DbwEuUiw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lJZV1-004CWF-08; Tue, 09 Mar 2021 10:21:59 +0000 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lJZUw-004CVn-6j for linux-arm-kernel@lists.infradead.org; Tue, 09 Mar 2021 10:21:56 +0000 Received: by mail-pg1-x52f.google.com with SMTP id l2so8454010pgb.1 for ; Tue, 09 Mar 2021 02:21:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=AOI9/EqQrWdE1XESO6SiB4zNNccVCN+InRdKPMsv6ZA=; b=Exoq3HoofPOZMBhQj8V5+8/q7J169b3L54UWET7r2uZfiB2oi6IxyUZ9lKLtmdkdmZ pjupiiPfDu9vrGkLmjdQ8gm+3t5zVWwyVDfF3ynDVa0f86BOLGPkcpRAqFBhm5lFO7HF fRGoLB7QT84dZsESh2xKZUnpgu/IpT4y3vGqhN9ZtyuqMPMDw1a2mSfvtjR6aM4baOSU 7Y2u21OvPPKqhs1cYOcBci8b8E6FqwdUQdYanEW4Fq+HOhKjwlAB6KxBqZDvWgCdtNt2 H9PXoiSgN0pMjvdiXeJBR9CSjsqlErnpYDiO7MvritIZMQ3ul2fRnbQwTGEfOlvTH96X QbFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=AOI9/EqQrWdE1XESO6SiB4zNNccVCN+InRdKPMsv6ZA=; b=HYKGXggWJHBYI14Eo/sFrcrRwWI0xwoeli9yCnqg6dpzn6X5diBAtgs133yw5Qsymz 0hCOcRIY6BF0nYWeCfhZjkIFp3U3YwyX1WjmUPgDGuVrkUXVxHJT8EA3BTrl0WPV3/1I DaUo7iGfTeE2Ohhkxecx7wGYAE6E6ELEIQmyeNFMr/gN1ELQMvq8ZtbKTkjgQzS+8QBz 5yFfvFaL5GGYWatLN0BqI518eeoBzLoi5NHscLLcXbeBAxQePwrhchXwzeanIvscocBv zb69e0YO1fgu1vOeVFHxH4of+bYBGi003E42gB6oQKo7CSDB7euIKRL3ruFudKDM6ckV 52Ow== X-Gm-Message-State: AOAM53343GiG+2S3AjnODYe+0BC+SUDnEGx0fc5c4JO1K1MoRe/mIIp9 X6MGfbuPgaScSxbrVU32ODlPARoxmQ== X-Google-Smtp-Source: ABdhPJydmJHzGO3Hgi0h1shnHNFFD6gaTmEsOuDe4xO9d2hmTn30SxQP3m4yWf//aBgiaVLXuerzvg== X-Received: by 2002:a65:4c86:: with SMTP id m6mr16579465pgt.174.1615285312103; Tue, 09 Mar 2021 02:21:52 -0800 (PST) Received: from x1pad.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id m7sm2513396pjc.54.2021.03.09.02.21.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Mar 2021 02:21:51 -0800 (PST) From: Pingfan Liu To: linux-arm-kernel@lists.infradead.org Cc: Pingfan Liu , Catalin Marinas , Will Deacon , Greg Kroah-Hartman , "Rafael J. Wysocki" , Atish Patra , linux-kernel@vger.kernel.org Subject: [PATCH] drivers/arch_numa: remove rebudant setup_per_cpu_areas() Date: Tue, 9 Mar 2021 18:21:38 +0800 Message-Id: <20210309102138.41170-1-kernelfans@gmail.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210309_102154_361610_C810248B X-CRM114-Status: GOOD ( 12.30 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org There are two identical implementations of setup_per_cpu_areas() in mm/percpu.c and drivers/base/arch_numa.c. Hence removing the one in arch_numa.c. And let arm64 drop HAVE_SETUP_PER_CPU_AREA. Signed-off-by: Pingfan Liu Cc: Catalin Marinas Cc: Will Deacon Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Cc: Atish Patra Cc: linux-kernel@vger.kernel.org To: linux-arm-kernel@lists.infradead.org --- arch/arm64/Kconfig | 4 ---- drivers/base/arch_numa.c | 22 ---------------------- 2 files changed, 26 deletions(-) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 1f212b47a48a..d4bf8be0c3d5 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -1022,10 +1022,6 @@ config USE_PERCPU_NUMA_NODE_ID def_bool y depends on NUMA -config HAVE_SETUP_PER_CPU_AREA - def_bool y - depends on NUMA - config NEED_PER_CPU_EMBED_FIRST_CHUNK def_bool y depends on NUMA diff --git a/drivers/base/arch_numa.c b/drivers/base/arch_numa.c index 4cc4e117727d..23e1e419a83d 100644 --- a/drivers/base/arch_numa.c +++ b/drivers/base/arch_numa.c @@ -167,28 +167,6 @@ static void __init pcpu_fc_free(void *ptr, size_t size) { memblock_free_early(__pa(ptr), size); } - -void __init setup_per_cpu_areas(void) -{ - unsigned long delta; - unsigned int cpu; - int rc; - - /* - * Always reserve area for module percpu variables. That's - * what the legacy allocator did. - */ - rc = pcpu_embed_first_chunk(PERCPU_MODULE_RESERVE, - PERCPU_DYNAMIC_RESERVE, PAGE_SIZE, - pcpu_cpu_distance, - pcpu_fc_alloc, pcpu_fc_free); - if (rc < 0) - panic("Failed to initialize percpu areas."); - - delta = (unsigned long)pcpu_base_addr - (unsigned long)__per_cpu_start; - for_each_possible_cpu(cpu) - __per_cpu_offset[cpu] = delta + pcpu_unit_offsets[cpu]; -} #endif /**