public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] workqueue: make wq_subsys const
@ 2024-02-04 13:47 Ricardo B. Marliere
  2024-02-04 14:22 ` Greg Kroah-Hartman
  2024-02-04 21:24 ` Tejun Heo
  0 siblings, 2 replies; 9+ messages in thread
From: Ricardo B. Marliere @ 2024-02-04 13:47 UTC (permalink / raw)
  To: Tejun Heo, Lai Jiangshan
  Cc: linux-kernel, Greg Kroah-Hartman, Ricardo B. Marliere

Now that the driver core can properly handle constant struct bus_type,
move the wq_subsys variable to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
---
 kernel/workqueue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index ffb625db9771..09caa1a34630 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -6686,7 +6686,7 @@ static struct device_attribute wq_sysfs_unbound_attrs[] = {
 	__ATTR_NULL,
 };
 
-static struct bus_type wq_subsys = {
+static const struct bus_type wq_subsys = {
 	.name				= "workqueue",
 	.dev_groups			= wq_sysfs_groups,
 };

---
base-commit: d49e20ca05ef22580bd4ae3219a31e4630f8df97
change-id: 20240204-bus_cleanup-workqueue-b5544924b8b9

Best regards,
-- 
Ricardo B. Marliere <ricardo@marliere.net>


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] workqueue: make wq_subsys const
  2024-02-04 13:47 [PATCH] workqueue: make wq_subsys const Ricardo B. Marliere
@ 2024-02-04 14:22 ` Greg Kroah-Hartman
  2024-02-04 21:24 ` Tejun Heo
  1 sibling, 0 replies; 9+ messages in thread
From: Greg Kroah-Hartman @ 2024-02-04 14:22 UTC (permalink / raw)
  To: Ricardo B. Marliere; +Cc: Tejun Heo, Lai Jiangshan, linux-kernel

On Sun, Feb 04, 2024 at 10:47:05AM -0300, Ricardo B. Marliere wrote:
> Now that the driver core can properly handle constant struct bus_type,
> move the wq_subsys variable to be a constant structure as well,
> placing it into read-only memory which can not be modified at runtime.
> 
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
> ---
>  kernel/workqueue.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] workqueue: make wq_subsys const
  2024-02-04 13:47 [PATCH] workqueue: make wq_subsys const Ricardo B. Marliere
  2024-02-04 14:22 ` Greg Kroah-Hartman
@ 2024-02-04 21:24 ` Tejun Heo
  1 sibling, 0 replies; 9+ messages in thread
From: Tejun Heo @ 2024-02-04 21:24 UTC (permalink / raw)
  To: Ricardo B. Marliere; +Cc: Lai Jiangshan, linux-kernel, Greg Kroah-Hartman

On Sun, Feb 04, 2024 at 10:47:05AM -0300, Ricardo B. Marliere wrote:
> Now that the driver core can properly handle constant struct bus_type,
> move the wq_subsys variable to be a constant structure as well,
> placing it into read-only memory which can not be modified at runtime.
> 
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>

Applied to wq/for-6.9.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH] workqueue: make wq_subsys const
@ 2024-02-06 18:05 Ricardo B. Marliere
  2024-02-07 10:12 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 9+ messages in thread
From: Ricardo B. Marliere @ 2024-02-06 18:05 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Tejun Heo, Lai Jiangshan, linux-kernel, Ricardo B. Marliere

Now that the driver core can properly handle constant struct bus_type,
move the wq_subsys variable to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.

Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
---
The maintainer asked [1] for this patch to be received through the
driver-core tree.
[1]: https://lore.kernel.org/all/ZcEeOueCbrltxr_b@slm.duckdns.org/
---
 kernel/workqueue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 76e60faed892..f1e062acd091 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -6157,7 +6157,7 @@ static struct device_attribute wq_sysfs_unbound_attrs[] = {
 	__ATTR_NULL,
 };
 
-static struct bus_type wq_subsys = {
+static const struct bus_type wq_subsys = {
 	.name				= "workqueue",
 	.dev_groups			= wq_sysfs_groups,
 };

---
base-commit: f297a3844aa059c53be3f69be85ebc071b8a6d16
change-id: 20240206-bus_cleanup-workqueue-1547a46532d1

Best regards,
-- 
Ricardo B. Marliere <ricardo@marliere.net>


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] workqueue: make wq_subsys const
  2024-02-06 18:05 Ricardo B. Marliere
