History

refscale: Prevent hangs for invalid arguments

If an refscale torture-test run is given a bad kvm.sh argument, the test will complain to the console, which is good. What is bad is that from the user's perspective, it will just hang for the time specified by the --duration argument. This commit therefore forces an immediate kernel shutdown if a ref_scale_init()-time error occurs, thus avoiding the appearance of a hang. It also forces a console splat in this case to clearly indicate the presence of an error.

Paul E. McKenney committed 6 years ago

Commit bc80d351 parent 2f2214d1 file · +4 −1Browse files

Unified · Split

kernel/rcu/refscale.c+4−1
@@ -658,7 +658,6 @@ ref_scale_init(void) · 657 unmodified lines
658 for (i = 0; i < ARRAY_SIZE(scale_ops); i++)658 for (i = 0; i < ARRAY_SIZE(scale_ops); i++)
659 pr_cont(" %s", scale_ops[i]->name);659 pr_cont(" %s", scale_ops[i]->name);
660 pr_cont("\n");660 pr_cont("\n");
661 WARN_ON(!IS_MODULE(CONFIG_RCU_REF_SCALE_TEST));
662 firsterr = -EINVAL;661 firsterr = -EINVAL;
663 cur_ops = NULL;662 cur_ops = NULL;
664 goto unwind;663 goto unwind;
@@ -718,6 +717,10 @@ ref_scale_init(void) · 53 unmodified lines
718unwind:717unwind:
719 torture_init_end();718 torture_init_end();
720 ref_scale_cleanup();719 ref_scale_cleanup();
720 if (shutdown) {
721 WARN_ON(!IS_MODULE(CONFIG_RCU_REF_SCALE_TEST));
722 kernel_power_off();
723 }
721 return firsterr;724 return firsterr;
722}725}
723 726

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t