linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* sched: exporting linux-rt migrate_disable for ZFS
@ 2020-12-08 23:58 Orivej Desh
  2020-12-14 12:33 ` Sebastian Andrzej Siewior
  0 siblings, 1 reply; 5+ messages in thread
From: Orivej Desh @ 2020-12-08 23:58 UTC (permalink / raw)
  To: LKML
  Cc: Sebastian Andrzej Siewior, Thomas Gleixner, Steven Rostedt,
	linux-rt-users, Peter Zijlstra, Brian Behlendorf

Greetings!

(If you are receiving this again, that's because I'm sending from
another domain since my message from @gmx.fr was not forwarded to the
lists.)

With sched-Add-migrate_disable.patch first released in v5.9-rc8-rt14 [1]
linux-rt defines functions migrate_disable and migrate_enable.
They are used in linux headers in various macros and static inline
functions, and in particular in kmap_atomic and kunmap_atomic.
The latter are needed by ZFS which currently fails to build against
5.9-rt [2] because these functions are exported with EXPORT_SYMBOL_GPL.
Could you export them with EXPORT_SYMBOL instead?

I have checked that ZFS 2.0.0 builds and works with 5.9.1-rt20 (with
an additional fix [3]) with this patch:

--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -1812 +1812 @@ void migrate_disable(void)
-EXPORT_SYMBOL_GPL(migrate_disable);
+EXPORT_SYMBOL(migrate_disable);
@@ -1843 +1843 @@ void migrate_enable(void)
-EXPORT_SYMBOL_GPL(migrate_enable);
+EXPORT_SYMBOL(migrate_enable);

[1] https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git/diff/patches/0009-sched-Add-migrate_disable.patch?h=v5.9-rc8-rt14-patches&id=9a89bfdb3bc77aecdd0ff8cc69b595541c7b50c4
[2] https://github.com/openzfs/zfs/issues/11097#issuecomment-740682245
[3] https://github.com/openzfs/zfs/pull/11309

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

* Re: sched: exporting linux-rt migrate_disable for ZFS
  2020-12-08 23:58 sched: exporting linux-rt migrate_disable for ZFS Orivej Desh
@ 2020-12-14 12:33 ` Sebastian Andrzej Siewior
  2020-12-14 23:31   ` Orivej Desh
  2020-12-15  3:19   ` Mike Galbraith
  0 siblings, 2 replies; 5+ messages in thread
From: Sebastian Andrzej Siewior @ 2020-12-14 12:33 UTC (permalink / raw)
  To: Orivej Desh
  Cc: LKML, Thomas Gleixner, Steven Rostedt, linux-rt-users,
	Peter Zijlstra, Brian Behlendorf

On 2020-12-08 23:58:27 [+0000], Orivej Desh wrote:
> Greetings!
Hi,

> With sched-Add-migrate_disable.patch first released in v5.9-rc8-rt14 [1]
> linux-rt defines functions migrate_disable and migrate_enable.
> They are used in linux headers in various macros and static inline
> functions, and in particular in kmap_atomic and kunmap_atomic.
> The latter are needed by ZFS which currently fails to build against
> 5.9-rt [2] because these functions are exported with EXPORT_SYMBOL_GPL.
> Could you export them with EXPORT_SYMBOL instead?

This is out of my jurisdiction, so just a few notes:
- v5.9 is out of maintenance. Be careful.
- We don't export symbols for out-of-tree modules.

Sebastian

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

