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

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/rcu/refscale.c+4−1
@@ -658,7 +658,6 @@ ref_scale_init(void) · 657 unmodified lines
658658 for (i = 0; i < ARRAY_SIZE(scale_ops); i++)
659659 pr_cont(" %s", scale_ops[i]->name);
660660 pr_cont("\n");
661− WARN_ON(!IS_MODULE(CONFIG_RCU_REF_SCALE_TEST));
662661 firsterr = -EINVAL;
663662 cur_ops = NULL;
664663 goto unwind;
@@ -718,6 +717,10 @@ ref_scale_init(void) · 53 unmodified lines
718717 unwind:
719718 torture_init_end();
720719 ref_scale_cleanup();
720+ if (shutdown) {
721+ WARN_ON(!IS_MODULE(CONFIG_RCU_REF_SCALE_TEST));
722+ kernel_power_off();
723+ }
721724 return firsterr;
722725 }
723726

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