From patchwork Mon Feb 13 09:43:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 93844 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1013734qgi; Mon, 13 Feb 2017 01:49:22 -0800 (PST) X-Received: by 10.99.95.87 with SMTP id t84mr25894533pgb.209.1486979362812; Mon, 13 Feb 2017 01:49:22 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 88si2012928plf.32.2017.02.13.01.49.22; Mon, 13 Feb 2017 01:49:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752194AbdBMJtV (ORCPT + 25 others); Mon, 13 Feb 2017 04:49:21 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:39546 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751007AbdBMJtU (ORCPT ); Mon, 13 Feb 2017 04:49:20 -0500 Received: from 172.24.1.136 (EHLO SZXEML423-HUB.china.huawei.com) ([172.24.1.136]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id DUL41125; Mon, 13 Feb 2017 17:47:43 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by SZXEML423-HUB.china.huawei.com (10.82.67.154) with Microsoft SMTP Server id 14.3.235.1; Mon, 13 Feb 2017 17:47:33 +0800 From: Kefeng Wang To: Ingo Molnar , Peter Zijlstra , CC: , Kefeng Wang , "Prarit Bhargava" Subject: [PATCH] sched/isolcpus: Show isolated cpu map Date: Mon, 13 Feb 2017 17:43:59 +0800 Message-ID: <1486979039-17874-1-git-send-email-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020205.58A180C0.0243, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: e95f55dc7c1b8c32c31663ac1fcd5aec Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The commit a6e4491c682a ("sched/isolcpus: Output warning when the 'isolcpus=' kernel parameter is invalid") adds an error message when specified cpu bigger than nr_cpu_ids, but nr_cpumask_bits in cpulist_parse() could be nr_cpu_ids or NR_CPUS. eg, NR_CPUS=64, nr_cpu_ids=8 in ARM64, cpulist_parse() won't return -ERANGE if isolcpus=1-10; Let's show the isolated cpu map and drop the improper error message. Cc: Prarit Bhargava Cc: Peter Zijlstra Cc: Ingo Molnar Signed-off-by: Kefeng Wang --- kernel/sched/core.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) -- 1.7.12.4 diff --git a/kernel/sched/core.c b/kernel/sched/core.c index c56fb57..13a122d 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -6076,13 +6076,16 @@ static void update_top_cache_domain(int cpu) /* Setup the mask of cpus configured for isolated domains */ static int __init isolated_cpu_setup(char *str) { - int ret; + int cpu; alloc_bootmem_cpumask_var(&cpu_isolated_map); - ret = cpulist_parse(str, cpu_isolated_map); - if (ret) { - pr_err("sched: Error, all isolcpus= values must be between 0 and %d\n", nr_cpu_ids); - return 0; + cpulist_parse(str, cpu_isolated_map); + + if (!cpumask_empty(cpu_isolated_map)) { + pr_cont("sched: isolated cpus [ "); + for_each_cpu(cpu, cpu_isolated_map) + pr_cont("%d ", cpu); + pr_cont("]\n"); } return 1; }