From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752590AbdJTItp (ORCPT ); Fri, 20 Oct 2017 04:49:45 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:57245 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752302AbdJTItn (ORCPT ); Fri, 20 Oct 2017 04:49:43 -0400 X-Google-Smtp-Source: ABhQp+Qyph1TUSMCy2pgVVOybbXuiF6eHXg8uZ855pIoPkRFYtQzz2Vv3rz432DcvhgsspulyZypIQ== Date: Fri, 20 Oct 2017 10:49:39 +0200 From: Ingo Molnar To: Rakib Mullick Cc: peterz@infradead.org, mka@chromium.org, longman@redhat.com, adobriyan@gmail.com, tglx@linutronix.de, akpm@linux-foundation.org, tj@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Fix isocpus's param handling when CPUMASK_OFFSTACK=n. Message-ID: <20171020084939.r6ox4o7k2kgezzbk@gmail.com> References: <20171015131820.7173-1-rakib.mullick@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171015131820.7173-1-rakib.mullick@gmail.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Rakib Mullick wrote: > cpulist_parse() uses nr_cpumask_bits as limit to parse the > passed buffer from kernel commandline. What nr_cpumask_bits > represents varies depends upon CONFIG_CPUMASK_OFFSTACK option. > If CONFIG_CPUMASK_OFFSTACK=n, then nr_cpumask_bits is same as > NR_CPUS, which might not represent the # of cpus really exist > (default 64). So, there's a chance of gap between nr_cpu_ids > and NR_CPUS, which ultimately lead towards invalid cpulist_parse() > operation. For example, if isolcpus=9 is passed on a 8 cpu > system (CONFIG_CPUMASK_OFFSTACK=n) it doesn't show the error > that it suppose to. > > This patch fixes this issue by effectively find out the last > cpu of the passed isolcpus list and checking it with nr_cpu_ids. > Also, fixes the error message where the nr_cpu_ids should be > nr_cpu_ids-1, since the cpu numbering starts from 0. > > Signed-off-by: Rakib Mullick > --- > include/linux/cpumask.h | 16 ++++++++++++++++ > kernel/sched/topology.c | 8 +++++--- > 2 files changed, 21 insertions(+), 3 deletions(-) What kernel is this against? It does not apply to the latest kernels. Thanks, Ingo