From: Daniel Vetter <daniel@ffwll.ch>
To: "Paul E. McKenney" <paulmck@linux.ibm.com>
Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org,
mingo@kernel.org, jiangshanlai@gmail.com, dipankar@in.ibm.com,
akpm@linux-foundation.org, mathieu.desnoyers@efficios.com,
josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org,
rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com,
fweisbec@gmail.com, oleg@redhat.com, joel@joelfernandes.org,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <maxime.ripard@bootlin.com>,
Sean Paul <sean@poorly.run>, David Airlie <airlied@linux.ie>,
Daniel Vetter <daniel@ffwll.ch>, Tejun Heo <tj@kernel.org>,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH RFC tip/core/rcu 2/4] drivers/gpu/drm: Dynamically allocate drm_unplug_srcu
Date: Tue, 2 Apr 2019 18:14:28 +0200 [thread overview]
Message-ID: <20190402161428.GM2665@phenom.ffwll.local> (raw)
In-Reply-To: <20190402142933.14547-2-paulmck@linux.ibm.com>
On Tue, Apr 02, 2019 at 07:29:31AM -0700, Paul E. McKenney wrote:
> Having DEFINE_SRCU() or DEFINE_STATIC_SRCU() in a loadable module
> requires that the size of the reserved region be increased, which is not
> something we really want to be doing. This commit therefore removes
> the DEFINE_STATIC_SRCU() from drivers/gpu/drm/drm_drv.c in favor of
> defining drm_unplug_srcu as a simple srcu_struct, initializing it in
> drm_core_init(), and cleaning it up in drm_core_exit().
>
> In this particular case, drm_unplug_srcu is statically allocated and thus
> guaranteed to be initially zero. Unfortunately, cleanup_srcu_struct()
> cannot rely on this in the general case (which includes dynamically
> allocated srcu_struct structures), and therefore cannot tell whether it
> is being called on something that has been passed to init_srcu_struct().
> Thus the code added to drm_core_init() is a bit non-standard.
>
> Reported-by: kbuild test robot <lkp@intel.com>
> Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Maxime Ripard <maxime.ripard@bootlin.com>
> Cc: Sean Paul <sean@poorly.run>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: Tejun Heo <tj@kernel.org>
> Cc: <dri-devel@lists.freedesktop.org>
Seems reasonable (but I don't have the full patch series as context).
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Any preferences as to how this should be merged? Upfront ack for merging
through rcu trees if that helps you.
-Daniel
> ---
> drivers/gpu/drm/drm_drv.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
> index 381581b01d48..ce4582af814d 100644
> --- a/drivers/gpu/drm/drm_drv.c
> +++ b/drivers/gpu/drm/drm_drv.c
> @@ -77,7 +77,7 @@ static bool drm_core_init_complete = false;
>
> static struct dentry *drm_debugfs_root;
>
> -DEFINE_STATIC_SRCU(drm_unplug_srcu);
> +static struct srcu_struct drm_unplug_srcu;
>
> /*
> * DRM Minors
> @@ -958,12 +958,18 @@ static void drm_core_exit(void)
> drm_sysfs_destroy();
> idr_destroy(&drm_minors_idr);
> drm_connector_ida_destroy();
> + cleanup_srcu_struct(&drm_unplug_srcu);
> }
>
> static int __init drm_core_init(void)
> {
> int ret;
>
> + ret = init_srcu_struct(&drm_unplug_srcu);
> + if (ret) {
> + DRM_ERROR("Cannot create DRM class: %d\n", ret);
> + return ret; /* cannot cleanup after failed srcu_struct init. */
> + }
> drm_connector_ida_init();
> idr_init(&drm_minors_idr);
>
> --
> 2.17.1
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
next prev parent reply other threads:[~2019-04-02 16:14 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-02 14:28 [PATCH RFC tip/core/rcu 0/4] Forbid static SRCU use in modules Paul E. McKenney
2019-04-02 14:29 ` [PATCH RFC tip/core/rcu 1/4] dax/super: Dynamically allocate dax_srcu Paul E. McKenney
2019-04-03 18:31 ` Dan Williams
2019-04-04 21:04 ` Paul E. McKenney
2019-04-02 14:29 ` [PATCH RFC tip/core/rcu 2/4] drivers/gpu/drm: Dynamically allocate drm_unplug_srcu Paul E. McKenney
2019-04-02 16:14 ` Daniel Vetter [this message]
2019-04-02 14:29 ` [PATCH RFC tip/core/rcu 3/4] drivers/gpu/drm/amd: Dynamically allocate kfd_processes_srcu Paul E. McKenney
2019-04-02 17:40 ` Kuehling, Felix
2019-04-04 21:16 ` Paul E. McKenney
2019-04-02 14:29 ` [PATCH RFC tip/core/rcu 4/4] rcu: Forbid DEFINE{,_STATIC}_SRCU() from modules Paul E. McKenney
2019-04-02 15:14 ` [PATCH RFC tip/core/rcu 0/4] Forbid static SRCU use in modules Mathieu Desnoyers
2019-04-02 15:23 ` Paul E. McKenney
2019-04-02 15:34 ` Mathieu Desnoyers
2019-04-03 13:32 ` Paul E. McKenney
2019-04-03 14:27 ` Mathieu Desnoyers
2019-04-03 16:20 ` Paul E. McKenney
2019-04-03 19:30 ` Joel Fernandes
2019-04-05 23:28 ` Paul E. McKenney
2019-04-06 13:33 ` Joel Fernandes
2019-04-07 13:48 ` Paul E. McKenney
2019-04-06 23:06 ` Joel Fernandes
2019-04-07 13:39 ` Paul E. McKenney
2019-04-07 13:59 ` Paul E. McKenney
2019-04-07 15:46 ` Joel Fernandes
2019-04-07 17:05 ` Paul E. McKenney
2019-04-08 0:36 ` Joel Fernandes
2019-04-08 2:28 ` Paul E. McKenney
2019-04-07 19:26 ` Mathieu Desnoyers
2019-04-07 19:32 ` Joel Fernandes
2019-04-07 20:41 ` Mathieu Desnoyers
2019-04-07 21:07 ` Joel Fernandes
2019-04-08 2:27 ` Paul E. McKenney
2019-04-08 13:05 ` Mathieu Desnoyers
2019-04-08 14:22 ` Paul E. McKenney
2019-04-08 14:49 ` Mathieu Desnoyers
2019-04-08 15:46 ` Paul E. McKenney
2019-04-08 17:24 ` Mathieu Desnoyers
2019-04-09 15:40 ` Joel Fernandes
2019-04-09 15:56 ` Mathieu Desnoyers
2019-04-09 16:18 ` Joel Fernandes
2019-04-09 16:40 ` Paul E. McKenney
2019-04-09 16:45 ` Mathieu Desnoyers
2019-04-09 17:55 ` Paul E. McKenney
2019-04-09 18:04 ` Mathieu Desnoyers
2019-04-09 19:14 ` Paul E. McKenney
2019-04-02 18:40 ` Joel Fernandes
2019-04-03 13:19 ` Paul E. McKenney
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=20190402161428.GM2665@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=airlied@linux.ie \
--cc=akpm@linux-foundation.org \
--cc=dhowells@redhat.com \
--cc=dipankar@in.ibm.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=edumazet@google.com \
--cc=fweisbec@gmail.com \
--cc=jiangshanlai@gmail.com \
--cc=joel@joelfernandes.org \
--cc=josh@joshtriplett.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mathieu.desnoyers@efficios.com \
--cc=maxime.ripard@bootlin.com \
--cc=mingo@kernel.org \
--cc=oleg@redhat.com \
--cc=paulmck@linux.ibm.com \
--cc=peterz@infradead.org \
--cc=rcu@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=sean@poorly.run \
--cc=tglx@linutronix.de \
--cc=tj@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®