lkml.org 
[lkml]   [2020]   [Sep]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] net: make netdev_wait_allrefs wake-able
>  static inline void dev_put(struct net_device *dev)
> {
> + struct task_struct *destroy_task = dev->destroy_task;
> +
> this_cpu_dec(*dev->pcpu_refcnt);
> + if (destroy_task)
> + wake_up_process(destroy_task);
> }

I just realized that this introduces a race, if dev_put drops the last
reference, an already running netdev_wait_allrefs runs to completion
and then dev_put tries to wake it up.
Any suggestions on how to avoid this without resorting to
locking?

Thanks,
Francesco

\
 
 \ /
  Last update: 2020-09-17 08:35    [W:0.071 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site