Commit 13189fa
printk: nbcon: Rely on kthreads for normal operation
Once the kthread is running and available
(i.e. @printk_kthreads_running is set), the kthread becomes
responsible for flushing any pending messages which are added
in NBCON_PRIO_NORMAL context. Namely the legacy
console_flush_all() and device_release() no longer flush the
console. And nbcon_atomic_flush_pending() used by
nbcon_cpu_emergency_exit() no longer flushes messages added
after the emergency messages.
The console context is safe when used by the kthread only when
one of the following conditions are true:
1. Other caller acquires the console context with
NBCON_PRIO_NORMAL with preemption disabled. It will
release the context before rescheduling.
2. Other caller acquires the console context with
NBCON_PRIO_NORMAL under the device_lock.
3. The kthread is the only context which acquires the console
with NBCON_PRIO_NORMAL.
This is satisfied for all atomic printing call sites:
nbcon_legacy_emit_next_record() (#1)
nbcon_atomic_flush_pending_con() (#1)
nbcon_device_release() (#2)
It is even double guaranteed when @printk_kthreads_running
is set because then _only_ the kthread will print for
NBCON_PRIO_NORMAL. (#3)
Signed-off-by: John Ogness <[email protected]>
Reviewed-by: Petr Mladek <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Petr Mladek <[email protected]>1 parent 5c586ba commit 13189fa
3 files changed
+84
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
116 | 123 | | |
117 | 124 | | |
118 | 125 | | |
| |||
176 | 183 | | |
177 | 184 | | |
178 | 185 | | |
| 186 | + | |
179 | 187 | | |
180 | 188 | | |
181 | 189 | | |
| |||
190 | 198 | | |
191 | 199 | | |
192 | 200 | | |
| 201 | + | |
193 | 202 | | |
194 | 203 | | |
195 | 204 | | |
196 | 205 | | |
197 | 206 | | |
198 | 207 | | |
199 | 208 | | |
| 209 | + | |
200 | 210 | | |
201 | 211 | | |
202 | 212 | | |
| |||
211 | 221 | | |
212 | 222 | | |
213 | 223 | | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
214 | 240 | | |
215 | 241 | | |
216 | 242 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1494 | 1494 | | |
1495 | 1495 | | |
1496 | 1496 | | |
| 1497 | + | |
1497 | 1498 | | |
1498 | 1499 | | |
1499 | 1500 | | |
| |||
1523 | 1524 | | |
1524 | 1525 | | |
1525 | 1526 | | |
1526 | | - | |
1527 | | - | |
| 1527 | + | |
| 1528 | + | |
1528 | 1529 | | |
1529 | | - | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
1530 | 1533 | | |
1531 | 1534 | | |
1532 | 1535 | | |
| |||
1754 | 1757 | | |
1755 | 1758 | | |
1756 | 1759 | | |
1757 | | - | |
1758 | | - | |
| 1760 | + | |
| 1761 | + | |
| 1762 | + | |
1759 | 1763 | | |
1760 | 1764 | | |
| 1765 | + | |
1761 | 1766 | | |
| 1767 | + | |
1762 | 1768 | | |
1763 | 1769 | | |
1764 | 1770 | | |
1765 | 1771 | | |
1766 | 1772 | | |
1767 | | - | |
1768 | 1773 | | |
1769 | 1774 | | |
1770 | 1775 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2384 | 2384 | | |
2385 | 2385 | | |
2386 | 2386 | | |
| 2387 | + | |
| 2388 | + | |
| 2389 | + | |
2387 | 2390 | | |
2388 | 2391 | | |
2389 | 2392 | | |
| |||
2732 | 2735 | | |
2733 | 2736 | | |
2734 | 2737 | | |
| 2738 | + | |
2735 | 2739 | | |
2736 | 2740 | | |
2737 | 2741 | | |
| |||
2749 | 2753 | | |
2750 | 2754 | | |
2751 | 2755 | | |
| 2756 | + | |
| 2757 | + | |
| 2758 | + | |
| 2759 | + | |
2752 | 2760 | | |
2753 | 2761 | | |
2754 | 2762 | | |
| |||
3060 | 3068 | | |
3061 | 3069 | | |
3062 | 3070 | | |
| 3071 | + | |
3063 | 3072 | | |
3064 | 3073 | | |
3065 | 3074 | | |
| |||
3071 | 3080 | | |
3072 | 3081 | | |
3073 | 3082 | | |
| 3083 | + | |
| 3084 | + | |
3074 | 3085 | | |
3075 | 3086 | | |
3076 | 3087 | | |
3077 | 3088 | | |
3078 | 3089 | | |
3079 | 3090 | | |
| 3091 | + | |
| 3092 | + | |
| 3093 | + | |
| 3094 | + | |
| 3095 | + | |
| 3096 | + | |
| 3097 | + | |
| 3098 | + | |
3080 | 3099 | | |
3081 | 3100 | | |
3082 | 3101 | | |
| |||
3387 | 3406 | | |
3388 | 3407 | | |
3389 | 3408 | | |
| 3409 | + | |
| 3410 | + | |
| 3411 | + | |
3390 | 3412 | | |
3391 | 3413 | | |
| 3414 | + | |
3392 | 3415 | | |
| 3416 | + | |
| 3417 | + | |
| 3418 | + | |
| 3419 | + | |
| 3420 | + | |
| 3421 | + | |
| 3422 | + | |
| 3423 | + | |
| 3424 | + | |
| 3425 | + | |
| 3426 | + | |
| 3427 | + | |
3393 | 3428 | | |
3394 | 3429 | | |
3395 | 3430 | | |
| |||
4115 | 4150 | | |
4116 | 4151 | | |
4117 | 4152 | | |
| 4153 | + | |
| 4154 | + | |
4118 | 4155 | | |
4119 | 4156 | | |
4120 | 4157 | | |
| |||
4152 | 4189 | | |
4153 | 4190 | | |
4154 | 4191 | | |
4155 | | - | |
| 4192 | + | |
| 4193 | + | |
4156 | 4194 | | |
| 4195 | + | |
4157 | 4196 | | |
4158 | 4197 | | |
4159 | 4198 | | |
| |||
4629 | 4668 | | |
4630 | 4669 | | |
4631 | 4670 | | |
| 4671 | + | |
| 4672 | + | |
| 4673 | + | |
4632 | 4674 | | |
4633 | 4675 | | |
| 4676 | + | |
| 4677 | + | |
| 4678 | + | |
| 4679 | + | |
4634 | 4680 | | |
4635 | 4681 | | |
4636 | 4682 | | |
| |||
0 commit comments