BACKGROUND
==========
When multiple work items are queued to a workqueue, their execution order
doesn't match the queueing order. They may get executed in any order and
simultaneously. When fully serialized execution - one by one in the queueing
order - is needed, an ordered workqueue should be used which can be created
with alloc_ordered_workqueue().
However, alloc_ordered_workqueue() was a later addition. Before it, an
ordered workqueue could be obtained by creating an UNBOUND workqueue with
@max_active==1. This originally was an implementation side-effect which was
broken by 4c16bd327c74 ("workqueue: restore WQ_UNBOUND/max_active==1 to be
ordered"). Because there were users that depended on the ordered execution,
5c0338c68706 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered")
made workqueue allocation path to implicitly promote UNBOUND workqueues w/
@max_active==1 to ordered workqueues.
While this has worked okay, overloading the UNBOUND allocation interface
this way creates other issues. It's difficult to tell whether a given
workqueue actually needs to be ordered and users that legitimately want a
min concurrency level wq unexpectedly gets an ordered one instead. With
planned UNBOUND workqueue updates to improve execution locality and more
prevalence of chiplet designs which can benefit from such improvements, this
isn't a state we wanna be in forever.
This patch series audits all callsites that create an UNBOUND workqueue w/
@max_active==1 and converts them to alloc_ordered_workqueue() as necessary.
WHAT TO LOOK FOR
================
The conversions are from
alloc_workqueue(WQ_UNBOUND | flags, 1, args..)
to
alloc_ordered_workqueue(flags, args...)
which don't cause any functional changes. If you know that fully ordered
execution is not ncessary, please let me know. I'll drop the conversion and
instead add a comment noting the fact to reduce confusion while conversion
is in progress.
If you aren't fully sure, it's completely fine to let the conversion
through. The behavior will stay exactly the same and we can always
reconsider later.
As there are follow-up workqueue core changes, I'd really appreciate if the
patch can be routed through the workqueue tree w/ your acks. Thanks.
Signed-off-by: Tejun Heo <tj(a)kernel.org>
Cc: Johan Hovold <johan(a)kernel.org>
Cc: Alex Elder <elder(a)kernel.org>
Cc: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Cc: greybus-dev(a)lists.linaro.org
---
drivers/greybus/connection.c | 4 ++--
drivers/greybus/svc.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/greybus/connection.c b/drivers/greybus/connection.c
index e3799a53a193..9c88861986c8 100644
--- a/drivers/greybus/connection.c
+++ b/drivers/greybus/connection.c
@@ -187,8 +187,8 @@ _gb_connection_create(struct gb_host_device *hd, int hd_cport_id,
spin_lock_init(&connection->lock);
INIT_LIST_HEAD(&connection->operations);
- connection->wq = alloc_workqueue("%s:%d", WQ_UNBOUND, 1,
- dev_name(&hd->dev), hd_cport_id);
+ connection->wq = alloc_ordered_workqueue("%s:%d", 0, dev_name(&hd->dev),
+ hd_cport_id);
if (!connection->wq) {
ret = -ENOMEM;
goto err_free_connection;
diff --git a/drivers/greybus/svc.c b/drivers/greybus/svc.c
index 16cced80867a..0d7e749174a4 100644
--- a/drivers/greybus/svc.c
+++ b/drivers/greybus/svc.c
@@ -1318,7 +1318,7 @@ struct gb_svc *gb_svc_create(struct gb_host_device *hd)
if (!svc)
return NULL;
- svc->wq = alloc_workqueue("%s:svc", WQ_UNBOUND, 1, dev_name(&hd->dev));
+ svc->wq = alloc_ordered_workqueue("%s:svc", 0, dev_name(&hd->dev));
if (!svc->wq) {
kfree(svc);
return NULL;
--
2.40.0
It has been discovered that the following configuration options are undefined in the current latest version, v6.3-rc4, yet they are being relied upon by other configuration options in multiple Kconfig files:
MIPS_BAIKAL_T1 is undefined, used as a 'depends on' condition in multiple files such as drivers/ata/Kconfig, drivers/hwmon/Kconfig, drivers/bus/Kconfig, and drivers/memory/Kconfig.
MFD_MAX597X is undefined, used as a 'depends on' condition in Kconfig file drivers/regulator/Kconfig.
MFD_SM5703 is undefined, used as a 'depends on' condition in Kconfig file drivers/regulator/Kconfig.
ARCH_THUNDERBAY is undefined, used as a 'depends on' condition in Kconfig files drivers/pinctrl/Kconfig and drivers/phy/intel/Kconfig.
ARCH_BCM4908 is undefined, used as a 'depends on' condition in Kconfig file drivers/leds/blink/Kconfig.
MFD_TN48M_CPLD is undefined, used as a 'depends on' condition in Kconfig files drivers/gpio/Kconfig and drivers/reset/Kconfig.
USB_HSIC_USB3613 is undefined, used as a 'depends on' condition in drivers/staging/greybus/Kconfig and drivers/staging/greybus/arche-platform.c.
If these 7 configuration options are deprecated, it is recommended to remove the dependencies on them in the Kconfig files.
If they are still useful, it is recommended to define them.
Best regards,
Ying Sun
Pengpeng Hou
Yanjie Ren
Hello,
this series adapts the platform drivers below drivers/staging to use the
.remove_new() callback. Compared to the traditional .remove() callback
.remove_new() returns no value. This is a good thing because the driver
core doesn't (and cannot) cope for errors during remove. The only effect
of a non-zero return value in .remove() is that the driver core emits a
warning. The device is removed anyhow and an early return from .remove()
usually yields a resource leak.
By changing the remove callback to return void driver authors cannot
reasonably assume any more that there is some kind of cleanup later.
All drivers in staging already return zero in their remove callback, so
they can be trivially converted.
The changes to the individual drivers are all orthogonal. If I need to
resend some patches because of some review feedback, I'd like to only
send the patches that actually needed changes, so please pick up the
remaining patches that don't need changing to reduce the amount of mail.
Best regards
Uwe
Uwe Kleine-König (24):
staging: axis-fifo: Convert to platform remove callback returning void
staging: emxx_udc: Convert to platform remove callback returning void
staging: fieldbus: arcx-anybus: Convert to platform remove callback
returning void
staging: greybus: arche-apb-ctrl: Convert to platform remove callback
returning void
staging: greybus: arche: Convert to platform remove callback returning
void
staging: media: atmel-sama5d2-isc: Convert to platform remove callback
returning void
staging: media: atmel-sama7g5-isc: Convert to platform remove callback
returning void
staging: media: imx-media-csi: Convert to platform remove callback
returning void
staging: media: imx-media-dev: Convert to platform remove callback
returning void
staging: media: imx6-mipi-csi2: Convert to platform remove callback
returning void
staging: media: imx8mq-mipi-csi2: Convert to platform remove callback
returning void
staging: media: meson: vdec: Convert to platform remove callback
returning void
staging: media: omap4iss: Convert to platform remove callback
returning void
staging: media: rkvdec: Convert to platform remove callback returning
void
staging: media: sunxi: cedrus: Convert to platform remove callback
returning void
staging: media: sun6i-isp: Convert to platform remove callback
returning void
staging: most: dim2: Convert to platform remove callback returning
void
staging: nvec: Convert to platform remove callback returning void
staging: nvec: nvec_kbd: Convert to platform remove callback returning
void
staging: nvec_power: Convert to platform remove callback returning
void
staging: nvec_ps2: Convert to platform remove callback returning void
staging: octeon: ethernet: Convert to platform remove callback
returning void
staging: vc04_services: bcm2835-camera: Convert to platform remove
callback returning void
staging: vc04_services: vchiq_arm: Convert to platform remove callback
returning void
drivers/staging/axis-fifo/axis-fifo.c | 6 ++----
drivers/staging/emxx_udc/emxx_udc.c | 6 ++----
drivers/staging/fieldbus/anybuss/arcx-anybus.c | 5 ++---
drivers/staging/greybus/arche-apb-ctrl.c | 6 ++----
drivers/staging/greybus/arche-platform.c | 6 ++----
drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c | 6 ++----
drivers/staging/media/deprecated/atmel/atmel-sama7g5-isc.c | 6 ++----
drivers/staging/media/imx/imx-media-csi.c | 6 ++----
drivers/staging/media/imx/imx-media-dev.c | 6 ++----
drivers/staging/media/imx/imx6-mipi-csi2.c | 6 ++----
drivers/staging/media/imx/imx8mq-mipi-csi2.c | 6 ++----
drivers/staging/media/meson/vdec/vdec.c | 6 ++----
drivers/staging/media/omap4iss/iss.c | 6 ++----
drivers/staging/media/rkvdec/rkvdec.c | 5 ++---
drivers/staging/media/sunxi/cedrus/cedrus.c | 6 ++----
drivers/staging/media/sunxi/sun6i-isp/sun6i_isp.c | 6 ++----
drivers/staging/most/dim2/dim2.c | 6 ++----
drivers/staging/nvec/nvec.c | 6 ++----
drivers/staging/nvec/nvec_kbd.c | 6 ++----
drivers/staging/nvec/nvec_power.c | 6 ++----
drivers/staging/nvec/nvec_ps2.c | 6 ++----
drivers/staging/octeon/ethernet.c | 5 ++---
.../staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 6 ++----
.../staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 6 ++----
24 files changed, 48 insertions(+), 93 deletions(-)
base-commit: fe15c26ee26efa11741a7b632e9f23b01aca4cc6
--
2.39.2