lkml.org 
[lkml]   [2021]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: Qestion about device link
On Wed, May 12, 2021 at 8:38 AM Hillf Danton <hdanton@sina.com> wrote:
>
> On Tue, 11 May 2021 21:43:40 Rafael J. Wysocki wrote:
> > > #ifdef CONFIG_SRCU
> > > +static void __device_link_free_fn(struct work_struct *work)
> > > +{
> > > + device_link_free(container_of(work, struct device_link, srcu.work));
> > > +}
> > > +
> > > static void __device_link_free_srcu(struct rcu_head *rhead)
> > > {
> > > - device_link_free(container_of(rhead, struct device_link, rcu_head));
> > > + struct device_link *link = container_of(rhead, struct device_link,
> > > + srcu.rhead);
> > > + struct work_struct *work = &link->srcu.work;
> > > +
> > > + /*
> > > + * Because device_link_free() may sleep in some cases, schedule the
> > > + * execution of it instead of invoking it directly.
> > > + */
> > > + INIT_WORK(work, __device_link_free_fn);
> > > + schedule_work(work);
> > > }
>
> Nope, you need something like queue_work(system_unbound_wq, work); instead
> because of the blocking wq callback.

system_long_wq rather, as it really doesn't matter when it gets completed.

\
 
 \ /
  Last update: 2021-05-12 13:33    [W:0.067 / U:0.468 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site