On 2019/05/21 19:06, Daniel Vetter wrote:
> 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. Quoting Michal:
> 
> "The notifier is called from quite a restricted context - oom_reaper -
> which shouldn't depend on any locks or sleepable conditionals. The code
> should be swift as well but we mostly do care about it to make a forward
> progress. Checking for sleepable context is the best thing we could come
> up with that would describe these demands at least partially."
> 

Can this be checked for OOM notifier as well?

        if (!is_memcg_oom(oc)) {
+               non_block_start();
                blocking_notifier_call_chain(&oom_notify_list, 0, &freed);
+               non_block_end();
                if (freed > 0)
                        /* Got some memory back in the last second. */
                        return true;
        }

It is not clear whether i915's oom_notifier function has such dependency.
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to