lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 22 Jun 2021 18:37:08 +0800
From:   "Jiangong.Han" <jiangong.han@...driver.com>
To:     dave@...olabs.net, paulmck@...nel.org, josh@...htriplett.org,
        rostedt@...dmis.org, mathieu.desnoyers@...icios.com,
        jiangshanlai@...il.com, joel@...lfernandes.org
Cc:     linux-kernel@...r.kernel.org, rcu@...r.kernel.org,
        "Jiangong.Han" <jiangong.han@...driver.com>
Subject: [PATCH] rcu-scale: rcu-scale returns one less than the real number of gps in the dmesg report.

The dmesg report on rcu-scale shows there are N grace periods, and gps
are listed from 0 to N.
This commit make writer_n_durations stores the counts of gps,
and shows there are N+1 gps, change the listed gps index begin from 0 to N.

From
    [ 8306.087880] rcu-scale: writer 0 gps: 133
    ......
    [ 8307.864630] rcu-scale:    0 writer-duration:     0 44003961
    [ 8307.935711] rcu-scale:    0 writer-duration:     1 32003582
    ......
    [ 8316.472860] rcu-scale:    0 writer-duration:   132 28004391
    [ 8316.538498] rcu-scale:    0 writer-duration:   133 27996410

to
    [ 8306.087880] rcu-scale: writer 0 gps: 134
    ......
    [ 8307.864630] rcu-scale:    0 writer-duration:     0 44003961
    [ 8307.935711] rcu-scale:    0 writer-duration:     1 32003582
    ......
    [ 8316.472860] rcu-scale:    0 writer-duration:   132 28004391
    [ 8316.538498] rcu-scale:    0 writer-duration:   133 27996410

Signed-off-by: Jiangong.Han <jiangong.han@...driver.com>
---
 kernel/rcu/rcuscale.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/rcu/rcuscale.c b/kernel/rcu/rcuscale.c
index dca51fe9c73f..2cc34a22a506 100644
--- a/kernel/rcu/rcuscale.c
+++ b/kernel/rcu/rcuscale.c
@@ -487,7 +487,7 @@ rcu_scale_writer(void *arg)
 	if (gp_async) {
 		cur_ops->gp_barrier();
 	}
-	writer_n_durations[me] = i_max;
+	writer_n_durations[me] = i_max + 1;
 	torture_kthread_stopping("rcu_scale_writer");
 	return 0;
 }
@@ -561,7 +561,7 @@ rcu_scale_cleanup(void)
 			wdpp = writer_durations[i];
 			if (!wdpp)
 				continue;
-			for (j = 0; j <= writer_n_durations[i]; j++) {
+			for (j = 0; j < writer_n_durations[i]; j++) {
 				wdp = &wdpp[j];
 				pr_alert("%s%s %4d writer-duration: %5d %llu\n",
 					scale_type, SCALE_FLAG,
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