diff options
-rw-r--r-- | Documentation/RCU/Design/Expedited-Grace-Periods/Expedited-Grace-Periods.html | 47 |
1 files changed, 44 insertions, 3 deletions
diff --git a/Documentation/RCU/Design/Expedited-Grace-Periods/Expedited-Grace-Periods.html b/Documentation/RCU/Design/Expedited-Grace-Periods/Expedited-Grace-Periods.html index 7a3194c5559a..e5d0bbd0230b 100644 --- a/Documentation/RCU/Design/Expedited-Grace-Periods/Expedited-Grace-Periods.html +++ b/Documentation/RCU/Design/Expedited-Grace-Periods/Expedited-Grace-Periods.html | |||
@@ -284,6 +284,7 @@ Expedited Grace Period Refinements</a></h2> | |||
284 | Funnel locking and wait/wakeup</a>. | 284 | Funnel locking and wait/wakeup</a>. |
285 | <li> <a href="#Use of Workqueues">Use of Workqueues</a>. | 285 | <li> <a href="#Use of Workqueues">Use of Workqueues</a>. |
286 | <li> <a href="#Stall Warnings">Stall warnings</a>. | 286 | <li> <a href="#Stall Warnings">Stall warnings</a>. |
287 | <li> <a href="#Mid-Boot Operation">Mid-boot operation</a>. | ||
287 | </ol> | 288 | </ol> |
288 | 289 | ||
289 | <h3><a name="Idle-CPU Checks">Idle-CPU Checks</a></h3> | 290 | <h3><a name="Idle-CPU Checks">Idle-CPU Checks</a></h3> |
@@ -524,7 +525,7 @@ their grace periods and carrying out their wakeups. | |||
524 | In earlier implementations, the task requesting the expedited | 525 | In earlier implementations, the task requesting the expedited |
525 | grace period also drove it to completion. | 526 | grace period also drove it to completion. |
526 | This straightforward approach had the disadvantage of needing to | 527 | This straightforward approach had the disadvantage of needing to |
527 | account for signals sent to user tasks, | 528 | account for POSIX signals sent to user tasks, |
528 | so more recent implemementations use the Linux kernel's | 529 | so more recent implemementations use the Linux kernel's |
529 | <a href="https://www.kernel.org/doc/Documentation/workqueue.txt">workqueues</a>. | 530 | <a href="https://www.kernel.org/doc/Documentation/workqueue.txt">workqueues</a>. |
530 | 531 | ||
@@ -533,8 +534,8 @@ The requesting task still does counter snapshotting and funnel-lock | |||
533 | processing, but the task reaching the top of the funnel lock | 534 | processing, but the task reaching the top of the funnel lock |
534 | does a <tt>schedule_work()</tt> (from <tt>_synchronize_rcu_expedited()</tt> | 535 | does a <tt>schedule_work()</tt> (from <tt>_synchronize_rcu_expedited()</tt> |
535 | so that a workqueue kthread does the actual grace-period processing. | 536 | so that a workqueue kthread does the actual grace-period processing. |
536 | Because workqueue kthreads do not accept signals, grace-period-wait | 537 | Because workqueue kthreads do not accept POSIX signals, grace-period-wait |
537 | processing need not allow for signals. | 538 | processing need not allow for POSIX signals. |
538 | 539 | ||
539 | In addition, this approach allows wakeups for the previous expedited | 540 | In addition, this approach allows wakeups for the previous expedited |
540 | grace period to be overlapped with processing for the next expedited | 541 | grace period to be overlapped with processing for the next expedited |
@@ -586,6 +587,46 @@ blocking the current grace period are printed. | |||
586 | Each stall warning results in another pass through the loop, but the | 587 | Each stall warning results in another pass through the loop, but the |
587 | second and subsequent passes use longer stall times. | 588 | second and subsequent passes use longer stall times. |
588 | 589 | ||
590 | <h3><a name="Mid-Boot Operation">Mid-boot operation</a></h3> | ||
591 | |||
592 | <p> | ||
593 | The use of workqueues has the advantage that the expedited | ||
594 | grace-period code need not worry about POSIX signals. | ||
595 | Unfortunately, it has the | ||
596 | corresponding disadvantage that workqueues cannot be used until | ||
597 | they are initialized, which does not happen until some time after | ||
598 | the scheduler spawns the first task. | ||
599 | Given that there are parts of the kernel that really do want to | ||
600 | execute grace periods during this mid-boot “dead zone”, | ||
601 | expedited grace periods must do something else during thie time. | ||
602 | |||
603 | <p> | ||
604 | What they do is to fall back to the old practice of requiring that the | ||
605 | requesting task drive the expedited grace period, as was the case | ||
606 | before the use of workqueues. | ||
607 | However, the requesting task is only required to drive the grace period | ||
608 | during the mid-boot dead zone. | ||
609 | Before mid-boot, a synchronous grace period is a no-op. | ||
610 | Some time after mid-boot, workqueues are used. | ||
611 | |||
612 | <p> | ||
613 | Non-expedited non-SRCU synchronous grace periods must also operate | ||
614 | normally during mid-boot. | ||
615 | This is handled by causing non-expedited grace periods to take the | ||
616 | expedited code path during mid-boot. | ||
617 | |||
618 | <p> | ||
619 | The current code assumes that there are no POSIX signals during | ||
620 | the mid-boot dead zone. | ||
621 | However, if an overwhelming need for POSIX signals somehow arises, | ||
622 | appropriate adjustments can be made to the expedited stall-warning code. | ||
623 | One such adjustment would reinstate the pre-workqueue stall-warning | ||
624 | checks, but only during the mid-boot dead zone. | ||
625 | |||
626 | <p> | ||
627 | With this refinement, synchronous grace periods can now be used from | ||
628 | task context pretty much any time during the life of the kernel. | ||
629 | |||
589 | <h3><a name="Summary"> | 630 | <h3><a name="Summary"> |
590 | Summary</a></h3> | 631 | Summary</a></h3> |
591 | 632 | ||