Discussion:
[PATCH 2/4] kernel.h: Add non_block_start/end()
(too old to reply)
Daniel Vetter
2018-12-10 10:36:39 UTC
Permalink
In some special cases we must not block, but there's not a
spinlock, preempt-off, irqs-off or similar critical section already
that arms the might_sleep() debug checks. Add a non_block_start/end()
pair to annotate these.

This will be used in the oom paths of mmu-notifiers, where blocking is
not allowed to make sure there's forward progress.

Suggested by Michal Hocko.

Cc: Andrew Morton <***@linux-foundation.org>
Cc: Michal Hocko <***@suse.com>
Cc: David Rientjes <***@google.com>
Cc: "Christian König" <***@amd.com>
Cc: Daniel Vetter <***@ffwll.ch>
Cc: "Jérôme Glisse" <***@redhat.com>
Cc: linux-***@kvack.org
Signed-off-by: Daniel Vetter <***@intel.com>
---
include/linux/kernel.h | 10 +++++++++-
include/linux/sched.h | 4 ++++
kernel/sched/core.c | 6 +++---
3 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index d6aac75b51ba..c2cf31515b3d 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -251,7 +251,9 @@ extern int _cond_resched(void);
* might_sleep - annotation for functions that can sleep
*
* this macro will print a stack trace if it is executed in an atomic
- * context (spinlock, irq-handler, ...).
+ * context (spinlock, irq-handler, ...). Additional sections where blocking is
+ * not allowed can be annotated with non_block_start() and non_block_end()
+ * pairs.
*
* This is a useful debugging help to be able to catch problems early and not
* be bitten later when the calling function happens to sleep when it is not
@@ -260,6 +262,10 @@ extern int _cond_resched(void);
# define might_sleep() \
do { __might_sleep(__FILE__, __LINE__, 0); might_resched(); } while (0)
# define sched_annotate_sleep() (current->task_state_change = 0)
+# define non_block_start() \
+ do { current->non_block_count++; } while (0)
+# define non_block_end() \
+ do { WARN_ON(current->non_block_count-- == 0); } while (0)
#else
static inline void ___might_sleep(const char *file, int line,
int preempt_offset) { }
@@ -267,6 +273,8 @@ extern int _cond_resched(void);
int preempt_offset) { }
# define might_sleep() do { might_resched(); } while (0)
# define sched_annotate_sleep() do { } while (0)
+# define non_block_start() do { } while (0)
+# define non_block_end() do { } while (0)
#endif

#define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index ecffd4e37453..41249dbf8f27 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -916,6 +916,10 @@ struct task_struct {
struct mutex_waiter *blocked_on;
#endif

+#ifdef CONFIG_DEBUG_ATOMIC_SLEEP
+ int non_block_count;
+#endif
+
#ifdef CONFIG_TRACE_IRQFLAGS
unsigned int irq_events;
unsigned long hardirq_enable_ip;
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 6fedf3a98581..969d7a71f30c 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -6113,7 +6113,7 @@ void ___might_sleep(const char *file, int line, int preempt_offset)
rcu_sleep_check();

if ((preempt_count_equals(preempt_offset) && !irqs_disabled() &&
- !is_idle_task(current)) ||
+ !is_idle_task(current) && !current->non_block_count) ||
system_state == SYSTEM_BOOTING || system_state > SYSTEM_RUNNING ||
oops_in_progress)
return;
@@ -6129,8 +6129,8 @@ void ___might_sleep(const char *file, int line, int preempt_offset)
"BUG: sleeping function called from invalid context at %s:%d\n",
file, line);
printk(KERN_ERR
- "in_atomic(): %d, irqs_disabled(): %d, pid: %d, name: %s\n",
- in_atomic(), irqs_disabled(),
+ "in_atomic(): %d, irqs_disabled(): %d, non_block: %d, pid: %d, name: %s\n",
+ in_atomic(), irqs_disabled(), current->non_block_count,
current->pid, current->comm);

