When building locktorture test into kernel image, it keeps printing out stats information even though there is no lock type specified.
There is already verbose parameter to control print, but it is read-only, so it can't be changed at runtime. Make verbose read-write and control stats print.
Signed-off-by: Yang Shi yang.shi@linaro.org --- include/linux/torture.h | 2 ++ kernel/locking/locktorture.c | 11 +++++++---- 2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/include/linux/torture.h b/include/linux/torture.h index 7759fc3..86d6e54 100644 --- a/include/linux/torture.h +++ b/include/linux/torture.h @@ -48,6 +48,8 @@ do { if (verbose) pr_alert("%s" TORTURE_FLAG " %s\n", torture_type, s); } while (0) #define VERBOSE_TOROUT_ERRSTRING(s) \ do { if (verbose) pr_alert("%s" TORTURE_FLAG "!!! %s\n", torture_type, s); } while (0) +#define VERBOSE_STRING(s) \ + do { if (verbose) pr_alert("%s", s); } while (0)
/* Definitions for online/offline exerciser. */ int torture_onoff_init(long ooholdoff, long oointerval); diff --git a/kernel/locking/locktorture.c b/kernel/locking/locktorture.c index 8ef1919..d9838a3 100644 --- a/kernel/locking/locktorture.c +++ b/kernel/locking/locktorture.c @@ -55,8 +55,11 @@ torture_param(int, shutdown_secs, 0, "Shutdown time (j), <= zero to disable."); torture_param(int, stat_interval, 60, "Number of seconds between stats printk()s"); torture_param(int, stutter, 5, "Number of jiffies to run/halt test, 0=disable"); -torture_param(bool, verbose, true, - "Enable verbose debugging printk()s"); + +static bool verbose = true; +module_param(verbose, bool, 0644); +MODULE_PARM_DESC(verbose, + "Enable verbose debugging printk()s");
static char *torture_type = "spin_lock"; module_param(torture_type, charp, 0444); @@ -693,7 +696,7 @@ static void lock_torture_stats_print(void) }
__torture_print_stats(buf, cxt.lwsa, true); - pr_alert("%s", buf); + VERBOSE_STRING(buf); kfree(buf);
if (cxt.cur_ops->readlock) { @@ -705,7 +708,7 @@ static void lock_torture_stats_print(void) }
__torture_print_stats(buf, cxt.lrsa, false); - pr_alert("%s", buf); + VERBOSE_STRING(buf); kfree(buf); } }
On Fri, Apr 15, 2016 at 01:28:11PM -0700, Yang Shi wrote:
When building locktorture test into kernel image, it keeps printing out stats information even though there is no lock type specified.
There is already verbose parameter to control print, but it is read-only, so it can't be changed at runtime. Make verbose read-write and control stats print.
Signed-off-by: Yang Shi yang.shi@linaro.org
Interesting change!
But just out of curiosity, when you boot with locktorture built in, do you specify the shutdown_secs boot parameter? If so, another approach would be to shutdown immediately upon detecting an error during initialization.
If not, I would like to know more about your use case.
Thanx, Paul
include/linux/torture.h | 2 ++ kernel/locking/locktorture.c | 11 +++++++---- 2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/include/linux/torture.h b/include/linux/torture.h index 7759fc3..86d6e54 100644 --- a/include/linux/torture.h +++ b/include/linux/torture.h @@ -48,6 +48,8 @@ do { if (verbose) pr_alert("%s" TORTURE_FLAG " %s\n", torture_type, s); } while (0) #define VERBOSE_TOROUT_ERRSTRING(s) \ do { if (verbose) pr_alert("%s" TORTURE_FLAG "!!! %s\n", torture_type, s); } while (0) +#define VERBOSE_STRING(s) \
- do { if (verbose) pr_alert("%s", s); } while (0)
/* Definitions for online/offline exerciser. */ int torture_onoff_init(long ooholdoff, long oointerval); diff --git a/kernel/locking/locktorture.c b/kernel/locking/locktorture.c index 8ef1919..d9838a3 100644 --- a/kernel/locking/locktorture.c +++ b/kernel/locking/locktorture.c @@ -55,8 +55,11 @@ torture_param(int, shutdown_secs, 0, "Shutdown time (j), <= zero to disable."); torture_param(int, stat_interval, 60, "Number of seconds between stats printk()s"); torture_param(int, stutter, 5, "Number of jiffies to run/halt test, 0=disable"); -torture_param(bool, verbose, true,
"Enable verbose debugging printk()s");
+static bool verbose = true; +module_param(verbose, bool, 0644); +MODULE_PARM_DESC(verbose,
"Enable verbose debugging printk()s");
static char *torture_type = "spin_lock"; module_param(torture_type, charp, 0444); @@ -693,7 +696,7 @@ static void lock_torture_stats_print(void) }
__torture_print_stats(buf, cxt.lwsa, true);
- pr_alert("%s", buf);
VERBOSE_STRING(buf); kfree(buf);
if (cxt.cur_ops->readlock) {
@@ -705,7 +708,7 @@ static void lock_torture_stats_print(void) }
__torture_print_stats(buf, cxt.lrsa, false);
pr_alert("%s", buf);
kfree(buf); }VERBOSE_STRING(buf);
}
2.0.2
On 4/15/2016 4:26 PM, Paul E. McKenney wrote:
On Fri, Apr 15, 2016 at 01:28:11PM -0700, Yang Shi wrote:
When building locktorture test into kernel image, it keeps printing out stats information even though there is no lock type specified.
There is already verbose parameter to control print, but it is read-only, so it can't be changed at runtime. Make verbose read-write and control stats print.
Signed-off-by: Yang Shi yang.shi@linaro.org
Interesting change!
But just out of curiosity, when you boot with locktorture built in, do you specify the shutdown_secs boot parameter? If so, another
No, just use the default value, which is 0 for shutdown_secs.
approach would be to shutdown immediately upon detecting an error during initialization.
In my case, it looks there is not error involved.
If not, I would like to know more about your use case.
In my test, I just built locktorture test into kernel instead of a module then check how it behaves, no specific purpose.
It sounds like not a normal approach to use it.
Thanks, Yang
Thanx, Paul
include/linux/torture.h | 2 ++ kernel/locking/locktorture.c | 11 +++++++---- 2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/include/linux/torture.h b/include/linux/torture.h index 7759fc3..86d6e54 100644 --- a/include/linux/torture.h +++ b/include/linux/torture.h @@ -48,6 +48,8 @@ do { if (verbose) pr_alert("%s" TORTURE_FLAG " %s\n", torture_type, s); } while (0) #define VERBOSE_TOROUT_ERRSTRING(s) \ do { if (verbose) pr_alert("%s" TORTURE_FLAG "!!! %s\n", torture_type, s); } while (0) +#define VERBOSE_STRING(s) \
do { if (verbose) pr_alert("%s", s); } while (0)
/* Definitions for online/offline exerciser. */ int torture_onoff_init(long ooholdoff, long oointerval);
diff --git a/kernel/locking/locktorture.c b/kernel/locking/locktorture.c index 8ef1919..d9838a3 100644 --- a/kernel/locking/locktorture.c +++ b/kernel/locking/locktorture.c @@ -55,8 +55,11 @@ torture_param(int, shutdown_secs, 0, "Shutdown time (j), <= zero to disable."); torture_param(int, stat_interval, 60, "Number of seconds between stats printk()s"); torture_param(int, stutter, 5, "Number of jiffies to run/halt test, 0=disable"); -torture_param(bool, verbose, true,
"Enable verbose debugging printk()s");
+static bool verbose = true; +module_param(verbose, bool, 0644); +MODULE_PARM_DESC(verbose,
"Enable verbose debugging printk()s");
static char *torture_type = "spin_lock"; module_param(torture_type, charp, 0444);
@@ -693,7 +696,7 @@ static void lock_torture_stats_print(void) }
__torture_print_stats(buf, cxt.lwsa, true);
- pr_alert("%s", buf);
VERBOSE_STRING(buf); kfree(buf);
if (cxt.cur_ops->readlock) {
@@ -705,7 +708,7 @@ static void lock_torture_stats_print(void) }
__torture_print_stats(buf, cxt.lrsa, false);
pr_alert("%s", buf);
kfree(buf); } }VERBOSE_STRING(buf);
-- 2.0.2
On Fri, Apr 15, 2016 at 04:45:32PM -0700, Shi, Yang wrote:
On 4/15/2016 4:26 PM, Paul E. McKenney wrote:
On Fri, Apr 15, 2016 at 01:28:11PM -0700, Yang Shi wrote:
When building locktorture test into kernel image, it keeps printing out stats information even though there is no lock type specified.
There is already verbose parameter to control print, but it is read-only, so it can't be changed at runtime. Make verbose read-write and control stats print.
Signed-off-by: Yang Shi yang.shi@linaro.org
Interesting change!
But just out of curiosity, when you boot with locktorture built in, do you specify the shutdown_secs boot parameter? If so, another
No, just use the default value, which is 0 for shutdown_secs.
approach would be to shutdown immediately upon detecting an error during initialization.
In my case, it looks there is not error involved.
You said that there is no lock type specified, but that should mean that the default ("spin_lock") is chosen. If so, I would expect it to just do the test, at least if locktorture.torture_runnable has been set.
Either way, the usual way to make locktorture shut up would be to boot with locktorture.stat_interval=0.
If not, I would like to know more about your use case.
In my test, I just built locktorture test into kernel instead of a module then check how it behaves, no specific purpose.
It sounds like not a normal approach to use it.
Agreed, I do believe that this is a case of "working as designed".
Thanx, Paul
On 4/15/2016 5:09 PM, Paul E. McKenney wrote:
On Fri, Apr 15, 2016 at 04:45:32PM -0700, Shi, Yang wrote:
On 4/15/2016 4:26 PM, Paul E. McKenney wrote:
On Fri, Apr 15, 2016 at 01:28:11PM -0700, Yang Shi wrote:
When building locktorture test into kernel image, it keeps printing out stats information even though there is no lock type specified.
There is already verbose parameter to control print, but it is read-only, so it can't be changed at runtime. Make verbose read-write and control stats print.
Signed-off-by: Yang Shi yang.shi@linaro.org
Interesting change!
But just out of curiosity, when you boot with locktorture built in, do you specify the shutdown_secs boot parameter? If so, another
No, just use the default value, which is 0 for shutdown_secs.
approach would be to shutdown immediately upon detecting an error during initialization.
In my case, it looks there is not error involved.
You said that there is no lock type specified, but that should mean that the default ("spin_lock") is chosen. If so, I would expect it to just
Yes, spin_lock is chosen by default.
do the test, at least if locktorture.torture_runnable has been set.
But, the default value of torture_runnable is 0. And, it is readonly parameter too. This prevents torture from running if it is built into kernel instead of module.
Actually, I'm confused why there is not LOCK_TORTURE_TEST_RUNNABLE Kconfig like RCU torture?
Thanks, Yang
Either way, the usual way to make locktorture shut up would be to boot with locktorture.stat_interval=0.
If not, I would like to know more about your use case.
In my test, I just built locktorture test into kernel instead of a module then check how it behaves, no specific purpose.
It sounds like not a normal approach to use it.
Agreed, I do believe that this is a case of "working as designed".
Thanx, Paul
On Fri, Apr 15, 2016 at 05:19:27PM -0700, Shi, Yang wrote:
On 4/15/2016 5:09 PM, Paul E. McKenney wrote:
On Fri, Apr 15, 2016 at 04:45:32PM -0700, Shi, Yang wrote:
On 4/15/2016 4:26 PM, Paul E. McKenney wrote:
On Fri, Apr 15, 2016 at 01:28:11PM -0700, Yang Shi wrote:
When building locktorture test into kernel image, it keeps printing out stats information even though there is no lock type specified.
There is already verbose parameter to control print, but it is read-only, so it can't be changed at runtime. Make verbose read-write and control stats print.
Signed-off-by: Yang Shi yang.shi@linaro.org
Interesting change!
But just out of curiosity, when you boot with locktorture built in, do you specify the shutdown_secs boot parameter? If so, another
No, just use the default value, which is 0 for shutdown_secs.
approach would be to shutdown immediately upon detecting an error during initialization.
In my case, it looks there is not error involved.
You said that there is no lock type specified, but that should mean that the default ("spin_lock") is chosen. If so, I would expect it to just
Yes, spin_lock is chosen by default.
do the test, at least if locktorture.torture_runnable has been set.
But, the default value of torture_runnable is 0. And, it is readonly parameter too. This prevents torture from running if it is built into kernel instead of module.
You can specify locktorture.torture_runnable on the kernel command line. That way, you can build a single kernel and decide at boot time whether or not you are going to torture locking.
Actually, I'm confused why there is not LOCK_TORTURE_TEST_RUNNABLE Kconfig like RCU torture?
Because there is much more resistance to Kconfig variables than there used to be. ;-)
Thanx, Paul
Thanks, Yang
Either way, the usual way to make locktorture shut up would be to boot with locktorture.stat_interval=0.
If not, I would like to know more about your use case.
In my test, I just built locktorture test into kernel instead of a module then check how it behaves, no specific purpose.
It sounds like not a normal approach to use it.
Agreed, I do believe that this is a case of "working as designed".
Thanx, Paul
linaro-kernel@lists.linaro.org