[Intel-gfx] [PATCH] drm/i915: Fix a bug calling sleep function in atomic context

Chris Wilson chris at chris-wilson.co.uk
Wed Nov 13 20:05:29 UTC 2019


Quoting Bruce Chang (2019-11-13 19:52:44)
> There are quite a few reports regarding "BUG: sleeping function called from
> invalid context at mm/page_alloc.c"
> 
> Basically after the io_mapping_map_atomic_wc/kmap_atomic, it enters atomic
> context, but compress_page cannot be called in atomic context as it will
> call pool_alloc with GFP_KERNEL flag which can go to sleep. This is why
> the bug got reported.

Just a trimmed stack trace showing the bug will do fine; as the distance
to might_sleep_if() is short.

Then all you need to do is a quick description of why that is a problem,
and why you choose to fix it as you did. The latter is so that we can
assess if you've considered the alternatives, though in this case it is
trivial although the reason why GFP_KERNEL works for us here is not.
-Chris


More information about the Intel-gfx mailing list