lkml.org 
[lkml]   [2020]   [Oct]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] workqueue: replace call_rcu with kfree_rcu
On Wed, Oct 14, 2020 at 04:31:45PM +0800, qiang.zhang@windriver.com wrote:
> diff --git a/kernel/workqueue.c b/kernel/workqueue.c
> index ac088ce6059b..8d4fe649631a 100644
> --- a/kernel/workqueue.c
> +++ b/kernel/workqueue.c
> @@ -3653,11 +3653,6 @@ static struct worker_pool *get_unbound_pool(const struct workqueue_attrs *attrs)
> return NULL;
> }
>
> -static void rcu_free_pwq(struct rcu_head *rcu)
> -{
> - kmem_cache_free(pwq_cache,
> - container_of(rcu, struct pool_workqueue, rcu));
> -}
>
> /*
> * Scheduled on system_wq by put_pwq() when an unbound pwq hits zero refcnt
> @@ -3683,7 +3678,7 @@ static void pwq_unbound_release_workfn(struct work_struct *work)
> put_unbound_pool(pool);
> mutex_unlock(&wq_pool_mutex);
>
> - call_rcu(&pwq->rcu, rcu_free_pwq);
> + kfree_rcu(pwq, rcu);

kfree_rcu() eventually calls kfree() which is different from
kmem_cache_free(). It can only be used for kmalloc'd areas, not
kmem_cache_alloc'd ones.

Thanks.

--
tejun

\
 
 \ /
  Last update: 2020-10-26 14:42    [W:0.089 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site