if (task_stack_end_corrupted(current))
--
2.20.0.rc1
Michal Hocko
2018-12-10 13:27:59 UTC
Permalink
Just a bit of paranoia, since if we start pushing this deep into
callchains it's hard to spot all places where an mmu notifier
implementation might fail when it's not allowed to.
Inspired by some confusion we had discussing i915 mmu notifiers and
whether we could use the newly-introduced return value to handle some
corner cases. Until we realized that these are only for when a task
has been killed by the oom reaper.
An alternative approach would be to split the callback into two
versions, one with the int return value, and the other with void
return value like in older kernels. But that's a lot more churn for
fairly little gain I think.
Summary from the m-l discussion on why we want something at warning
level: This allows automated tooling in CI to catch bugs without
humans having to look at everything. If we just upgrade the existing
pr_info to a pr_warn, then we'll have false positives. And as-is, no
one will ever spot the problem since it's lost in the massive amounts
of overall dmesg noise.
OK, fair enough. If this is going to help with testing then I do not
have any objections of course.
v2: Drop the full WARN_ON backtrace in favour of just a pr_warn for
the problematic case (Michal Hocko).
Thanks!
---
mm/mmu_notifier.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/mm/mmu_notifier.c b/mm/mmu_notifier.c
index 5119ff846769..ccc22f21b735 100644
--- a/mm/mmu_notifier.c
+++ b/mm/mmu_notifier.c
@@ -190,6 +190,9 @@ int __mmu_notifier_invalidate_range_start(struct mm_struct *mm,
pr_info("%pS callback failed with %d in %sblockable context.\n",
mn->ops->invalidate_range_start, _ret,
!blockable ? "non-" : "");
+ if (blockable)
+ pr_warn("%pS callback failure not allowed\n",
+ mn->ops->invalidate_range_start);
ret = _ret;
}
}
--
2.20.0.rc1
--
Michal Hocko
SUSE Labs
Peter Zijlstra
2018-12-10 16:30:09 UTC
Permalink
OK, no real objections to the thing. Just so long we're all on the same
page as to what it does and doesn't do ;-)
I am not really sure whether there are other potential users besides
this one and whether the check as such is justified.
It's a debug option...
I suppose you could extend the check to include schedule_debug() as
Do you mean to make the check cheaper?
Nah, so the patch only touched might_sleep(), the below touches
schedule().

