lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200723110123.000017e1.zbestahu@gmail.com>
Date:   Thu, 23 Jul 2020 11:01:23 +0800
From:   Yue Hu <zbestahu@...il.com>
To:     Greg KH <gregkh@...uxfoundation.org>
Cc:     jslaby@...e.com, linux-kernel@...r.kernel.org, huyue2@...ong.com,
        zbestahu@....com
Subject: Re: [PATCH] sysrq: use only one slot for loglevels in key table

On Wed, 22 Jul 2020 12:49:52 +0200
Greg KH <gregkh@...uxfoundation.org> wrote:

> On Wed, Jul 22, 2020 at 05:26:09PM +0800, Yue Hu wrote:
> > From: Yue Hu <huyue2@...ong.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