linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] MIPS: Loongson: Make default kernel log buffer size as 128KB for Loongson3
@ 2019-10-15  1:07 Tiezhu Yang
  2019-10-15  3:36 ` Huacai Chen
  0 siblings, 1 reply; 5+ messages in thread
From: Tiezhu Yang @ 2019-10-15  1:07 UTC (permalink / raw)
  To: paul.burton, ralf, jhogan, chenhc; +Cc: linux-mips, linux-kernel

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@loongson.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
 CONFIG_MEMCG=y
 CONFIG_MEMCG_SWAP=y
 CONFIG_BLK_CGROUP=y
-- 
2.1.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] MIPS: Loongson: Make default kernel log buffer size as 128KB for Loongson3
  2019-10-15  1:07 [PATCH] MIPS: Loongson: Make default kernel log buffer size as 128KB for Loongson3 Tiezhu Yang
@ 2019-10-15  3:36 ` Huacai Chen
  2019-10-15  4:00   ` Tiezhu Yang
  0 siblings, 1 reply; 5+ messages in thread
From: Huacai Chen @ 2019-10-15  3:36 UTC (permalink / raw)
  To: Tiezhu Yang; +Cc: Paul Burton, Ralf Baechle, James Hogan, open list:MIPS, LKML

On Tue, Oct 15, 2019 at 10:12 AM Tiezhu Yang <yangtiezhu@loongson.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@loongson.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.

Huacai

>  CONFIG_MEMCG=y
>  CONFIG_MEMCG_SWAP=y
>  CONFIG_BLK_CGROUP=y
> --
> 2.1.0
>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] MIPS: Loongson: Make default kernel log buffer size as 128KB for Loongson3
  2019-10-15  3:36 ` Huacai Chen
@ 2019-10-15  4:00   ` Tiezhu Yang
  2019-10-15 18:53     ` Paul Burton
  0 siblings, 1 reply; 5+ messages in thread
From: Tiezhu Yang @ 2019-10-15  4:00 UTC (permalink / raw)
  To: Huacai Chen; +Cc: Paul Burton, Ralf Baechle, James Hogan, open list:MIPS, LKML

On 10/15/2019 11:36 AM, Huacai Chen wrote:
> On Tue, Oct 15, 2019 at 10:12 AM Tiezhu Yang <yangtiezhu@loongson.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@loongson.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,

Tiezhu Yang

>
> Huacai
>
>>   CONFIG_MEMCG=y
>>   CONFIG_MEMCG_SWAP=y
>>   CONFIG_BLK_CGROUP=y
>> --
>> 2.1.0
>>
>>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] MIPS: Loongson: Make default kernel log buffer size as 128KB for Loongson3
  2019-10-15  4:00   ` Tiezhu Yang
@ 2019-10-15 18:53     ` Paul Burton
  2019-10-16  2:23       ` Tiezhu Yang
  0 siblings, 1 reply; 5+ messages in thread
From: Paul Burton @ 2019-10-15 18:53 UTC (permalink / raw)
  To: Tiezhu Yang
  Cc: Huacai Chen, Paul Burton, Ralf Baechle, James Hogan,
	open list:MIPS, LKML

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@loongson.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@loongson.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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] MIPS: Loongson: Make default kernel log buffer size as 128KB for Loongson3
  2019-10-15 18:53     ` Paul Burton
@ 2019-10-16  2:23       ` Tiezhu Yang
  0 siblings, 0 replies; 5+ messages in thread
From: Tiezhu Yang @ 2019-10-16  2:23 UTC (permalink / raw)
  To: Paul Burton, Huacai Chen, Paul Burton
  Cc: Ralf Baechle, James Hogan, open list:MIPS, LKML

On 10/16/2019 02:53 AM, Paul Burton wrote:
> 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@loongson.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@loongson.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.

Hi Paul,

Thank you very much for your detailed explanation. I think 128KB is 
enough to save
the boot messages because the dmesg output size is about 40KB after 
reboot in my
system.

>
> 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.

Yes, you are right, I will make a new patch followed with your steps and 
send a v3
patch: just delete the CONFIG_LOG_BUF_SHIFT line to use the default 
value 128KB and
update the commit message.

>
> 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.

Hi Huacai,

What do you think? If you have any more suggestion, please let me know.

Thanks,

Tiezhu Yang

>
> Thanks,
>      Paul


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-10-16  2:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-15  1:07 [PATCH] MIPS: Loongson: Make default kernel log buffer size as 128KB for Loongson3 Tiezhu Yang
2019-10-15  3:36 ` Huacai Chen
2019-10-15  4:00   ` Tiezhu Yang
2019-10-15 18:53     ` Paul Burton
2019-10-16  2:23       ` Tiezhu Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).