From: Yue Hu <zbestahu@gmail.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: jslaby@suse.com, linux-kernel@vger.kernel.org, huyue2@yulong.com,
zbestahu@163.com
Subject: Re: [PATCH] sysrq: use only one slot for loglevels in key table
Date: Thu, 23 Jul 2020 11:01:23 +0800 [thread overview]
Message-ID: <20200723110123.000017e1.zbestahu@gmail.com> (raw)
In-Reply-To: <20200722104952.GB2827860@kroah.com>
On Wed, 22 Jul 2020 12:49:52 +0200
Greg KH <gregkh@linuxfoundation.org> wrote:
> On Wed, Jul 22, 2020 at 05:26:09PM +0800, Yue Hu wrote:
> > From: Yue Hu <huyue2@yulong.com>
> >
> > Currently, sysrq_key_table[] has 10 slots for same interface to change
> > console loglevel. No specific purpose to do that. Let's use only one slot
> > to save memory space. Also, update the key2index calculation. And remove
> > needless code in help message print path to make the logic simpler.
>
> That sounds like a lot of different things being all done at once. Can
> you break this up into individual patches, each only doing one type of
> thing at a time.
Should be not. The different command key(0 - 9) share same operation which is just
setting loglevel. And the code will find the operation via key2index calculation.
So one index/slot is enough to represent it. rt?
>
> And if you are saving memory, please show how much you really are
> saving.
The key table is consuming global memory, decrease the array size should be more
better. It will save 9 slots space. The memory saving is 72 bytes via
sizeof(sysrq_key_table) tested under arm64.
>
> thanks,
>
> greg k-h
prev parent reply other threads:[~2020-07-23 3:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-22 9:26 Yue Hu
2020-07-22 10:49 ` Greg KH
2020-07-23 3:01 ` Yue Hu [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=20200723110123.000017e1.zbestahu@gmail.com \
--to=zbestahu@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=huyue2@yulong.com \
--cc=jslaby@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=zbestahu@163.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 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®