* Re: sched: exporting linux-rt migrate_disable for ZFS
  2020-12-14 12:33 ` Sebastian Andrzej Siewior
@ 2020-12-14 23:31   ` Orivej Desh
  2020-12-15  3:19   ` Mike Galbraith
  1 sibling, 0 replies; 5+ messages in thread
From: Orivej Desh @ 2020-12-14 23:31 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior
  Cc: LKML, Thomas Gleixner, Steven Rostedt, linux-rt-users,
	Peter Zijlstra, Brian Behlendorf

* Sebastian Andrzej Siewior <bigeasy@linutronix.de> [2020-12-14]
> On 2020-12-08 23:58:27 [+0000], Orivej Desh wrote:
> > With sched-Add-migrate_disable.patch first released in v5.9-rc8-rt14 [1]
> > linux-rt defines functions migrate_disable and migrate_enable.
> > They are used in linux headers in various macros and static inline
> > functions, and in particular in kmap_atomic and kunmap_atomic.
> > The latter are needed by ZFS which currently fails to build against
> > 5.9-rt [2] because these functions are exported with EXPORT_SYMBOL_GPL.
> > Could you export them with EXPORT_SYMBOL instead?  
> 
> This is out of my jurisdiction, so just a few notes:
> - v5.9 is out of maintenance. Be careful.

Thanks! I have noticed a bug with usb-storage (using smp_processor_id
in preemptible code) in 5.9.1-rt20 thas has been fixed in 5.10-rt17.

> - We don't export symbols for out-of-tree modules.

The issue is that in the vanilla kernel these two functions are
available as macros that expand into EXPORT_SYMBOL function calls
(kunmap_atomic_high, etc.). If I am not mistaken the kernel is
generally supposed to keep the API made available to non-GPL modules
still available, for example here https://lwn.net/Articles/171838/ :
"When GPL-only exports were first added to the kernel, they went in
with the understanding that only new symbols would be tagged
GPL-only. The current module interface - while always subject to
change - was not to have symbols withdrawn arbitrarily." The current
rt patch has this effect: it makes non-GPL API of the vanilla kernel
GPL-only.

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

* Re: sched: exporting linux-rt migrate_disable for ZFS
  2020-12-14 12:33 ` Sebastian Andrzej Siewior
  2020-12-14 23:31   ` Orivej Desh
@ 2020-12-15  3:19   ` Mike Galbraith
  2020-12-15 14:05     ` Steven Rostedt
  1 sibling, 1 reply; 5+ messages in thread
From: Mike Galbraith @ 2020-12-15  3:19 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior, Orivej Desh
  Cc: LKML, Thomas Gleixner, Steven Rostedt, linux-rt-users,
	Peter Zijlstra, Brian Behlendorf

On Mon, 2020-12-14 at 13:33 +0100, Sebastian Andrzej Siewior wrote:
> On 2020-12-08 23:58:27 [+0000], Orivej Desh wrote:
> > Greetings!
> Hi,
>
> > With sched-Add-migrate_disable.patch first released in v5.9-rc8-rt14 [1]
> > linux-rt defines functions migrate_disable and migrate_enable.
> > They are used in linux headers in various macros and static inline
> > functions, and in particular in kmap_atomic and kunmap_atomic.
> > The latter are needed by ZFS which currently fails to build against
> > 5.9-rt [2] because these functions are exported with EXPORT_SYMBOL_GPL.
> > Could you export them with EXPORT_SYMBOL instead?
>
> This is out of my jurisdiction, so just a few notes:
> - v5.9 is out of maintenance. Be careful.
> - We don't export symbols for out-of-tree modules.

Hm, dejavu all over again.  I recall this issue long ago having been
resolved in favor of exporting via plain EXPORT_SYMBOL.

https://lore.kernel.org/linux-rt-users/1321359802.4181.1.camel@frodo/

From 859a31c5ec958326dd046f4e41f6fa0db0ce98c3 Mon Sep 17 00:00:00 2001
From: Steven Rostedt <srostedt@redhat.com>
Date: Mon, 16 Apr 2012 21:51:54 -0400
Subject: rt: Make migrate_disable/enable() and __rt_mutex_init non-GPL only

Modules that load on the normal vanilla kernel should also load on
an -rt kernel as well. This does not mean we condone non-GPL modules,
we are only being consistent.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/rtmutex.c | 2 +-
 kernel/sched.c   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/rtmutex.c b/kernel/rtmutex.c
index a02fbd9f9583..d58db993f5cd 100644
--- a/kernel/rtmutex.c
+++ b/kernel/rtmutex.c
@@ -1282,7 +1282,7 @@ void __rt_mutex_init(struct rt_mutex *lock, const char *name)

 	debug_rt_mutex_init(lock, name);
 }
-EXPORT_SYMBOL_GPL(__rt_mutex_init);
+EXPORT_SYMBOL(__rt_mutex_init);

 /**
  * rt_mutex_init_proxy_locked - initialize and lock a rt_mutex on behalf of a
diff --git a/kernel/sched.c b/kernel/sched.c
index df3048139d1b..ed3433573641 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -4255,7 +4255,7 @@ void migrate_disable(void)
 	p->migrate_disable = 1;
 	preempt_enable();
 }
-EXPORT_SYMBOL_GPL(migrate_disable);
+EXPORT_SYMBOL(migrate_disable);

 void migrate_enable(void)
 {
@@ -4307,7 +4307,7 @@ void migrate_enable(void)
 	unpin_current_cpu();
 	preempt_enable();
 }
-EXPORT_SYMBOL_GPL(migrate_enable);
+EXPORT_SYMBOL(migrate_enable);
 #else
 static inline void update_migrate_disable(struct task_struct *p) { }
 #define migrate_disabled_updated(p)		0
--
2.29.2



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

* Re: sched: exporting linux-rt migrate_disable for ZFS
  2020-12-15  3:19   ` Mike Galbraith
@ 2020-12-15 14:05     ` Steven Rostedt
  0 siblings, 0 replies; 5+ messages in thread
From: Steven Rostedt @ 2020-12-15 14:05 UTC (permalink / raw)
  To: Mike Galbraith
  Cc: Sebastian Andrzej Siewior, Orivej Desh, LKML, Thomas Gleixner,
	linux-rt-users, Peter Zijlstra, Brian Behlendorf

On Tue, 15 Dec 2020 04:19:23 +0100
Mike Galbraith <efault@gmx.de> wrote:

> From 859a31c5ec958326dd046f4e41f6fa0db0ce98c3 Mon Sep 17 00:00:00 2001
> From: Steven Rostedt <srostedt@redhat.com>
> Date: Mon, 16 Apr 2012 21:51:54 -0400
> Subject: rt: Make migrate_disable/enable() and __rt_mutex_init non-GPL only
> 
> Modules that load on the normal vanilla kernel should also load on
> an -rt kernel as well. This does not mean we condone non-GPL modules,
> we are only being consistent.
> 
> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>

Yep,

Back in the day (like in 2005), we said that -rt should strive to work
wherever vanilla Linux works. Thus, if we add a symbol that replaces a non
GPL symbol, we need to keep that symbol non GPL.

-- Steve

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

end of thread, other threads:[~2020-12-15 14:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-08 23:58 sched: exporting linux-rt migrate_disable for ZFS Orivej Desh
2020-12-14 12:33 ` Sebastian Andrzej Siewior
2020-12-14 23:31   ` Orivej Desh
2020-12-15  3:19   ` Mike Galbraith
2020-12-15 14:05     ` Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).