From: Chris Down <chris@chrisdown.name>
To: Petr Mladek <pmladek@suse.com>
Cc: linux-kernel@vger.kernel.org,
Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
John Ogness <john.ogness@linutronix.de>,
Johannes Weiner <hannes@cmpxchg.org>,
Andrew Morton <akpm@linux-foundation.org>,
Steven Rostedt <rostedt@goodmis.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Kees Cook <keescook@chromium.org>,
kernel-team@fb.com
Subject: Re: [PATCH v5] printk: Userspace format enumeration support
Date: Fri, 12 Mar 2021 13:53:20 +0000 [thread overview]
Message-ID: <YEtyUM07gsqR6ltG@chrisdown.name> (raw)
In-Reply-To: <YEtNKMF3KH1kUDxY@alley>
Ack to all unmentioned suggestions. :-)
Petr Mladek writes:
>> + changed or no longer present.
>> +
>> + There is no additional runtime cost to printk with this enabled.
>> +
>> #
>> # Architectures with an unreliable sched_clock() should select this:
>> #
>> diff --git a/kernel/module.c b/kernel/module.c
>> index 1e5aad812310..44df2913a046 100644
>> --- a/kernel/module.c
>> +++ b/kernel/module.c
>> @@ -1064,6 +1064,7 @@ SYSCALL_DEFINE2(delete_module, const char __user *, name_user,
>> blocking_notifier_call_chain(&module_notify_list,
>> MODULE_STATE_GOING, mod);
>> klp_module_going(mod);
>> + pi_sec_remove(mod);
>
>Is there any particular reason why this is not done via the module
>notifier, please?
>
>Other subsystems hardcode their callbacks here only when they
>require some special ordering that could not be achieved by
>the notifiers.
>
>The hardcoded callbacks complicate the error paths in
>the module loader code.
Oh! That's exactly what I feel as well, but I mistakenly thought that's what
you were asking for in the feedback for v4. Turns out I misread your statement
about storing the pointer to `struct module` (hence my message last time
querying whether it was sensible or not) as being about not using the module
notifier. Mea culpa.
>> +static void *pi_next(struct seq_file *s, void *v, loff_t *pos)
>> +{
>> + const struct pi_sec *ps = s->file->f_inode->i_private;
>> + struct pi_object *pi = NULL;
>
>Please, call the variables by the content and not by prefix.
>A variable called "pi" might include anything used by "pi" API.
>
>[...]
>
>Please, try to put more effort into creating the function and
>variable names. I know that I am probably too picky about it.
>But you seem to be the other extreme.
>
>Inconsistent, ambiguous, or meaningless names might make even few
>lines of code hard to follow. It makes it write-only.
>It is hard to review and maintain.
Hmm, I'd even say that I agree with this statement, but as I understand it a
`pi` variable always means pi_object, and `ps` always means pi_sec. I'm not
immediately seeing it as meaningless or ambiguous (although maybe your concern
was more abstractly aesthetic with overlapping the `pi_` prefix?).
The "content" here is pretty abstract, so I'm not quite sure what your
suggestion for naming them based on content is. Maybe (assuming it doesn't just
disappear, which it seems it will) a pi_sec named sec, and the pi_object named
fmt_index? I don't feel strongly that this is more clear though, so maybe you
mean something else?
next prev parent reply other threads:[~2021-03-12 13:54 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-10 2:30 [PATCH v5] printk: Userspace format enumeration support Chris Down
2021-03-10 6:20 ` kernel test robot
2021-03-10 6:20 ` kernel test robot
2021-03-10 6:50 ` Greg Kroah-Hartman
2021-03-10 12:12 ` Chris Down
2021-03-10 12:16 ` Greg Kroah-Hartman
2021-03-11 9:34 ` Petr Mladek
2021-03-11 9:43 ` Greg Kroah-Hartman
2021-03-10 12:17 ` Chris Down
2021-03-11 9:20 ` Petr Mladek
2021-03-10 12:31 ` kernel test robot
2021-03-10 12:31 ` kernel test robot
2021-03-12 11:14 ` Petr Mladek
2021-03-12 13:53 ` Chris Down [this message]
2021-03-15 10:02 ` Petr Mladek
2021-03-15 12:20 ` Chris Down
2021-03-16 11:39 ` Petr Mladek
2021-03-16 13:27 ` Chris Down
2021-03-16 14:12 ` Rasmus Villemoes
2021-03-16 14:28 ` Chris Down
2021-03-17 8:40 ` Petr Mladek
2021-03-17 10:03 ` Rasmus Villemoes
2021-03-18 10:46 ` Petr Mladek
2021-03-18 11:31 ` Rasmus Villemoes
2021-03-19 11:43 ` Petr Mladek
2021-04-16 13:56 ` Chris Down
2021-04-16 14:09 ` Joe Perches
2021-04-16 14:29 ` Chris Down
2021-04-19 7:27 ` Rasmus Villemoes
2021-04-19 9:16 ` Petr Mladek
2021-04-19 9:53 ` Greg Kroah-Hartman
2021-04-19 11:02 ` Joe Perches
2021-04-21 13:14 ` Chris Down
2021-04-22 12:36 ` Joe Perches
2021-04-22 14:59 ` Chris Down
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=YEtyUM07gsqR6ltG@chrisdown.name \
--to=chris@chrisdown.name \
--cc=akpm@linux-foundation.org \
--cc=gregkh@linuxfoundation.org \
--cc=hannes@cmpxchg.org \
--cc=john.ogness@linutronix.de \
--cc=keescook@chromium.org \
--cc=kernel-team@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=sergey.senozhatsky@gmail.com \
/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.