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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191015184745.xxihqrcaezbazzgm@lantea.localdomain>
Date:   Tue, 15 Oct 2019 11:53:21 -0700
From:   Paul Burton <paulburton89@...il.com>
To:     Tiezhu Yang <yangtiezhu@...ngson.cn>
Cc:     Huacai Chen <chenhc@...ote.com>,
        Paul Burton <paul.burton@...s.com>,
        Ralf Baechle <ralf@...ux-mips.org>,
        James Hogan <jhogan@...nel.org>,
        "open list:MIPS" <linux-mips@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] MIPS: Loongson: Make default kernel log buffer size as
 128KB for Loongson3

Hi Tiezhu & Huacai,

On Tue, Oct 15, 2019 at 12:00:25PM +0800, Tiezhu Yang wrote:
> On 10/15/2019 11:36 AM, Huacai Chen wrote:
> > On Tue, Oct 15, 2019 at 10:12 AM Tiezhu Yang <yangtiezhu@...ngson.cn> wrote:
> > > When I update kernel with loongson3_defconfig based on the Loongson 3A3000
> > > platform, then using dmesg command to show kernel ring buffer, the initial
> > > kernel messages have disappeared due to the log buffer is too small, it is
> > > better to change the default kernel log buffer size from 16KB to 128KB.
> > > 
> > > Signed-off-by: Tiezhu Yang <yangtiezhu@...ngson.cn>
> > > ---
> > >   arch/mips/configs/loongson3_defconfig | 2 +-
> > >   1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/arch/mips/configs/loongson3_defconfig b/arch/mips/configs/loongson3_defconfig
> > > index 90ee008..3aa2201 100644
> > > --- a/arch/mips/configs/loongson3_defconfig
> > > +++ b/arch/mips/configs/loongson3_defconfig
> > > @@ -12,7 +12,7 @@ CONFIG_TASKSTATS=y
> > >   CONFIG_TASK_DELAY_ACCT=y
> > >   CONFIG_TASK_XACCT=y
> > >   CONFIG_TASK_IO_ACCOUNTING=y
> > > -CONFIG_LOG_BUF_SHIFT=14
> > > +CONFIG_LOG_BUF_SHIFT=17
> > Hi, Tiezhu,
> > 
> > Why you choose 128KB but not 64KB or 256KB? I found 64KB is enough for
> > our cases. And if you really need more, I think 256KB could be better
> > because there are many platforms choose 256KB.
> 
> Hi Huacai,
> 
> Thanks for your reply and suggestion, I will send a v2 patch.

Thanks for the patches.

I actually have a slight preference for 128KB if you've no specific
need, since 128KB is the default. Some quick grepping says that of 405
defconfigs in tree (as of v5.4-rc3), we have:

  LOG_BUF_SHIFT  Count
             12  1
	     13  3
	     14  235
	     15  18
	     16  39
	     17  90
	     18  13
	     19  2
	     20  4

ie. 16KiB is by far the most common, then second most common is the
default 128KiB. 256KiB is comparatively rare.

However, I don't think your v1 patch is quite right Tiezhu - since 17 is
the default it shouldn't be specified in the defconfig at all. Did you
manually make the change in the loongson3_defconfig file? If so please
take a look at the savedefconfig make target & try something like this:

  make ARCH=mips loongson3_defconfig
  make ARCH=mips menuconfig
  # Change LOG_BUF_SHIFT
  make ARCH=mips savedefconfig
  mv defconfig arch/mips/configs/loongson3_defconfig
  git add -i arch/mips/configs/loongson3_defconfig
  # Stage the relevant changes, drop the others

You should end up with the CONFIG_LOG_BUF_SHIFT line just getting
deleted.

If on the other hand you really do prefer 256KiB for these systems
please describe why in the commit message. It could be something as
simple as "we have lots of memory so using 256KiB isn't a big deal, and
gives us a better chance of preserving boot messages until they're
examined". But if your log is getting this big before you look at it (or
before something like systemd copies it into its journal), there's
probably something fishy going on.

Thanks,
    Paul

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