Re: [PATCH v2 2/5] lib: add error_report_notify to collect debugging tools' reports
From: Alexander Potapenko
Date: Mon Jan 18 2021 - 08:16:52 EST
> > > +
> > > + /* Pairs with acquire in last_report_show(). */
> > > + atomic_inc_return_release(&num_reports);
> > > + schedule_delayed_work(&reporting_done, 0);
> > Why delayed work when it gets queued immediately?
> Because error reports may be sent from a place where waiting is
> forbidden (in the case of KFENCE that is the page fault handler).
> A delayed work ensures the notification occurs in a wait-safe context.
Agreed, there's actually no point in calling schedule_delayed_work()
instead of schedule_work() here.