linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Noam Camus <noamca@mellanox.com>
Cc: <decot@googlers.com>, <ben@decadent.org.uk>,
	<davem@davemloft.net>, <linux-kernel@vger.kernel.org>,
	<xinhui@linux.vnet.ibm.com>
Subject: Re: [PATCH v5] lib/bitmap.c: enhance bitmap syntax
Date: Tue, 13 Sep 2016 15:54:20 -0700	[thread overview]
Message-ID: <20160913155420.bcaf693f52109e8ac390b541@linux-foundation.org> (raw)
In-Reply-To: <1473579629-4283-1-git-send-email-noamca@mellanox.com>

On Sun, 11 Sep 2016 10:40:29 +0300 Noam Camus <noamca@mellanox.com> wrote:

> From: Noam Camus <noamca@mellanox.com>
> 
> Today there are platforms with many CPUs (up to 4K).
> Trying to boot only part of the CPUs may result in too long string.
> 
> For example lets take NPS platform that is part of arch/arc.
> This platform have SMP system with 256 cores each with
> 16 HW threads (SMT machine) where HW thread appears as CPU to the kernel.
> In this example there is total of 4K CPUs.
> When one tries to boot only part of the HW threads from each core the
> string representing the map may be long...
> For example if for sake of performance we decided to boot only first half
> of HW threads of each core the map will look like:
> 0-7,16-23,32-39,...,4080-4087
> 
> This patch introduce new syntax to accommodate with such use case.
> I added an optional postfix to a range of CPUs which will choose
> according to given modulo the desired range of reminders i.e.:
>     <cpus range>:sed_size/group_size
> 
> For example, above map can be described in new syntax like this:
> 0-4095:8/16
> 
> Note that this patch is backward compatible with current syntax.
> 
> Signed-off-by: Noam Camus <noamca@mellanox.com>
> ---
>  Documentation/kernel-parameters.txt |   15 ++++++++++
>  lib/bitmap.c                        |   50 ++++++++++++++++++++++++++++++++---
>  2 files changed, 61 insertions(+), 4 deletions(-)
> 
> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
> index 623502e..4f1e95b 100644
> --- a/Documentation/kernel-parameters.txt
> +++ b/Documentation/kernel-parameters.txt
> @@ -33,6 +33,21 @@ can also be entered as
>  Double-quotes can be used to protect spaces in values, e.g.:
>  	param="spaces in here"
>  
> +Some of the kernel parameters takes list of CPUs as value e.g.:
> +isolcpus, task_isolation, nohz_full, irqaffinity, rcu_nocbs.

I don't think we have a "task_isolation".  What are you trying to
refer to here?

> +The format of this list is:
> +<cpu number>,...,<cpu number>
> +or
> +<cpu number>-<cpu number>
> +(must be a positive range in ascending order)
> +or a mixture
> +<cpu number>,...,<cpu number>-<cpu number>
> +Note that for special case of range one can split range into equal size of groups
> +and for each group to use some amount form the begin of that group.
> +<cpu number>-cpu number>:<used size>/<group size>
> +For example one can add to its command line following parameter:
> +isolcpus=1,2,10-20,100-2000:2/25
> +

I think we can do better here.  Please review:

--- a/Documentation/kernel-parameters.txt~lib-bitmapc-enhance-bitmap-syntax-fix
+++ a/Documentation/kernel-parameters.txt
@@ -33,20 +33,36 @@ can also be entered as
 Double-quotes can be used to protect spaces in values, e.g.:
 	param="spaces in here"
 
-Some of the kernel parameters takes list of CPUs as value e.g.:
-isolcpus, task_isolation, nohz_full, irqaffinity, rcu_nocbs.
-The format of this list is:
-<cpu number>,...,<cpu number>
+cpu lists:
+----------
+
+Some kernel parameters take a list of CPUs as a value, e.g.  isolcpus,
+nohz_full, irqaffinity, rcu_nocbs.  The format of this list is:
+
+	<cpu number>,...,<cpu number>
+
 or
-<cpu number>-<cpu number>
-(must be a positive range in ascending order)
+
+	<cpu number>-<cpu number>
+	(must be a positive range in ascending order)
+
 or a mixture