@ 2024-02-07 10:12 ` Greg Kroah-Hartman
  2024-02-07 16:34   ` Tejun Heo
  0 siblings, 1 reply; 9+ messages in thread
From: Greg Kroah-Hartman @ 2024-02-07 10:12 UTC (permalink / raw)
  To: Ricardo B. Marliere; +Cc: Tejun Heo, Lai Jiangshan, linux-kernel

On Tue, Feb 06, 2024 at 03:05:06PM -0300, Ricardo B. Marliere wrote:
> Now that the driver core can properly handle constant struct bus_type,
> move the wq_subsys variable to be a constant structure as well,
> placing it into read-only memory which can not be modified at runtime.
> 
> Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
> ---
> The maintainer asked [1] for this patch to be received through the
> driver-core tree.
> [1]: https://lore.kernel.org/all/ZcEeOueCbrltxr_b@slm.duckdns.org/

There is no cross-tree dependency at all, but hey, I'll take it, no
worries...

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] workqueue: make wq_subsys const
  2024-02-07 10:12 ` Greg Kroah-Hartman
@ 2024-02-07 16:34   ` Tejun Heo
  2024-02-08 10:10     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 9+ messages in thread
From: Tejun Heo @ 2024-02-07 16:34 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Ricardo B. Marliere, Lai Jiangshan, linux-kernel

On Wed, Feb 07, 2024 at 10:12:34AM +0000, Greg Kroah-Hartman wrote:
> On Tue, Feb 06, 2024 at 03:05:06PM -0300, Ricardo B. Marliere wrote:
> > Now that the driver core can properly handle constant struct bus_type,
> > move the wq_subsys variable to be a constant structure as well,
> > placing it into read-only memory which can not be modified at runtime.
> > 
> > Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
> > ---
> > The maintainer asked [1] for this patch to be received through the
> > driver-core tree.
> > [1]: https://lore.kernel.org/all/ZcEeOueCbrltxr_b@slm.duckdns.org/
> 
> There is no cross-tree dependency at all, but hey, I'll take it, no
> worries...

Ah, my bad. I branched out wq/for-6.9 before rc1 and was assuming the
dependent commit was still in the driver core branch. I should have just
pulled linus#master. That said, that patch going through driver-core should
still be fine.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] workqueue: make wq_subsys const
  2024-02-07 16:34   ` Tejun Heo
@ 2024-02-08 10:10     ` Greg Kroah-Hartman
  2024-02-08 16:54       ` Tejun Heo
  0 siblings, 1 reply; 9+ messages in thread
From: Greg Kroah-Hartman @ 2024-02-08 10:10 UTC (permalink / raw)
  To: Tejun Heo; +Cc: Ricardo B. Marliere, Lai Jiangshan, linux-kernel

On Wed, Feb 07, 2024 at 06:34:27AM -1000, Tejun Heo wrote:
> On Wed, Feb 07, 2024 at 10:12:34AM +0000, Greg Kroah-Hartman wrote:
> > On Tue, Feb 06, 2024 at 03:05:06PM -0300, Ricardo B. Marliere wrote:
> > > Now that the driver core can properly handle constant struct bus_type,
> > > move the wq_subsys variable to be a constant structure as well,
> > > placing it into read-only memory which can not be modified at runtime.
> > > 
> > > Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > > Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
> > > ---
> > > The maintainer asked [1] for this patch to be received through the
> > > driver-core tree.
> > > [1]: https://lore.kernel.org/all/ZcEeOueCbrltxr_b@slm.duckdns.org/
> > 
> > There is no cross-tree dependency at all, but hey, I'll take it, no
> > worries...
> 
> Ah, my bad. I branched out wq/for-6.9 before rc1 and was assuming the
> dependent commit was still in the driver core branch. I should have just
> pulled linus#master.

The dependent changes are in 6.4, so before -rc1 would have been ok as
well :)

> That said, that patch going through driver-core should still be fine.

Great, will do that, thanks!

greg k-jh

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] workqueue: make wq_subsys const
  2024-02-08 10:10     ` Greg Kroah-Hartman
@ 2024-02-08 16:54       ` Tejun Heo
  2024-02-08 17:28         ` Greg Kroah-Hartman
  0 siblings, 1 reply; 9+ messages in thread
From: Tejun Heo @ 2024-02-08 16:54 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Ricardo B. Marliere, Lai Jiangshan, linux-kernel

