From: Seth Forshee <seth.forshee@canonical.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Alberto Milone <alberto.milone@canonical.com>,
linux-fsdevel@vger.kernel.org, mingo@kernel.org
Subject: Re: [PATCH 1/1] radix-tree: do not export radix_tree_preloads as GPL
Date: Mon, 20 Jul 2020 09:49:47 -0500 [thread overview]
Message-ID: <20200720144947.GC3644@ubuntu-x1> (raw)
In-Reply-To: <20200717155519.GM3644@ubuntu-x1>
On Fri, Jul 17, 2020 at 10:55:19AM -0500, Seth Forshee wrote:
> On Fri, Jul 17, 2020 at 09:34:39AM -0500, Seth Forshee wrote:
> > On Fri, Jul 17, 2020 at 09:28:48AM -0500, Seth Forshee wrote:
> > > On Fri, Jul 17, 2020 at 03:45:10PM +0200, Alberto Milone wrote:
> > > > On 17/07/2020 15:21, Sebastian Andrzej Siewior wrote:
> > > > > On 2020-07-17 14:33:31 [+0200], Alberto Milone wrote:
> > > > >> I checked and CONFIG_DEBUG_LOCK_ALLOC is not enabled in our kernels.
> > > > > The access to that variable is optimized away if not for debug. I made
> > > > > this:
> > > > > | #include <linux/module.h>
> > > > > | #include <linux/idr.h>
> > > > > |
> > > > > | static int le_init(void)
> > > > > | {
> > > > > | idr_preload_end();
> > > > > | return 0;
> > > > > | }
> > > > > | module_init(le_init);
> > > > > |
> > > > > | static void le_exit(void)
> > > > > | {
> > > > > | }
> > > > > | module_exit(le_exit);
> > > > > |
> > > > > | MODULE_DESCRIPTION("driver");
> > > > > | MODULE_LICENSE("prop");
> > > > >
> > > > > and it produced a .ko. Here the "idr_preload_end()" was reduced to
> > > > > "preempt_enable()" as intended. No access to
> > > > > "&radix_tree_preloads.lock".
> > > > >
> > > > > Sebastian
> > > > * Subscribing Seth
> > >
> > > Looks like the driver is not using idr_preload_end() though, it is
> > > calling radix_tree_preload_end() which uses radix_tree_preloads whether
> > > or not CONFIG_DEBUG_LOCK_ALLOC is enabled.
> >
> > Sorry, I didn't dig deep enough. I see that radix_tree_preload_end() is
> > expected to opimize away that access too. I wonder if different
> > toolchains could be ending up with different reults.
>
> Your example gives me the same error about using radix_tree_preloads. I
> also added:
>
> #ifdef CONFIG_DEBUG_LOCK_ALLOC
> #warn "CONFIG_DEBUG_LOCK_ALLOC enabled"
> #endif
>
> Nothing is printed, so the option really does appear to be off. I've
> been staring at it a while and I can't see why the module still ends up
> referencing radix_tree_preloads, but it is clearly happening.
Even ignoring what is happening with our kernels, isn't this a
regression with CONFIG_DEBUG_LOCK_ALLOC=y that should be fixed? There
have been similar cases in the past where gpl-only exports leaked out
into interfaces which were previously usable by non-gpl modules, and
they were fixed -- 31c5bda3a656089f01963d290a40ccda181f816e and
9e987b70ada27554c5d176421de1d167218c49b5 are a couple of examples I was
able to find with minimal effort. Why is this case any different?
Thanks,
Seth
prev parent reply other threads:[~2020-07-20 14:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-17 10:18 [PATCH 1/1] radix-tree: do not export radix_tree_preloads as GPL Alberto Milone
2020-07-17 10:43 ` Sebastian Andrzej Siewior
[not found] ` <ba5d59f6-2e40-d13a-ecc8-d8430a1b6a14@canonical.com>
2020-07-17 12:35 ` Fwd: " Alberto Milone
2020-07-17 13:21 ` Sebastian Andrzej Siewior
2020-07-17 13:45 ` Alberto Milone
2020-07-17 14:28 ` Seth Forshee
2020-07-17 14:31 ` Sebastian Andrzej Siewior
2020-07-17 14:34 ` Seth Forshee
[not found] ` <20200717155519.GM3644@ubuntu-x1>
2020-07-20 14:49 ` Seth Forshee [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200720144947.GC3644@ubuntu-x1 \
--to=seth.forshee@canonical.com \
--cc=alberto.milone@canonical.com \
--cc=bigeasy@linutronix.de \
--cc=linux-fsdevel@vger.kernel.org \
--cc=mingo@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.