All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] RFC: x86/smp: use printk_deferred in native_smp_send_reschedule
@ 2019-05-07 17:33 Daniel Vetter
  2019-05-07 17:58 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Daniel Vetter @ 2019-05-07 17:33 UTC (permalink / raw)
  To: Intel Graphics Development
  Cc: Daniel Vetter, Daniel Vetter, Peter Zijlstra, Ingo Molnar,
	Will Deacon, Petr Mladek, Sergey Senozhatsky, Steven Rostedt,
	John Ogness, linux-kernel, Nicolai Stange, Thomas Gleixner

console_trylock, called from within printk, can be called from pretty
much anywhere. Including try_to_wake_up. Note that this isn't common,
usually the box is in pretty bad shape at that point already. But it
really doesn't help when then lockdep jumps in and spams the logs,
potentially obscuring the real backtrace we're really interested in.
One case I've seen (slightly simplified backtrace):

 Call Trace:
  <IRQ>
  console_trylock+0xe/0x60
  vprintk_emit+0xf1/0x320
  printk+0x4d/0x69
  __warn_printk+0x46/0x90
  native_smp_send_reschedule+0x2f/0x40
  check_preempt_curr+0x81/0xa0
  ttwu_do_wakeup+0x14/0x220
  try_to_wake_up+0x218/0x5f0
  pollwake+0x6f/0x90
  credit_entropy_bits+0x204/0x310
  add_interrupt_randomness+0x18f/0x210
  handle_irq+0x67/0x160
  do_IRQ+0x5e/0x130
  common_interrupt+0xf/0xf
  </IRQ>

This alone isn't a problem, but the spinlock in the semaphore is also
still held while waking up waiters (up() -> __up() -> try_to_wake_up()
callchain), which then closes the runqueue vs. semaphore.lock loop,
and upsets lockdep, which issues a circular locking splat to dmesg.
Worse it upsets developers, since we don't want to spam dmesg with
clutter when the machine is dying already.

This is fix attempt number 3, we've already tried to:

- make the console_trylock trylock also the spinlock. This works in
  the limited case of the console_lock use-case, but doesn't fix the
  same semaphore.lock acquisition in the up() path in console_unlock,
  which we can't avoid with a trylock.

- move the wake_up_process in up() out from under the semaphore.lock
  spinlock critical section. Again this works for the limited case of
  the console_lock, and does fully break the cycle for this lock.
  Unfortunately there's still plenty of scheduler related locks that
  wake_up_process needs, so the loop is still there, just with a few
  less locks involved.

Hence now third attempt, trying to fix this by using printk_deferred()
instead of the normal printk that WARN() uses.
native_smp_send_reschedule is only called from scheduler related code,
which has to use printk_deferred due to this locking recursion, so
this seems consistent.

