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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 22 Feb 2024 12:34:52 +0800
From: Lai Jiangshan <jiangshanlai@...il.com>
To: Tejun Heo <tj@...nel.org>
Cc: torvalds@...ux-foundation.org, linux-kernel@...r.kernel.org, 
	allen.lkml@...il.com, kernel-team@...a.com
Subject: Re: [PATCH 2/7] workqueue: Implement disable/enable for (delayed)
 work items

Hello, Tejun

On Thu, Feb 22, 2024 at 1:43 AM Tejun Heo <tj@...nel.org> wrote:

> +/**
> + * enable_work - Enable a work item
> + * @work: work item to enable
> + *
> + * Undo disable_work[_sync]() by decrementing @work's disable count. @work can
> + * only be queued if its disable count is 0.
> + *
> + * Must be called from a sleepable context. Returns %true if the disable count
> + * reached 0. Otherwise, %false.
> + */
> +bool enable_work(struct work_struct *work)
> +{
> +       struct work_offq_data offqd;
> +       unsigned long irq_flags;
> +
> +       work_grab_pending(work, 0, &irq_flags);
> +
> +       work_offqd_unpack(&offqd, *work_data_bits(work));
> +       work_offqd_enable(&offqd);
> +       set_work_pool_and_clear_pending(work, offqd.pool_id,
> +                                       work_offqd_pack_flags(&offqd));
> +       local_irq_enable();

It can use local_irq_restore() directly or the next patch needs to be fixed.

The next patch making enable_work() able to be called in any context
forgets to change local_irq_enable() to local_irq_restore().

Thanks.
Lai

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