On Thu, Feb 08, 2024 at 10:10:56AM +0000, Greg Kroah-Hartman wrote:
> On Wed, Feb 07, 2024 at 06:34:27AM -1000, Tejun Heo wrote:
> > On Wed, Feb 07, 2024 at 10:12:34AM +0000, Greg Kroah-Hartman wrote:
> > > On Tue, Feb 06, 2024 at 03:05:06PM -0300, Ricardo B. Marliere wrote:
> > > > Now that the driver core can properly handle constant struct bus_type,
> > > > move the wq_subsys variable to be a constant structure as well,
> > > > placing it into read-only memory which can not be modified at runtime.
> > > > 
> > > > Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > > > Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
> > > > ---
> > > > The maintainer asked [1] for this patch to be received through the
> > > > driver-core tree.
> > > > [1]: https://lore.kernel.org/all/ZcEeOueCbrltxr_b@slm.duckdns.org/
> > > 
> > > There is no cross-tree dependency at all, but hey, I'll take it, no
> > > worries...
> > 
> > Ah, my bad. I branched out wq/for-6.9 before rc1 and was assuming the
> > dependent commit was still in the driver core branch. I should have just
> > pulled linus#master.
> 
> The dependent changes are in 6.4, so before -rc1 would have been ok as
> well :)

Hmmm....

 > git log -1 --oneline 32f78abe59c7
 32f78abe59c7 driver core: bus: constantify subsys_register() calls
 > git describe --contains 32f78abe59c7
 v6.8-rc1~61^2~10

-- 
tejun

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] workqueue: make wq_subsys const
  2024-02-08 16:54       ` Tejun Heo
@ 2024-02-08 17:28         ` Greg Kroah-Hartman
  0 siblings, 0 replies; 9+ messages in thread
From: Greg Kroah-Hartman @ 2024-02-08 17:28 UTC (permalink / raw)
  To: Tejun Heo; +Cc: Ricardo B. Marliere, Lai Jiangshan, linux-kernel

On Thu, Feb 08, 2024 at 06:54:57AM -1000, Tejun Heo wrote:
> On Thu, Feb 08, 2024 at 10:10:56AM +0000, Greg Kroah-Hartman wrote:
> > On Wed, Feb 07, 2024 at 06:34:27AM -1000, Tejun Heo wrote:
> > > On Wed, Feb 07, 2024 at 10:12:34AM +0000, Greg Kroah-Hartman wrote:
> > > > On Tue, Feb 06, 2024 at 03:05:06PM -0300, Ricardo B. Marliere wrote:
> > > > > Now that the driver core can properly handle constant struct bus_type,
> > > > > move the wq_subsys variable to be a constant structure as well,
> > > > > placing it into read-only memory which can not be modified at runtime.
> > > > > 
> > > > > Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > > > > Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
> > > > > ---
> > > > > The maintainer asked [1] for this patch to be received through the
> > > > > driver-core tree.
> > > > > [1]: https://lore.kernel.org/all/ZcEeOueCbrltxr_b@slm.duckdns.org/
> > > > 
> > > > There is no cross-tree dependency at all, but hey, I'll take it, no
> > > > worries...
> > > 
> > > Ah, my bad. I branched out wq/for-6.9 before rc1 and was assuming the
> > > dependent commit was still in the driver core branch. I should have just
> > > pulled linus#master.
> > 
> > The dependent changes are in 6.4, so before -rc1 would have been ok as
> > well :)
> 
> Hmmm....
> 
>  > git log -1 --oneline 32f78abe59c7
>  32f78abe59c7 driver core: bus: constantify subsys_register() calls
>  > git describe --contains 32f78abe59c7
>  v6.8-rc1~61^2~10

Ugh, sorry, you are totally right.  Too many different "make X const"
series are floating around now, my fault.  I'll go suck this in now to
end the pointless discussion where I am proven wrong multiple times :)

greg k-h

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-02-08 17:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-04 13:47 [PATCH] workqueue: make wq_subsys const Ricardo B. Marliere
2024-02-04 14:22 ` Greg Kroah-Hartman
2024-02-04 21:24 ` Tejun Heo
  -- strict thread matches above, loose matches on Subject: below --
2024-02-06 18:05 Ricardo B. Marliere
2024-02-07 10:12 ` Greg Kroah-Hartman
2024-02-07 16:34   ` Tejun Heo
2024-02-08 10:10     ` Greg Kroah-Hartman
2024-02-08 16:54       ` Tejun Heo
2024-02-08 17:28         ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox