From: Oleg Nesterov <oleg@redhat.com>
To: Prarit Bhargava <prarit@redhat.com>
Cc: linux-kernel@vger.kernel.org,
Rusty Russell <rusty@rustcorp.com.au>,
Jason Wessel <jason.wessel@windriver.com>,
Roland McGrath <roland@hack.frob.com>,
kgdb-bugreport@lists.sourceforge.net
Subject: Re: [PATCH] modules, split MODULE_STATE_UNFORMED into separate states
Date: Tue, 30 Sep 2014 21:57:33 +0200 [thread overview]
Message-ID: <20140930195733.GA26492@redhat.com> (raw)
In-Reply-To: <1412104110-18441-1-git-send-email-prarit@redhat.com>
On 09/30, Prarit Bhargava wrote:
>
> MODULE_STATE_UNFORMED needs to be separated into two states; one for the
> module load (MODULE_STATE_LOAD), and one for the module delete
> (MODULE_STATE_DELETE).
And personally I think this makes sense in any case, but I can't really
comment the changes in this area.
> @@ -3647,18 +3646,29 @@ static int m_show(struct seq_file *m, void *p)
> struct module *mod = list_entry(p, struct module, list);
> char buf[8];
>
> - /* We always ignore unformed modules. */
> - if (mod->state == MODULE_STATE_UNFORMED)
> + /*
> + * If the state is MODULE_STATE_LOAD then the module is in
> + * the early stages of loading. No information should be printed
> + * for this module as the data could be in an uninitialized state.
> + */
> + if (mod->state == MODULE_STATE_LOAD)
> return 0;
So this assumes that _UNFORMED state is fine...
Not sure, but I can be easily wrong. For example, print_unload_info() ->
module_refcount() plays with mod->refptr, while free_module() does
module_unload_free() -> free_percpu(mod->refptr). No?
Perhaps it makes sense to start with the simple patch for stable,
+ // sync with m_show()
+ mutex_lock(module_mutex);
mod->state = MODULE_STATE_UNFORMED;
+ mutex_unlock(module_mutex);
then do a more sophisticated fix?
Oleg.
next prev parent reply other threads:[~2014-09-30 20:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-30 19:08 [PATCH] modules, split MODULE_STATE_UNFORMED into separate states Prarit Bhargava
2014-09-30 19:57 ` Oleg Nesterov [this message]
2014-09-30 20:06 ` Oleg Nesterov
2014-09-30 22:32 ` Prarit Bhargava
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=20140930195733.GA26492@redhat.com \
--to=oleg@redhat.com \
--cc=jason.wessel@windriver.com \
--cc=kgdb-bugreport@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=prarit@redhat.com \
--cc=roland@hack.frob.com \
--cc=rusty@rustcorp.com.au \
/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.