It has the unfortunate downside that we're losing the backtrace though
(I didn't find a printk_deferred version of WARN, and I'm not sure
it's a bright idea to dump that much using printk_deferred.)

Keeping all the people from the console_lock/printk related attempts
on cc as fyi.

Note: We can only hit this in our CI, with a very low reproduction
rate. And right now the lockdep splat and a few other things crowd out
what actually happens in the little bit of dmesg we recover, so no
idea yet why exactly we're hitting that WARN().

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: John Ogness <john.ogness@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Cc: Nicolai Stange <nstange@suse.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
---
 arch/x86/kernel/smp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c
index 04adc8d60aed..f19782786669 100644
--- a/arch/x86/kernel/smp.c
+++ b/arch/x86/kernel/smp.c
@@ -125,7 +125,8 @@ static bool smp_no_nmi_ipi = false;
 static void native_smp_send_reschedule(int cpu)
 {
 	if (unlikely(cpu_is_offline(cpu))) {
-		WARN(1, "sched: Unexpected reschedule of offline CPU#%d!\n", cpu);
+		printk_deferred(KERN_WARNING
+				"sched: Unexpected reschedule of offline CPU#%d!\n", cpu);
 		return;
 	}
 	apic->send_IPI(cpu, RESCHEDULE_VECTOR);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* ✗ Fi.CI.CHECKPATCH: warning for RFC: x86/smp: use printk_deferred in native_smp_send_reschedule
  2019-05-07 17:33 [PATCH] RFC: x86/smp: use printk_deferred in native_smp_send_reschedule Daniel Vetter
@ 2019-05-07 17:58 ` Patchwork
  2019-05-07 18:47 ` ✓ Fi.CI.BAT: success " Patchwork
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 10+ messages in thread
From: Patchwork @ 2019-05-07 17:58 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: intel-gfx

== Series Details ==

Series: RFC: x86/smp: use printk_deferred in native_smp_send_reschedule
URL   : https://patchwork.freedesktop.org/series/60384/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
79bd449b8e2d RFC: x86/smp: use printk_deferred in native_smp_send_reschedule
-:93: WARNING:UNNECESSARY_KERN_LEVEL: Possible unnecessary KERN_WARNING
#93: FILE: arch/x86/kernel/smp.c:128:
+		printk_deferred(KERN_WARNING

-:97: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>'

total: 0 errors, 2 warnings, 0 checks, 9 lines checked

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* ✓ Fi.CI.BAT: success for RFC: x86/smp: use printk_deferred in native_smp_send_reschedule
  2019-05-07 17:33 [PATCH] RFC: x86/smp: use printk_deferred in native_smp_send_reschedule Daniel Vetter
  2019-05-07 17:58 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
@ 2019-05-07 18:47 ` Patchwork
  2019-05-08  3:14 ` ✓ Fi.CI.IGT: " Patchwork
  2019-05-08  7:44 ` [PATCH] " Sergey Senozhatsky
  3 siblings, 0 replies; 10+ messages in thread
From: Patchwork @ 2019-05-07 18:47 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: intel-gfx

== Series Details ==

Series: RFC: x86/smp: use printk_deferred in native_smp_send_reschedule
URL   : https://patchwork.freedesktop.org/series/60384/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_6061 -> Patchwork_12981
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12981/

Known issues
------------

  Here are the changes found in Patchwork_12981 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@i915_selftest@live_contexts:
    - fi-bdw-gvtdvm:      [PASS][1] -> [DMESG-FAIL][2] ([fdo#110235])
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6061/fi-bdw-gvtdvm/igt@i915_selftest@live_contexts.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12981/fi-bdw-gvtdvm/igt@i915_selftest@live_contexts.html

  * igt@i915_selftest@live_hangcheck:
    - fi-skl-iommu:       [PASS][3] -> [INCOMPLETE][4] ([fdo#108602] / [fdo#108744])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6061/fi-skl-iommu/igt@i915_selftest@live_hangcheck.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12981/fi-skl-iommu/igt@i915_selftest@live_hangcheck.html

  
#### Possible fixes ####

  * igt@gem_exec_suspend@basic-s3:
    - fi-blb-e6850:       [INCOMPLETE][5] ([fdo#107718]) -> [PASS][6]
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6061/fi-blb-e6850/igt@gem_exec_suspend@basic-s3.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12981/fi-blb-e6850/igt@gem_exec_suspend@basic-s3.html

  * igt@i915_selftest@live_hangcheck:
    - {fi-icl-y}:         [INCOMPLETE][7] ([fdo#107713] / [fdo#108569]) -> [PASS][8]
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6061/fi-icl-y/igt@i915_selftest@live_hangcheck.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12981/fi-icl-y/igt@i915_selftest@live_hangcheck.html

  * igt@kms_busy@basic-flip-c:
    - fi-skl-6770hq:      [SKIP][9] ([fdo#109271] / [fdo#109278]) -> [PASS][10] +2 similar issues
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6061/fi-skl-6770hq/igt@kms_busy@basic-flip-c.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12981/fi-skl-6770hq/igt@kms_busy@basic-flip-c.html

  * igt@kms_flip@basic-flip-vs-dpms:
    - fi-skl-6770hq:      [SKIP][11] ([fdo#109271]) -> [PASS][12] +23 similar issues
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6061/fi-skl-6770hq/igt@kms_flip@basic-flip-vs-dpms.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12981/fi-skl-6770hq/igt@kms_flip@basic-flip-vs-dpms.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
  [fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
  [fdo#108569]: https://bugs.freedesktop.org/show_bug.cgi?id=108569
  [fdo#108602]: https://bugs.freedesktop.org/show_bug.cgi?id=108602
  [fdo#108744]: https://bugs.freedesktop.org/show_bug.cgi?id=108744
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
  [fdo#110235]: https://bugs.freedesktop.org/show_bug.cgi?id=110235


Participating hosts (49 -> 45)
------------------------------

  Additional (4): fi-byt-j1900 fi-icl-u2 fi-icl-u3 fi-snb-2600 
  Missing    (8): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-byt-clapper fi-bdw-samus 


Build changes
-------------

  * Linux: CI_DRM_6061 -> Patchwork_12981

  CI_DRM_6061: 2a3ab645af902ecea7c0b89a4ca40dd194bccfd6 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4972: f052e49a43cc9704ea5f240df15dd9d3dfed68ab @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_12981: 79bd449b8e2dd37f018f106a347a4a5cdbbbbd32 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

79bd449b8e2d RFC: x86/smp: use printk_deferred in native_smp_send_reschedule

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12981/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* ✓ Fi.CI.IGT: success for RFC: x86/smp: use printk_deferred in native_smp_send_reschedule
  2019-05-07 17:33 [PATCH] RFC: x86/smp: use printk_deferred in native_smp_send_reschedule Daniel Vetter
  2019-05-07 17:58 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
  2019-05-07 18:47 ` ✓ Fi.CI.BAT: success " Patchwork
@ 2019-05-08  3:14 ` Patchwork
  2019-05-08  7:44 ` [PATCH] " Sergey Senozhatsky
  3 siblings, 0 replies; 10+ messages in thread
From: Patchwork @ 2019-05-08  3:14 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: intel-gfx

== Series Details ==

Series: RFC: x86/smp: use printk_deferred in native_smp_send_reschedule
URL   : https://patchwork.freedesktop.org/series/60384/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_6061_full -> Patchwork_12981_full
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  

Known issues
------------

  Here are the changes found in Patchwork_12981_full that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_exec_basic@readonly-blt:
    - shard-apl:          [PASS][1] -> [INCOMPLETE][2] ([fdo#103927])
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6061/shard-apl6/igt@gem_exec_basic@readonly-blt.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12981/shard-apl4/igt@gem_exec_basic@readonly-blt.html

  * igt@i915_pm_rpm@i2c:
    - shard-iclb:         [PASS][3] -> [FAIL][4] ([fdo#104097])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6061/shard-iclb6/igt@i915_pm_rpm@i2c.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12981/shard-iclb3/igt@i915_pm_rpm@i2c.html

  * igt@kms_flip@dpms-vs-vblank-race-interruptible:
    - shard-skl:          [PASS][5] -> [FAIL][6] ([fdo#103060])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6061/shard-skl8/igt@kms_flip@dpms-vs-vblank-race-interruptible.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12981/shard-skl3/igt@kms_flip@dpms-vs-vblank-race-interruptible.html

  * igt@kms_frontbuffer_tracking@fbc-suspend:
    - shard-apl:          [PASS][7] -> [DMESG-WARN][8] ([fdo#108566]) +6 similar issues
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6061/shard-apl4/igt@kms_frontbuffer_tracking@fbc-suspend.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12981/shard-apl3/igt@kms_frontbuffer_tracking@fbc-suspend.html

  * igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-shrfb-draw-render:
    - shard-iclb:         [PASS][9] -> [FAIL][10] ([fdo#103167]) +1 similar issue
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6061/shard-iclb8/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-shrfb-draw-render.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12981/shard-iclb1/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-shrfb-draw-render.html

  * igt@kms_plane_lowres@pipe-a-tiling-y:
    - shard-iclb:         [PASS][11] -> [FAIL][12] ([fdo#103166])
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6061/shard-iclb4/igt@kms_plane_lowres@pipe-a-tiling-y.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12981/shard-iclb4/igt@kms_plane_lowres@pipe-a-tiling-y.html

  * igt@kms_psr@psr2_basic:
    - shard-iclb:         [PASS][13] -> [SKIP][14] ([fdo#109441]) +2 similar issues
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6061/shard-iclb2/igt@kms_psr@psr2_basic.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12981/shard-iclb1/igt@kms_psr@psr2_basic.html

  * igt@kms_setmode@basic:
    - shard-apl:          [PASS][15] -> [FAIL][16] ([fdo#99912])
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6061/shard-apl7/igt@kms_setmode@basic.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12981/shard-apl3/igt@kms_setmode@basic.html

  
#### Possible fixes ####

  * igt@gem_eio@reset-stress:
    - shard-snb:          [FAIL][17] ([fdo#109661]) -> [PASS][18]
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6061/shard-snb6/igt@gem_eio@reset-stress.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12981/shard-snb5/igt@gem_eio@reset-stress.html

  * igt@gem_workarounds@suspend-resume:
    - shard-apl:          [DMESG-WARN][19] ([fdo#108566]) -> [PASS][20] +3 similar issues
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6061/shard-apl5/igt@gem_workarounds@suspend-resume.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12981/shard-apl7/igt@gem_workarounds@suspend-resume.html

  * igt@gem_workarounds@suspend-resume-context:
    - shard-kbl:          [DMESG-WARN][21] ([fdo#103313]) -> [PASS][22]
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6061/shard-kbl4/igt@gem_workarounds@suspend-resume-context.html
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12981/shard-kbl1/igt@gem_workarounds@suspend-resume-context.html

  * igt@kms_draw_crc@draw-method-xrgb8888-render-xtiled:
    - shard-skl:          [FAIL][23] ([fdo#103184] / [fdo#103232]) -> [PASS][24]
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6061/shard-skl10/igt@kms_draw_crc@draw-method-xrgb8888-render-xtiled.html
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12981/shard-skl10/igt@kms_draw_crc@draw-method-xrgb8888-render-xtiled.html

  * igt@kms_flip@2x-plain-flip-fb-recreate:
    - shard-glk:          [FAIL][25] ([fdo#100368]) -> [PASS][26]
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6061/shard-glk7/igt@kms_flip@2x-plain-flip-fb-recreate.html
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12981/shard-glk1/igt@kms_flip@2x-plain-flip-fb-recreate.html

  * igt@kms_frontbuffer_tracking@fbcpsr-1p-pri-indfb-multidraw:
    - shard-iclb:         [FAIL][27] ([fdo#103167]) -> [PASS][28] +2 similar issues
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6061/shard-iclb2/igt@kms_frontbuffer_tracking@fbcpsr-1p-pri-indfb-multidraw.html
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12981/shard-iclb1/igt@kms_frontbuffer_tracking@fbcpsr-1p-pri-indfb-multidraw.html

  * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
    - shard-skl:          [INCOMPLETE][29] ([fdo#104108]) -> [PASS][30]
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6061/shard-skl10/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b.html
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12981/shard-skl2/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b.html

  * igt@kms_plane@pixel-format-pipe-b-planes:
    - shard-glk:          [SKIP][31] ([fdo#109271]) -> [PASS][32]
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6061/shard-glk5/igt@kms_plane@pixel-format-pipe-b-planes.html
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12981/shard-glk9/igt@kms_plane@pixel-format-pipe-b-planes.html

  * igt@kms_plane@plane-position-hole-dpms-pipe-b-planes:
    - shard-snb:          [SKIP][33] ([fdo#109271]) -> [PASS][34] +1 similar issue
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6061/shard-snb4/igt@kms_plane@plane-position-hole-dpms-pipe-b-planes.html
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12981/shard-snb1/igt@kms_plane@plane-position-hole-dpms-pipe-b-planes.html

  * igt@kms_plane_alpha_blend@pipe-a-constant-alpha-min:
    - shard-skl:          [FAIL][35] ([fdo#108145]) -> [PASS][36]
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6061/shard-skl2/igt@kms_plane_alpha_blend@pipe-a-constant-alpha-min.html
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12981/shard-skl6/igt@kms_plane_alpha_blend@pipe-a-constant-alpha-min.html

  * igt@kms_plane_lowres@pipe-a-tiling-x:
    - shard-iclb:         [FAIL][37] ([fdo#103166]) -> [PASS][38]
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6061/shard-iclb6/igt@kms_plane_lowres@pipe-a-tiling-x.html
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12981/shard-iclb3/igt@kms_plane_lowres@pipe-a-tiling-x.html

  * igt@kms_psr@psr2_cursor_plane_onoff:
    - shard-iclb:         [SKIP][39] ([fdo#109441]) -> [PASS][40] +3 similar issues
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6061/shard-iclb7/igt@kms_psr@psr2_cursor_plane_onoff.html
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12981/shard-iclb2/igt@kms_psr@psr2_cursor_plane_onoff.html

  
#### Warnings ####

  * igt@kms_atomic_transition@3x-modeset-transitions:
    - shard-snb:          [SKIP][41] ([fdo#109271]) -> [SKIP][42] ([fdo#109271] / [fdo#109278])
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6061/shard-snb4/igt@kms_atomic_transition@3x-modeset-transitions.html
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12981/shard-snb1/igt@kms_atomic_transition@3x-modeset-transitions.html

  * igt@kms_cursor_crc@cursor-512x170-sliding:
    - shard-glk:          [INCOMPLETE][43] ([fdo#103359] / [k.org#198133]) -> [SKIP][44] ([fdo#109271])
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6061/shard-glk3/igt@kms_cursor_crc@cursor-512x170-sliding.html
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12981/shard-glk8/igt@kms_cursor_crc@cursor-512x170-sliding.html

  
  [fdo#100368]: https://bugs.freedesktop.org/show_bug.cgi?id=100368
  [fdo#103060]: https://bugs.freedesktop.org/show_bug.cgi?id=103060
  [fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
  [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
  [fdo#103184]: https://bugs.freedesktop.org/show_bug.cgi?id=103184
  [fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
  [fdo#103313]: https://bugs.freedesktop.org/show_bug.cgi?id=103313
  [fdo#103359]: https://bugs.freedesktop.org/show_bug.cgi?id=103359
  [fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
  [fdo#104097]: https://bugs.freedesktop.org/show_bug.cgi?id=104097
  [fdo#104108]: https://bugs.freedesktop.org/show_bug.cgi?id=104108
  [fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
  [fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
  [fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
  [fdo#109661]: https://bugs.freedesktop.org/show_bug.cgi?id=109661
  [fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912
  [k.org#198133]: https://bugzilla.kernel.org/show_bug.cgi?id=198133


Participating hosts (11 -> 10)
------------------------------

  Missing    (1): pig-snb-2600 


Build changes
-------------

  * Linux: CI_DRM_6061 -> Patchwork_12981

  CI_DRM_6061: 2a3ab645af902ecea7c0b89a4ca40dd194bccfd6 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4972: f052e49a43cc9704ea5f240df15dd9d3dfed68ab @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_12981: 79bd449b8e2dd37f018f106a347a4a5cdbbbbd32 @ git://anongit.freedesktop.org/gfx-ci/linux
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12981/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] RFC: x86/smp: use printk_deferred in native_smp_send_reschedule
  2019-05-07 17:33 [PATCH] RFC: x86/smp: use printk_deferred in native_smp_send_reschedule Daniel Vetter
                   ` (2 preceding siblings ...)
  2019-05-08  3:14 ` ✓ Fi.CI.IGT: " Patchwork
@ 2019-05-08  7:44 ` Sergey Senozhatsky
  2019-05-08  7:53   ` Sergey Senozhatsky
  2019-05-08  8:25   ` Daniel Vetter
  3 siblings, 2 replies; 10+ messages in thread
From: Sergey Senozhatsky @ 2019-05-08  7:44 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: Intel Graphics Development, Daniel Vetter, Peter Zijlstra,
	Ingo Molnar, Will Deacon, Petr Mladek, Sergey Senozhatsky,
	Steven Rostedt, John Ogness, linux-kernel, Nicolai Stange,
	Thomas Gleixner

On (05/07/19 19:33), Daniel Vetter wrote:
[..]
> - make the console_trylock trylock also the spinlock. This works in
>   the limited case of the console_lock use-case, but doesn't fix the
>   same semaphore.lock acquisition in the up() path in console_unlock,
>   which we can't avoid with a trylock.
> 
> - move the wake_up_process in up() out from under the semaphore.lock
>   spinlock critical section. Again this works for the limited case of
>   the console_lock, and does fully break the cycle for this lock.
>   Unfortunately there's still plenty of scheduler related locks that
>   wake_up_process needs, so the loop is still there, just with a few
>   less locks involved.
> 
> Hence now third attempt, trying to fix this by using printk_deferred()
> instead of the normal printk that WARN() uses.
> native_smp_send_reschedule is only called from scheduler related code,
> which has to use printk_deferred due to this locking recursion, so
> this seems consistent.
> 
> It has the unfortunate downside that we're losing the backtrace though
> (I didn't find a printk_deferred version of WARN, and I'm not sure
> it's a bright idea to dump that much using printk_deferred.)

I'm catching up with the emails now (was offline for almost 2 weeks),
so I haven't seen [yet] all of the previous patches/discussions.

[..]
>  static void native_smp_send_reschedule(int cpu)
>  {
>  	if (unlikely(cpu_is_offline(cpu))) {
> -		WARN(1, "sched: Unexpected reschedule of offline CPU#%d!\n", cpu);
> +		printk_deferred(KERN_WARNING
> +				"sched: Unexpected reschedule of offline CPU#%d!\n", cpu);
>  		return;
>  	}
>  	apic->send_IPI(cpu, RESCHEDULE_VECTOR);

Hmm,
One thing to notice here is that the CPU in question is offline-ed,
and printk_deferred() is a per-CPU type of deferred printk(). So the
following thing

	__this_cpu_or(printk_pending, PRINTK_PENDING_OUTPUT);
	irq_work_queue(this_cpu_ptr(&wake_up_klogd_work));

might not print anything at all. In this particular case we always
need another CPU to do console_unlock(), since this_cpu() is not
really expected to do wake_up_klogd_work_func()->console_unlock().

	-ss

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] RFC: x86/smp: use printk_deferred in native_smp_send_reschedule
  2019-05-08  7:44 ` [PATCH] " Sergey Senozhatsky
@ 2019-05-08  7:53   ` Sergey Senozhatsky
  2019-05-08  8:06     ` Daniel Vetter
  2019-05-08  8:14     ` Daniel Vetter
  2019-05-08  8:25   ` Daniel Vetter
  1 sibling, 2 replies; 10+ messages in thread
From: Sergey Senozhatsky @ 2019-05-08  7:53 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: Intel Graphics Development, Daniel Vetter, Peter Zijlstra,
	Ingo Molnar, Will Deacon, Petr Mladek, Sergey Senozhatsky,
	Steven Rostedt, John Ogness, linux-kernel, Nicolai Stange,
	Thomas Gleixner, Sergey Senozhatsky

On (05/08/19 16:44), Sergey Senozhatsky wrote:
> [..]
> >  static void native_smp_send_reschedule(int cpu)
> >  {
> >  	if (unlikely(cpu_is_offline(cpu))) {
> > -		WARN(1, "sched: Unexpected reschedule of offline CPU#%d!\n", cpu);
> > +		printk_deferred(KERN_WARNING
> > +				"sched: Unexpected reschedule of offline CPU#%d!\n", cpu);
> >  		return;
> >  	}
> >  	apic->send_IPI(cpu, RESCHEDULE_VECTOR);
> 
> Hmm,
> One thing to notice here is that the CPU in question is offline-ed,
> and printk_deferred() is a per-CPU type of deferred printk(). So the
> following thing
> 
> 	__this_cpu_or(printk_pending, PRINTK_PENDING_OUTPUT);
> 	irq_work_queue(this_cpu_ptr(&wake_up_klogd_work));
> 
> might not print anything at all. In this particular case we always
> need another CPU to do console_unlock(), since this_cpu() is not
> really expected to do wake_up_klogd_work_func()->console_unlock().

D'oh... It's remote CPU which is offline, not this_cpu().
Sorry, my bad!

Any printk-related patch in this area will make PeterZ really-really
angry :)

printk_deferred(), just like prinkt_safe(), depends on IRQ work;
printk_safe(), however, can redirect multiple lines, unlike
printk_deferred(). So if you want to keep the backtrace, you may
do something like

	if (unlikely(cpu_is_offline(cpu))) {
		printk_safe_enter(...);
		WARN(1, "sched: Unexpected reschedule of offline CPU#%d!\n",
			 cpu);
		printk_safe_exit(...);
		return;
	}

I think, in this case John's reworked-printk can do better than
printk_safe/printk_deferred.

	-ss

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] RFC: x86/smp: use printk_deferred in native_smp_send_reschedule
  2019-05-08  7:53   ` Sergey Senozhatsky
@ 2019-05-08  8:06     ` Daniel Vetter
  2019-05-08  8:24       ` Sergey Senozhatsky
  2019-05-08  8:14     ` Daniel Vetter
  1 sibling, 1 reply; 10+ messages in thread
From: Daniel Vetter @ 2019-05-08  8:06 UTC (permalink / raw)
  To: Sergey Senozhatsky
  Cc: Intel Graphics Development, Daniel Vetter, Peter Zijlstra,
	Ingo Molnar, Will Deacon, Petr Mladek, Sergey Senozhatsky,
	Steven Rostedt, John Ogness, Linux Kernel Mailing List,
	Nicolai Stange, Thomas Gleixner

On Wed, May 8, 2019 at 9:53 AM Sergey Senozhatsky
<sergey.senozhatsky.work@gmail.com> wrote:
>
> On (05/08/19 16:44), Sergey Senozhatsky wrote:
> > [..]
> > >  static void native_smp_send_reschedule(int cpu)
> > >  {
> > >     if (unlikely(cpu_is_offline(cpu))) {
> > > -           WARN(1, "sched: Unexpected reschedule of offline CPU#%d!\n", cpu);
> > > +           printk_deferred(KERN_WARNING
> > > +                           "sched: Unexpected reschedule of offline CPU#%d!\n", cpu);
> > >             return;
> > >     }
> > >     apic->send_IPI(cpu, RESCHEDULE_VECTOR);
> >
> > Hmm,
> > One thing to notice here is that the CPU in question is offline-ed,
> > and printk_deferred() is a per-CPU type of deferred printk(). So the
> > following thing
> >
> >       __this_cpu_or(printk_pending, PRINTK_PENDING_OUTPUT);
> >       irq_work_queue(this_cpu_ptr(&wake_up_klogd_work));
> >
> > might not print anything at all. In this particular case we always
> > need another CPU to do console_unlock(), since this_cpu() is not
> > really expected to do wake_up_klogd_work_func()->console_unlock().
>
> D'oh... It's remote CPU which is offline, not this_cpu().
> Sorry, my bad!

Well I started reading, then freaked out about the WARN_ON in
irq_work_queue_on until I realized that's not the one we're calling
either :-)

> Any printk-related patch in this area will make PeterZ really-really
> angry :)

Hm any more context for someone with no clue about this? Just that the
dependencies are already terribly complex and it's not going to get
better, or something more specific?

> printk_deferred(), just like prinkt_safe(), depends on IRQ work;
> printk_safe(), however, can redirect multiple lines, unlike
> printk_deferred(). So if you want to keep the backtrace, you may
> do something like
>
>         if (unlikely(cpu_is_offline(cpu))) {
>                 printk_safe_enter(...);
>                 WARN(1, "sched: Unexpected reschedule of offline CPU#%d!\n",
>                          cpu);
>                 printk_safe_exit(...);
>                 return;
>         }
>
> I think, in this case John's reworked-printk can do better than
> printk_safe/printk_deferred.

Hm I think this is what Petr was suggesting, but somehow I didn't find
the printk_safe_* functions and didn't connect the dots. Needs the
_irqsave variants I guess, I'll respin a v2 of this.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] RFC: x86/smp: use printk_deferred in native_smp_send_reschedule
  2019-05-08  7:53   ` Sergey Senozhatsky
  2019-05-08  8:06     ` Daniel Vetter
@ 2019-05-08  8:14     ` Daniel Vetter
  1 sibling, 0 replies; 10+ messages in thread
From: Daniel Vetter @ 2019-05-08  8:14 UTC (permalink / raw)
  To: Sergey Senozhatsky
  Cc: Intel Graphics Development, Daniel Vetter, Peter Zijlstra,
	Ingo Molnar, Will Deacon, Petr Mladek, Sergey Senozhatsky,
	Steven Rostedt, John Ogness, Linux Kernel Mailing List,
	Nicolai Stange, Thomas Gleixner

On Wed, May 8, 2019 at 9:53 AM Sergey Senozhatsky
<sergey.senozhatsky.work@gmail.com> wrote:
>
> On (05/08/19 16:44), Sergey Senozhatsky wrote:
> > [..]
> > >  static void native_smp_send_reschedule(int cpu)
> > >  {
> > >     if (unlikely(cpu_is_offline(cpu))) {
> > > -           WARN(1, "sched: Unexpected reschedule of offline CPU#%d!\n", cpu);
> > > +           printk_deferred(KERN_WARNING
> > > +                           "sched: Unexpected reschedule of offline CPU#%d!\n", cpu);
> > >             return;
> > >     }
> > >     apic->send_IPI(cpu, RESCHEDULE_VECTOR);
> >
> > Hmm,
> > One thing to notice here is that the CPU in question is offline-ed,
> > and printk_deferred() is a per-CPU type of deferred printk(). So the
> > following thing
> >
> >       __this_cpu_or(printk_pending, PRINTK_PENDING_OUTPUT);
> >       irq_work_queue(this_cpu_ptr(&wake_up_klogd_work));
> >
> > might not print anything at all. In this particular case we always
> > need another CPU to do console_unlock(), since this_cpu() is not
> > really expected to do wake_up_klogd_work_func()->console_unlock().
>
> D'oh... It's remote CPU which is offline, not this_cpu().
> Sorry, my bad!
>
> Any printk-related patch in this area will make PeterZ really-really
> angry :)
>
> printk_deferred(), just like prinkt_safe(), depends on IRQ work;
> printk_safe(), however, can redirect multiple lines, unlike
> printk_deferred(). So if you want to keep the backtrace, you may
> do something like
>
>         if (unlikely(cpu_is_offline(cpu))) {
>                 printk_safe_enter(...);
>                 WARN(1, "sched: Unexpected reschedule of offline CPU#%d!\n",
>                          cpu);
>                 printk_safe_exit(...);
>                 return;
>         }
>
> I think, in this case John's reworked-printk can do better than
> printk_safe/printk_deferred.

[coffee slowly kicking in it seems]

Locking at __up_console_sem in printk.c, we already do this. I get a
bit a feeling that the 2nd attempt in this saga (pulling the
wake_up_process out from under semaphore.lock spinlock of the
console_lock) is all we really need, since the more direct recursion
that Petr pointed out is already handled with printk_safe_enter/exit
around the up().

https://patchwork.kernel.org/patch/10930673/ for reference that
approach, in case it's lost in your inbox.

Cheers, Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] RFC: x86/smp: use printk_deferred in native_smp_send_reschedule
  2019-05-08  8:06     ` Daniel Vetter
@ 2019-05-08  8:24       ` Sergey Senozhatsky
  0 siblings, 0 replies; 10+ messages in thread
From: Sergey Senozhatsky @ 2019-05-08  8:24 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: Sergey Senozhatsky, Intel Graphics Development, Daniel Vetter,
	Peter Zijlstra, Ingo Molnar, Will Deacon, Petr Mladek,
	Sergey Senozhatsky, Steven Rostedt, John Ogness,
	Linux Kernel Mailing List, Nicolai Stange, Thomas Gleixner

On (05/08/19 10:06), Daniel Vetter wrote:
[..]
> > Any printk-related patch in this area will make PeterZ really-really
> > angry :)
> 
> Hm any more context for someone with no clue about this? Just that the
> dependencies are already terribly complex and it's not going to get
> better, or something more specific?

The main problem is that it's a deferred error-reporting, so such
a report has chances to never be reported. It's not like 'normal'
printk() is always guaranteed to immediately start printing; sometimes
it will, sometimes it won't, and sometimes it never will, for instance
when console_sem was locked by offline-ed CPU.

An example of PeterZ's opinion on printk_deferred()
/* message ID: 20181122101606.GP2131@hirez.programming.kicks-ass.net */

  | No, printk_deferred() is a disease, it needs to be eradicated, not
  | spread around.

> > printk_deferred(), just like prinkt_safe(), depends on IRQ work;
> > printk_safe(), however, can redirect multiple lines, unlike
> > printk_deferred(). So if you want to keep the backtrace, you may
> > do something like
> >
> >         if (unlikely(cpu_is_offline(cpu))) {
> >                 printk_safe_enter(...);
> >                 WARN(1, "sched: Unexpected reschedule of offline CPU#%d!\n",
> >                          cpu);
> >                 printk_safe_exit(...);
> >                 return;
> >         }
> >
> > I think, in this case John's reworked-printk can do better than
> > printk_safe/printk_deferred.
> 
> Hm I think this is what Petr was suggesting, but somehow I didn't find
> the printk_safe_* functions and didn't connect the dots.

These are in kernel/printk/printk_safe.c as of now.

> Needs the _irqsave variants I guess, I'll respin a v2 of this.

Let's wait a bit before respin.

	-ss

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] RFC: x86/smp: use printk_deferred in native_smp_send_reschedule
  2019-05-08  7:44 ` [PATCH] " Sergey Senozhatsky
  2019-05-08  7:53   ` Sergey Senozhatsky
@ 2019-05-08  8:25   ` Daniel Vetter
  1 sibling, 0 replies; 10+ messages in thread
From: Daniel Vetter @ 2019-05-08  8:25 UTC (permalink / raw)
  To: Sergey Senozhatsky
  Cc: Intel Graphics Development, Daniel Vetter, Peter Zijlstra,
	Ingo Molnar, Will Deacon, Petr Mladek, Sergey Senozhatsky,
	Steven Rostedt, John Ogness, Linux Kernel Mailing List,
	Nicolai Stange, Thomas Gleixner

On Wed, May 8, 2019 at 9:44 AM Sergey Senozhatsky
<sergey.senozhatsky.work@gmail.com> wrote:
>
> On (05/07/19 19:33), Daniel Vetter wrote:
> [..]
> > - make the console_trylock trylock also the spinlock. This works in
> >   the limited case of the console_lock use-case, but doesn't fix the
> >   same semaphore.lock acquisition in the up() path in console_unlock,
> >   which we can't avoid with a trylock.
> >
> > - move the wake_up_process in up() out from under the semaphore.lock
> >   spinlock critical section. Again this works for the limited case of
> >   the console_lock, and does fully break the cycle for this lock.
> >   Unfortunately there's still plenty of scheduler related locks that
> >   wake_up_process needs, so the loop is still there, just with a few
> >   less locks involved.
> >
> > Hence now third attempt, trying to fix this by using printk_deferred()
> > instead of the normal printk that WARN() uses.
> > native_smp_send_reschedule is only called from scheduler related code,
> > which has to use printk_deferred due to this locking recursion, so
> > this seems consistent.
> >
> > It has the unfortunate downside that we're losing the backtrace though
> > (I didn't find a printk_deferred version of WARN, and I'm not sure
> > it's a bright idea to dump that much using printk_deferred.)
>
> I'm catching up with the emails now (was offline for almost 2 weeks),
> so I haven't seen [yet] all of the previous patches/discussions.
>
> [..]
> >  static void native_smp_send_reschedule(int cpu)
> >  {
> >       if (unlikely(cpu_is_offline(cpu))) {
> > -             WARN(1, "sched: Unexpected reschedule of offline CPU#%d!\n", cpu);
> > +             printk_deferred(KERN_WARNING
> > +                             "sched: Unexpected reschedule of offline CPU#%d!\n", cpu);
> >               return;
> >       }
> >       apic->send_IPI(cpu, RESCHEDULE_VECTOR);
>
> Hmm,
> One thing to notice here is that the CPU in question is offline-ed,
> and printk_deferred() is a per-CPU type of deferred printk(). So the
> following thing
>
>         __this_cpu_or(printk_pending, PRINTK_PENDING_OUTPUT);
>         irq_work_queue(this_cpu_ptr(&wake_up_klogd_work));
>
> might not print anything at all. In this particular case we always
> need another CPU to do console_unlock(), since this_cpu() is not
> really expected to do wake_up_klogd_work_func()->console_unlock().

Hm right, I was happy enough when Petr pointed out the printk_deferred
infrastructure that I didn't look too deeply into how it works. From a
quick loo




--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-05-08  8:25 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-07 17:33 [PATCH] RFC: x86/smp: use printk_deferred in native_smp_send_reschedule Daniel Vetter
2019-05-07 17:58 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2019-05-07 18:47 ` ✓ Fi.CI.BAT: success " Patchwork
2019-05-08  3:14 ` ✓ Fi.CI.IGT: " Patchwork
2019-05-08  7:44 ` [PATCH] " Sergey Senozhatsky
2019-05-08  7:53   ` Sergey Senozhatsky
2019-05-08  8:06     ` Daniel Vetter
2019-05-08  8:24       ` Sergey Senozhatsky
2019-05-08  8:14     ` Daniel Vetter
2019-05-08  8:25   ` Daniel Vetter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.