lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Date:   Wed, 18 Dec 2019 14:57:55 +0100
From:   Michal Hocko <mhocko@...nel.org>
To:     Hillf Danton <hdanton@...a.com>
Cc:     linux-kernel <linux-kernel@...r.kernel.org>,
        linux-mm <linux-mm@...ck.org>, Tejun Heo <tj@...nel.org>,
        Lai Jiangshan <jiangshanlai@...il.com>
Subject: Re: [RFC] workqueue: dexpose worker

You probably wanted to Cc maintainers.

On Wed 18-12-19 11:59:45, Hillf Danton wrote:
> 
> It does not make much sense to expose worker, workqueue's internal
> object, to outsiders, and whatever field inside worker as well.
> Nor does worker pool rather than workqueue and work.

But I have to say that this doesn't really make much sense to me.
What is the problem you are trying to solve?

current_is_executing is a really ambiguous name without any relation to
WQ. Also this seems like a pointless code churn to me. Anyway for
maintainers to judge.

> 
> Signed-off-by: Hillf Danton <hdanton@...a.com>
> ---
> 
> --- a/kernel/workqueue_internal.h
> +++ b/kernel/workqueue_internal.h
> @@ -69,6 +69,13 @@ static inline struct worker *current_wq_
>  	return NULL;
>  }
>  
> +static inline bool current_is_executing(work_func_t func)
> +{
> +	struct worker *worker = current_wq_worker();
> +
> +	return worker && worker->current_func == func;
> +}
> +
>  /*
>   * Scheduler hooks for concurrency managed workqueue.  Only to be used from
>   * sched/ and workqueue.c.
> --- a/kernel/async.c
> +++ b/kernel/async.c
> @@ -327,8 +327,6 @@ EXPORT_SYMBOL_GPL(async_synchronize_cook
>   */
>  bool current_is_async(void)
>  {
> -	struct worker *worker = current_wq_worker();
> -
> -	return worker && worker->current_func == async_run_entry_fn;
> +	return current_is_executing(async_run_entry_fn);
>  }
>  EXPORT_SYMBOL_GPL(current_is_async);
> 

-- 
Michal Hocko
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