If there were a patch that hits schedule() without going through a
might_sleep() (rare in practise I think, but entirely possible) then you
won't get a splat without something like the below on top.
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index f66920173370..b1aaa278f1af 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -3278,13 +3278,18 @@ static noinline void __schedule_bug(struct task_struct *prev)
/*
*/
-static inline void schedule_debug(struct task_struct *prev)
+static inline void schedule_debug(struct task_struct *prev, bool preempt)
{
#ifdef CONFIG_SCHED_STACK_END_CHECK
if (task_stack_end_corrupted(prev))
panic("corrupted stack end detected inside scheduler\n");
#endif
+#ifdef CONFIG_DEBUG_ATOMIC_SLEEP
+ if (!preempt && prev->state && prev->non_block_count)
+ // splat
+#endif
+
if (unlikely(in_atomic_preempt_off())) {
__schedule_bug(prev);
preempt_count_set(PREEMPT_DISABLED);
@@ -3391,7 +3396,7 @@ static void __sched notrace __schedule(bool preempt)
rq = cpu_rq(cpu);
prev = rq->curr;
- schedule_debug(prev);
+ schedule_debug(prev, preempt);
if (sched_feat(HRTICK))
hrtick_clear(rq);
--
Michal Hocko
SUSE Labs
Koenig, Christian
2018-12-10 10:44:38 UTC
Permalink
Patches #1 and #3 are Reviewed-by: Christian König
<***@amd.com>

Patch #2 is Acked-by: Christian König <***@amd.com> because
I can't judge if adding the counter in the thread structure is actually
a good idea.

In patch #4 I honestly don't understand at all how this stuff works, so
no-comment from my side on this.

Christian.
Just a bit of paranoia, since if we start pushing this deep into
callchains it's hard to spot all places where an mmu notifier
implementation might fail when it's not allowed to.
Inspired by some confusion we had discussing i915 mmu notifiers and
whether we could use the newly-introduced return value to handle some
corner cases. Until we realized that these are only for when a task
has been killed by the oom reaper.
An alternative approach would be to split the callback into two
versions, one with the int return value, and the other with void
return value like in older kernels. But that's a lot more churn for
fairly little gain I think.
Summary from the m-l discussion on why we want something at warning
level: This allows automated tooling in CI to catch bugs without
humans having to look at everything. If we just upgrade the existing
pr_info to a pr_warn, then we'll have false positives. And as-is, no
one will ever spot the problem since it's lost in the massive amounts
of overall dmesg noise.
v2: Drop the full WARN_ON backtrace in favour of just a pr_warn for
the problematic case (Michal Hocko).
---
mm/mmu_notifier.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/mm/mmu_notifier.c b/mm/mmu_notifier.c
index 5119ff846769..ccc22f21b735 100644
--- a/mm/mmu_notifier.c
+++ b/mm/mmu_notifier.c
@@ -190,6 +190,9 @@ int __mmu_notifier_invalidate_range_start(struct mm_struct *mm,
pr_info("%pS callback failed with %d in %sblockable context.\n",
mn->ops->invalidate_range_start, _ret,
!blockable ? "non-" : "");
+ if (blockable)
+ pr_warn("%pS callback failure not allowed\n",
+ mn->ops->invalidate_range_start);
ret = _ret;
}
}
Patchwork
2018-12-10 12:07:14 UTC
Permalink
== Series Details ==

Series: mmu notifier debug checks v2
URL : https://patchwork.freedesktop.org/series/53828/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
834029401554 mm: Check if mmu notifier callbacks are allowed to fail
-:56: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <***@ffwll.ch>'

total: 0 errors, 1 warnings, 0 checks, 9 lines checked
735885c1e985 kernel.h: Add non_block_start/end()
-:47: WARNING:SINGLE_STATEMENT_DO_WHILE_MACRO: Single statement macros should not use a do {} while (0) loop
#47: FILE: include/linux/kernel.h:265:
+# define non_block_start() \
+ do { current->non_block_count++; } while (0)

-:49: WARNING:SINGLE_STATEMENT_DO_WHILE_MACRO: Single statement macros should not use a do {} while (0) loop
#49: FILE: include/linux/kernel.h:267:
+# define non_block_end() \
+ do { WARN_ON(current->non_block_count-- == 0); } while (0)

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

total: 0 errors, 3 warnings, 0 checks, 56 lines checked
138e4dcc716f mm, notifier: Catch sleeping/blocking for !blockable
-:50: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <***@ffwll.ch>'

total: 0 errors, 1 warnings, 0 checks, 14 lines checked
a1c311d5605e mm, notifier: Add a lockdep map for invalidate_range_start
-:88: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <***@ffwll.ch>'

total: 0 errors, 1 warnings, 0 checks, 33 lines checked
Patchwork
2018-12-10 16:47:39 UTC
Permalink
== Series Details ==

Series: mmu notifier debug checks v2 (rev2)
URL : https://patchwork.freedesktop.org/series/53828/
State : failure

== Summary ==

CALL scripts/checksyscalls.sh
DESCEND objtool
CHK include/generated/compile.h
CC kernel/sched/core.o
kernel/sched/core.c: In function ‘schedule_debug’:
kernel/sched/core.c:3289:37: error: ‘struct task_struct’ has no member named ‘non_block_count’
if (!preempt && prev->state && prev->non_block_count)
^~
scripts/Makefile.build:291: recipe for target 'kernel/sched/core.o' failed
make[2]: *** [kernel/sched/core.o] Error 1
scripts/Makefile.build:516: recipe for target 'kernel/sched' failed
make[1]: *** [kernel/sched] Error 2
Makefile:1060: recipe for target 'kernel' failed
make: *** [kernel] Error 2
Daniel Vetter
2018-12-10 10:36:41 UTC
Permalink
This is a similar idea to the fs_reclaim fake lockdep lock. It's
fairly easy to provoke a specific notifier to be run on a specific
range: Just prep it, and then munmap() it.

A bit harder, but still doable, is to provoke the mmu notifiers for
all the various callchains that might lead to them. But both at the
same time is really hard to reliable hit, especially when you want to
exercise paths like direct reclaim or compaction, where it's not
easy to control what exactly will be unmapped.

By introducing a lockdep map to tie them all together we allow lockdep
to see a lot more dependencies, without having to actually hit them
in a single challchain while testing.

Aside: Since I typed this to test i915 mmu notifiers I've only rolled
this out for the invaliate_range_start callback. If there's
interest, we should probably roll this out to all of them. But my
undestanding of core mm is seriously lacking, and I'm not clear on
whether we need a lockdep map for each callback, or whether some can
be shared.

v2: Use lock_map_acquire/release() like fs_reclaim, to avoid confusion
with this being a real mutex (Chris Wilson).

Cc: Chris Wilson <***@chris-wilson.co.uk>
Cc: Andrew Morton <***@linux-foundation.org>
Cc: David Rientjes <***@google.com>
Cc: "Jérôme Glisse" <***@redhat.com>
Cc: Michal Hocko <***@suse.com>
Cc: "Christian König" <***@amd.com>
Cc: Greg Kroah-Hartman <***@linuxfoundation.org>
Cc: Daniel Vetter <***@ffwll.ch>
Cc: Mike Rapoport <***@linux.vnet.ibm.com>
Cc: linux-***@kvack.org
Signed-off-by: Daniel Vetter <***@intel.com>
---
include/linux/mmu_notifier.h | 6 ++++++
mm/mmu_notifier.c | 7 +++++++
2 files changed, 13 insertions(+)

diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h
index 9893a6432adf..19be442606c6 100644
--- a/include/linux/mmu_notifier.h
+++ b/include/linux/mmu_notifier.h
@@ -12,6 +12,10 @@ struct mmu_notifier_ops;

#ifdef CONFIG_MMU_NOTIFIER

+#ifdef CONFIG_LOCKDEP
+extern struct lockdep_map __mmu_notifier_invalidate_range_start_map;
+#endif
+
/*
* The mmu notifier_mm structure is allocated and installed in
* mm->mmu_notifier_mm inside the mm_take_all_locks() protected
@@ -267,8 +271,10 @@ static inline void mmu_notifier_change_pte(struct mm_struct *mm,
static inline void mmu_notifier_invalidate_range_start(struct mm_struct *mm,
unsigned long start, unsigned long end)
{
+ lock_map_acquire(&__mmu_notifier_invalidate_range_start_map);
if (mm_has_notifiers(mm))
__mmu_notifier_invalidate_range_start(mm, start, end, true);
+ lock_map_release(&__mmu_notifier_invalidate_range_start_map);
}

static inline int mmu_notifier_invalidate_range_start_nonblock(struct mm_struct *mm,
diff --git a/mm/mmu_notifier.c b/mm/mmu_notifier.c
index a50ed7d1ecef..c91d58fe388b 100644
--- a/mm/mmu_notifier.c
+++ b/mm/mmu_notifier.c
@@ -23,6 +23,13 @@
/* global SRCU for all MMs */
DEFINE_STATIC_SRCU(srcu);

+#ifdef CONFIG_LOCKDEP
+struct lockdep_map __mmu_notifier_invalidate_range_start_map = {
+ .name = "mmu_notifier_invalidate_range_start"
+};
+EXPORT_SYMBOL_GPL(__mmu_notifier_invalidate_range_start_map);
+#endif
+
/*
* This function allows mmu_notifier::release callback to delay a call to
* a function that will free appropriate resources. The function must be
--
2.20.0.rc1
Patchwork
2018-12-10 15:54:39 UTC
Permalink
== Series Details ==

Series: mmu notifier debug checks v2
URL : https://patchwork.freedesktop.org/series/53828/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_5292_full -> Patchwork_11056_full
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with Patchwork_11056_full absolutely need to be
verified manually.

If you think the reported changes have nothing to do with the changes
introduced in Patchwork_11056_full, please notify your bug team to allow them
to document this new failure mode, which will reduce false positives in CI.



Possible new issues
-------------------

Here are the unknown changes that may have been introduced in Patchwork_11056_full:

### IGT changes ###

#### Possible regressions ####

* ***@gem_userptr_blits@dmabuf-sync:
- shard-kbl: PASS -> DMESG-WARN +8

* ***@gem_userptr_blits@map-fixed-invalidate-busy:
- shard-glk: PASS -> DMESG-WARN +6

* ***@gem_userptr_blits@map-fixed-invalidate-busy-gup:
- shard-skl: NOTRUN -> DMESG-WARN

* ***@gem_userptr_blits@map-fixed-invalidate-gup:
- shard-apl: PASS -> DMESG-WARN +6

* ***@gem_userptr_blits@map-fixed-invalidate-overlap-busy:
- {shard-iclb}: PASS -> DMESG-WARN +6

* ***@gem_userptr_blits@map-fixed-invalidate-overlap-gup:
- shard-skl: PASS -> DMESG-WARN +7

* ***@gem_userptr_blits@sync-unmap:
- shard-hsw: PASS -> DMESG-WARN +6

* ***@gem_userptr_blits@sync-unmap-cycles:
- shard-snb: PASS -> DMESG-WARN +8

* {***@runner@aborted}:
- shard-glk: NOTRUN -> FAIL
- shard-hsw: NOTRUN -> FAIL
- shard-snb: NOTRUN -> ( 2 FAIL )
- shard-kbl: NOTRUN -> ( 2 FAIL )
- shard-skl: NOTRUN -> ( 2 FAIL )
- {shard-iclb}: NOTRUN -> ( 2 FAIL ) [fdo#108654]
- shard-apl: NOTRUN -> FAIL


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

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

### IGT changes ###

#### Issues hit ####

* ***@gem_workarounds@suspend-resume:
- {shard-iclb}: PASS -> INCOMPLETE [fdo#107713]

* ***@kms_busy@extended-modeset-hang-newfb-render-a:
- {shard-iclb}: PASS -> DMESG-WARN [fdo#107956]

* ***@kms_busy@extended-modeset-hang-newfb-render-b:
- {shard-iclb}: NOTRUN -> DMESG-WARN [fdo#107956]

* ***@kms_chv_cursor_fail@pipe-a-64x64-bottom-edge:
- shard-skl: NOTRUN -> FAIL [fdo#104671]

* ***@kms_color@pipe-a-degamma:
- shard-apl: PASS -> FAIL [fdo#104782] / [fdo#108145]

* ***@kms_cursor_crc@cursor-128x128-offscreen:
- shard-skl: NOTRUN -> FAIL [fdo#103232]

* ***@kms_cursor_crc@cursor-256x256-sliding:
- {shard-iclb}: NOTRUN -> FAIL [fdo#103232]

* ***@kms_cursor_crc@cursor-size-change:
- shard-apl: PASS -> FAIL [fdo#103232]

* ***@kms_draw_crc@draw-method-xrgb2101010-blt-xtiled:
- shard-skl: NOTRUN -> FAIL [fdo#103184]

* ***@kms_draw_crc@draw-method-xrgb2101010-mmap-gtt-xtiled:
- {shard-iclb}: PASS -> WARN [fdo#108336] +2

* ***@kms_draw_crc@draw-method-xrgb8888-mmap-wc-ytiled:
- shard-skl: PASS -> FAIL [fdo#103184]

* ***@kms_draw_crc@draw-method-xrgb8888-pwrite-ytiled:
- shard-skl: NOTRUN -> FAIL [fdo#108222]

* ***@kms_flip@flip-vs-expired-vblank:
- shard-skl: PASS -> FAIL [fdo#105363]

* ***@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-cpu:
- shard-apl: PASS -> FAIL [fdo#103167] +3

* ***@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-render:
- shard-glk: PASS -> FAIL [fdo#103167]

* ***@kms_frontbuffer_tracking@fbc-1p-shrfb-fliptrack:
- shard-skl: NOTRUN -> FAIL [fdo#105682]

* ***@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-cur-indfb-draw-pwrite:
- {shard-iclb}: PASS -> DMESG-FAIL [fdo#107724] +3

* ***@kms_frontbuffer_tracking@fbcpsr-rgb101010-draw-mmap-gtt:
- shard-skl: NOTRUN -> FAIL [fdo#103167] / [fdo#105682]

* ***@kms_frontbuffer_tracking@psr-1p-primscrn-pri-indfb-draw-mmap-cpu:
- shard-skl: NOTRUN -> FAIL [fdo#103167] +1

* ***@kms_frontbuffer_tracking@psr-1p-primscrn-spr-indfb-draw-blt:
- {shard-iclb}: PASS -> FAIL [fdo#103167] +4

* {***@kms_plane@pixel-format-pipe-b-planes-source-clamping}:
- {shard-iclb}: NOTRUN -> FAIL [fdo#108948]

* ***@kms_plane@plane-position-hole-dpms-pipe-a-planes:
- {shard-iclb}: PASS -> DMESG-WARN [fdo#107724] / [fdo#108336] +14

* ***@kms_plane_alpha_blend@pipe-a-constant-alpha-max:
- shard-glk: PASS -> FAIL [fdo#108145]

* ***@kms_plane_alpha_blend@pipe-c-alpha-7efc:
- shard-skl: NOTRUN -> FAIL [fdo#107815] / [fdo#108145] +2

* ***@kms_plane_multiple@atomic-pipe-a-tiling-x:
- {shard-iclb}: PASS -> FAIL [fdo#103166]

* ***@kms_plane_multiple@atomic-pipe-c-tiling-x:
- shard-apl: PASS -> FAIL [fdo#103166]

* ***@kms_setmode@basic:
- shard-apl: PASS -> FAIL [fdo#99912]
- {shard-iclb}: PASS -> FAIL [fdo#99912]
- shard-hsw: PASS -> FAIL [fdo#99912]
- shard-kbl: PASS -> FAIL [fdo#99912]

* ***@pm_backlight@basic-brightness:
- {shard-iclb}: PASS -> DMESG-WARN [fdo#107724] +30

* ***@pm_rpm@modeset-lpsp-stress:
- {shard-iclb}: PASS -> DMESG-WARN [fdo#108654]


#### Possible fixes ####

* ***@gem_ppgtt@blt-vs-render-ctxn:
- shard-skl: TIMEOUT [fdo#108039] -> PASS

* ***@gem_userptr_blits@readonly-unsync:
- shard-skl: TIMEOUT [fdo#108887] -> PASS

* ***@kms_busy@extended-modeset-hang-oldfb-with-reset-render-a:
- {shard-iclb}: DMESG-WARN [fdo#107724] -> PASS +16

* ***@kms_busy@extended-pageflip-hang-newfb-render-c:
- shard-apl: DMESG-WARN [fdo#107956] -> PASS

* ***@kms_cursor_crc@cursor-64x64-suspend:
- shard-glk: FAIL [fdo#103232] -> PASS +1

* ***@kms_draw_crc@draw-method-xrgb2101010-blt-xtiled:
- {shard-iclb}: WARN [fdo#108336] -> PASS +2

* ***@kms_draw_crc@draw-method-xrgb2101010-mmap-cpu-untiled:
- shard-skl: FAIL [fdo#103184] -> PASS

* ***@kms_flip_tiling@flip-to-x-tiled:
- shard-skl: FAIL [fdo#108134] -> PASS

* ***@kms_flip_tiling@flip-y-tiled:
- shard-skl: FAIL [fdo#108303] -> PASS

* ***@kms_frontbuffer_tracking@fbc-1p-offscren-pri-shrfb-draw-mmap-cpu:
- {shard-iclb}: DMESG-FAIL [fdo#107724] -> PASS

* ***@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-gtt:
- shard-apl: FAIL [fdo#103167] -> PASS

* ***@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-move:
- {shard-iclb}: FAIL [fdo#103167] -> PASS +4

* ***@kms_frontbuffer_tracking@fbc-rgb565-draw-render:
- shard-glk: FAIL [fdo#103167] -> PASS +1

* ***@kms_frontbuffer_tracking@psr-1p-primscrn-pri-indfb-draw-mmap-cpu:
- {shard-iclb}: DMESG-WARN [fdo#107724] / [fdo#108336] -> PASS +5

* {***@kms_plane@pixel-format-pipe-c-planes-source-clamping}:
- shard-apl: FAIL [fdo#108948] -> PASS

* ***@kms_plane@plane-panning-bottom-right-suspend-pipe-b-planes:
- {shard-iclb}: INCOMPLETE [fdo#107713] -> PASS

* ***@kms_plane_alpha_blend@pipe-b-coverage-7efc:
- shard-skl: FAIL [fdo#107815] -> PASS

* ***@kms_plane_multiple@atomic-pipe-a-tiling-x:
- shard-apl: FAIL [fdo#103166] -> PASS +2

* ***@kms_plane_multiple@atomic-pipe-b-tiling-x:
- {shard-iclb}: FAIL [fdo#103166] -> PASS +1


#### Warnings ####

* ***@i915_selftest@live_contexts:
- {shard-iclb}: DMESG-FAIL [fdo#108569] -> INCOMPLETE [fdo#108315]

* ***@i915_suspend@shrink:
- shard-skl: DMESG-WARN [fdo#108784] -> INCOMPLETE [fdo#106886]
- shard-glk: DMESG-WARN [fdo#108784] -> INCOMPLETE [fdo#103359] / [fdo#106886] / [k.org#198133]

* ***@kms_cursor_crc@cursor-256x256-suspend:
- {shard-iclb}: INCOMPLETE [fdo#107713] -> FAIL [fdo#103232]

* ***@kms_cursor_crc@cursor-256x85-random:
- {shard-iclb}: FAIL [fdo#103232] -> DMESG-WARN [fdo#107724] / [fdo#108336]

* ***@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-spr-indfb-draw-mmap-gtt:
- {shard-iclb}: FAIL [fdo#103167] -> DMESG-FAIL [fdo#107724]

* ***@kms_frontbuffer_tracking@psr-1p-primscrn-spr-indfb-draw-mmap-wc:
- {shard-iclb}: FAIL [fdo#103167] -> DMESG-WARN [fdo#107724] / [fdo#108336] +1


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

[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#103359]: https://bugs.freedesktop.org/show_bug.cgi?id=103359
[fdo#104671]: https://bugs.freedesktop.org/show_bug.cgi?id=104671
[fdo#104782]: https://bugs.freedesktop.org/show_bug.cgi?id=104782
[fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
[fdo#105682]: https://bugs.freedesktop.org/show_bug.cgi?id=105682
[fdo#106886]: https://bugs.freedesktop.org/show_bug.cgi?id=106886
[fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
[fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
[fdo#107815]: https://bugs.freedesktop.org/show_bug.cgi?id=107815
[fdo#107956]: https://bugs.freedesktop.org/show_bug.cgi?id=107956
[fdo#108039]: https://bugs.freedesktop.org/show_bug.cgi?id=108039
[fdo#108134]: https://bugs.freedesktop.org/show_bug.cgi?id=108134
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#108222]: https://bugs.freedesktop.org/show_bug.cgi?id=108222
[fdo#108303]: https://bugs.freedesktop.org/show_bug.cgi?id=108303
[fdo#108315]: https://bugs.freedesktop.org/show_bug.cgi?id=108315
[fdo#108336]: https://bugs.freedesktop.org/show_bug.cgi?id=108336
[fdo#108569]: https://bugs.freedesktop.org/show_bug.cgi?id=108569
[fdo#108654]: https://bugs.freedesktop.org/show_bug.cgi?id=108654
[fdo#108784]: https://bugs.freedesktop.org/show_bug.cgi?id=108784
[fdo#108887]: https://bugs.freedesktop.org/show_bug.cgi?id=108887
[fdo#108948]: https://bugs.freedesktop.org/show_bug.cgi?id=108948
[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 (7 -> 7)
------------------------------

No changes in participating hosts


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

* Linux: CI_DRM_5292 -> Patchwork_11056

CI_DRM_5292: ec6b8cacbc8777a77119fa7af7e2930fe186091b @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4744: 4579ac1d445cf39f6de474071b20db790db575bd @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_11056: a1c311d5605eac8919aa0c8fa62137b168ce0d18 @ 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_11056/
Daniel Vetter
2018-12-10 10:36:40 UTC
Permalink
We need to make sure implementations don't cheat and don't have a
possible schedule/blocking point deeply burried where review can't
catch it.

I'm not sure whether this is the best way to make sure all the
might_sleep() callsites trigger, and it's a bit ugly in the code flow.
But it gets the job done.

Inspired by an i915 patch series which did exactly that, because the
rules haven't been entirely clear to us.

v2: Use the shiny new non_block_start/end annotations instead of
abusing preempt_disable/enable.

Cc: Andrew Morton <***@linux-foundation.org>
Cc: Michal Hocko <***@suse.com>
Cc: David Rientjes <***@google.com>
Cc: "Christian König" <***@amd.com>
Cc: Daniel Vetter <***@ffwll.ch>
Cc: "Jérôme Glisse" <***@redhat.com>
Cc: linux-***@kvack.org
Signed-off-by: Daniel Vetter <***@intel.com>
---
mm/mmu_notifier.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/mm/mmu_notifier.c b/mm/mmu_notifier.c
index ccc22f21b735..a50ed7d1ecef 100644
--- a/mm/mmu_notifier.c
+++ b/mm/mmu_notifier.c
@@ -185,7 +185,13 @@ int __mmu_notifier_invalidate_range_start(struct mm_struct *mm,
id = srcu_read_lock(&srcu);
hlist_for_each_entry_rcu(mn, &mm->mmu_notifier_mm->list, hlist) {
if (mn->ops->invalidate_range_start) {
- int _ret = mn->ops->invalidate_range_start(mn, mm, start, end, blockable);
+ int _ret;
+
+ if (!blockable)
+ non_block_start();
+ _ret = mn->ops->invalidate_range_start(mn, mm, start, end, blockable);
+ if (!blockable)
+ non_block_end();
if (_ret) {
pr_info("%pS callback failed with %d in %sblockable context.\n",
mn->ops->invalidate_range_start, _ret,
--
2.20.0.rc1
Patchwork
2018-12-10 12:28:37 UTC
Permalink
== Series Details ==

Series: mmu notifier debug checks v2
URL : https://patchwork.freedesktop.org/series/53828/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_5292 -> Patchwork_11056
====================================================

Summary
-------

**SUCCESS**

No regressions found.

External URL: https://patchwork.freedesktop.org/api/1.0/series/53828/revisions/1/mbox/

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in Patchwork_11056:

### IGT changes ###

#### Warnings ####

* ***@kms_busy@basic-flip-a:
- {fi-kbl-7567u}: PASS -> SKIP +2


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

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

### IGT changes ###

#### Issues hit ####

* ***@amdgpu/***@cs-compute:
- fi-kbl-8809g: NOTRUN -> FAIL [fdo#108094]

* ***@amdgpu/***@amd-to-i915:
- fi-kbl-8809g: NOTRUN -> FAIL [fdo#107341]

* {***@runner@aborted}:
- {fi-icl-y}: NOTRUN -> FAIL [fdo#108070]


#### Possible fixes ####

* ***@amdgpu/***@userptr:
- fi-kbl-8809g: DMESG-WARN [fdo#108965] -> PASS

* ***@gem_ctx_create@basic-files:
- fi-bsw-kefka: FAIL [fdo#108656] -> PASS

* ***@i915_selftest@live_gem:
- fi-bsw-n3050: DMESG-WARN -> PASS

* ***@i915_selftest@live_hangcheck:
- fi-cfl-8109u: INCOMPLETE [fdo#106070] -> PASS
- fi-kbl-7560u: INCOMPLETE [fdo#108044] -> PASS

* ***@kms_frontbuffer_tracking@basic:
- fi-byt-clapper: FAIL [fdo#103167] -> PASS

* ***@kms_pipe_crc_basic@nonblocking-crc-pipe-b:
- fi-byt-clapper: FAIL [fdo#107362] -> PASS

* ***@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
- fi-cfl-8109u: DMESG-WARN -> PASS


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

[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#106070]: https://bugs.freedesktop.org/show_bug.cgi?id=106070
[fdo#107341]: https://bugs.freedesktop.org/show_bug.cgi?id=107341
[fdo#107362]: https://bugs.freedesktop.org/show_bug.cgi?id=107362
[fdo#108044]: https://bugs.freedesktop.org/show_bug.cgi?id=108044
[fdo#108070]: https://bugs.freedesktop.org/show_bug.cgi?id=108070
[fdo#108094]: https://bugs.freedesktop.org/show_bug.cgi?id=108094
[fdo#108656]: https://bugs.freedesktop.org/show_bug.cgi?id=108656
[fdo#108965]: https://bugs.freedesktop.org/show_bug.cgi?id=108965


Participating hosts (50 -> 45)
------------------------------

Additional (1): fi-icl-y
Missing (6): fi-kbl-soraka fi-ilk-m540 fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-icl-u3


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

* Linux: CI_DRM_5292 -> Patchwork_11056

CI_DRM_5292: ec6b8cacbc8777a77119fa7af7e2930fe186091b @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4744: 4579ac1d445cf39f6de474071b20db790db575bd @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_11056: a1c311d5605eac8919aa0c8fa62137b168ce0d18 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

a1c311d5605e mm, notifier: Add a lockdep map for invalidate_range_start
138e4dcc716f mm, notifier: Catch sleeping/blocking for !blockable
735885c1e985 kernel.h: Add non_block_start/end()
834029401554 mm: Check if mmu notifier callbacks are allowed to fail

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_11056/
Continue reading on narkive:
Loading...