diff options
| author | Yury Norov <[email protected]> | 2021-04-21 03:13:25 +0000 |
|---|---|---|
| committer | Paul E. McKenney <[email protected]> | 2021-05-10 22:38:20 +0000 |
| commit | b18def121f077857ccf92fc620366e19850bc297 (patch) | |
| tree | b19cef760cf5a2e53c37633b6cfb365c75c6abac /lib/bitmap.c | |
| parent | Linux 5.13-rc1 (diff) | |
| download | kernel-b18def121f077857ccf92fc620366e19850bc297.tar.gz kernel-b18def121f077857ccf92fc620366e19850bc297.zip | |
bitmap_parse: Support 'all' semantics
RCU code supports an 'all' group as a special case when parsing rcu_nocbs
parameter. This patch moves the 'all' support to the core bitmap_parse
code, so that all bitmap users can enjoy this extension.
Moving 'all' parsing to a bitmap_parse level also allows users to pass
patterns together with 'all' in regular group:pattern format, for example,
"rcu_nocbs=all:1/2" would offload all the even-numbered CPUs regardless
of the number of CPUs on the system.
Reviewed-by: Andy Shevchenko <[email protected]>
Signed-off-by: Yury Norov <[email protected]>
Signed-off-by: Paul E. McKenney <[email protected]>
Diffstat (limited to 'lib/bitmap.c')
| -rw-r--r-- | lib/bitmap.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/bitmap.c b/lib/bitmap.c index 74ceb02f45e3..6e29b2aae6ba 100644 --- a/lib/bitmap.c +++ b/lib/bitmap.c @@ -581,6 +581,14 @@ static const char *bitmap_parse_region(const char *str, struct region *r) { unsigned int lastbit = r->nbits - 1; + if (!strncasecmp(str, "all", 3)) { + r->start = 0; + r->end = lastbit; + str += 3; + + goto check_pattern; + } + str = bitmap_getnum(str, &r->start, lastbit); if (IS_ERR(str)) return str; @@ -595,6 +603,7 @@ static const char *bitmap_parse_region(const char *str, struct region *r) if (IS_ERR(str)) return str; +check_pattern: if (end_of_region(*str)) goto no_pattern; |