+
 <cpu number>,...,<cpu number>-<cpu number>
-Note that for special case of range one can split range into equal size of groups
-and for each group to use some amount form the begin of that group.
-<cpu number>-cpu number>:<used size>/<group size>
-For example one can add to its command line following parameter:
-isolcpus=1,2,10-20,100-2000:2/25
+
+Note that for the special case of a range one can split the range into equal
+sized groups and for each group use some amount from the beginning of that
+group:
+
+	<cpu number>-cpu number>:<used size>/<group size>
+
+For example one can add to the command line following parameter:
+
+	isolcpus=1,2,10-20,100-2000:2/25
+
+where the final item represents CPUs 100,101,125,126,150,151,...
+
+
 
 This document may not be entirely up to date and comprehensive. The command
 "modinfo -p ${modulename}" shows a current list of all parameters of a loadable
@@ -1776,13 +1792,7 @@ bytes respectively. Such letter suffixes
 			See Documentation/filesystems/nfs/nfsroot.txt.
 
 	irqaffinity=	[SMP] Set the default irq affinity mask
-			Format:
-			<cpu number>,...,<cpu number>
-			or
-			<cpu number>-<cpu number>
-			(must be a positive range in ascending order)
-			or a mixture
-			<cpu number>,...,<cpu number>-<cpu number>
+			The argument is a cpu list, as described above.
 
 	irqfixup	[HW]
 			When an interrupt is not handled search all handlers
@@ -1799,13 +1809,7 @@ bytes respectively. Such letter suffixes
 			Format: <RDP>,<reset>,<pci_scan>,<verbosity>
 
 	isolcpus=	[KNL,SMP] Isolate CPUs from the general scheduler.
-			Format:
-			<cpu number>,...,<cpu number>
-			or
-			<cpu number>-<cpu number>
-			(must be a positive range in ascending order)
-			or a mixture
-			<cpu number>,...,<cpu number>-<cpu number>
+			The argument is a cpu list, as described above.
 
 			This option can be used to specify one or more CPUs
 			to isolate from the general SMP balancing and scheduling
@@ -2666,6 +2670,7 @@ bytes respectively. Such letter suffixes
 			Default: on
 
 	nohz_full=	[KNL,BOOT]
+			The argument is a cpu list, as described above.
 			In kernels built with CONFIG_NO_HZ_FULL=y, set
 			the specified list of CPUs whose tick will be stopped
 			whenever possible. The boot CPU will be forced outside
@@ -3268,6 +3273,8 @@ bytes respectively. Such letter suffixes
 			See Documentation/blockdev/ramdisk.txt.
 
 	rcu_nocbs=	[KNL]
+			The argument is a cpu list, as described above.
+
 			In kernels built with CONFIG_RCU_NOCB_CPU=y, set
 			the specified list of CPUs to be no-callback CPUs.
 			Invocation of these CPUs' RCU callbacks will

  reply	other threads:[~2016-09-13 22:54 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-16  7:57 [PATCH] lib/bitmap.c: enhance map pattern Noam Camus
2016-07-16 12:09 ` Ben Hutchings
2016-07-17  6:33 ` [PATCH v2] lib/bitmap.c: enhance bitmap syntax Noam Camus
2016-07-17  8:10   ` [PATCH v3] " Noam Camus
2016-07-17 13:50     ` Pan Xinhui
2016-07-17 13:59       ` Pan Xinhui
2016-07-18  7:06         ` Noam Camus
2016-08-01  4:53           ` Noam Camus
2016-09-06  9:12           ` Noam Camus
2016-09-06 13:36             ` Ben Hutchings
2016-09-08 15:33     ` [PATCH v4] " Noam Camus
2016-09-08 22:19       ` Andrew Morton
2016-09-11  7:40       ` [PATCH v5] " Noam Camus
2016-09-13 22:54         ` Andrew Morton [this message]
2016-09-14  6:52           ` Noam Camus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160913155420.bcaf693f52109e8ac390b541@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=ben@decadent.org.uk \
    --cc=davem@davemloft.net \
    --cc=decot@googlers.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=noamca@mellanox.com \
    --cc=xinhui@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).