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: <20180125201749.GA7074@mobilestation>
Date:   Thu, 25 Jan 2018 23:17:49 +0300
From:   Serge Semin <fancer.lancer@...il.com>
To:     Alexander Sverdlin <alexander.sverdlin@...ia.com>
Cc:     ralf@...ux-mips.org, miodrag.dinic@...s.com, jhogan@...nel.org,
        goran.ferenc@...s.com, david.daney@...ium.com,
        paul.gortmaker@...driver.com, paul.burton@...s.com,
        alex.belits@...ium.com, Steven.Hill@...ium.com,
        matt.redfearn@...s.com, kumba@...too.org,
        marcin.nowakowski@...s.com, James.hogan@...s.com,
        Peter.Wotton@...s.com, Sergey.Semin@...latforms.ru,
        linux-mips@...ux-mips.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 00/14] MIPS: memblock: Switch arch code to NO_BOOTMEM

Hello Alexander,

On Thu, Jan 25, 2018 at 06:58:07PM +0100, Alexander Sverdlin <alexander.sverdlin@...ia.com> wrote:
> Hello Serge,
> 
> On 17/01/18 23:22, Serge Semin wrote:
> > The patchset is applied on top of kernel 4.15-rc8 and can be found
> > submitted at my repo:
> > https://github.com/fancer/Linux-kernel-MIPS-memblock-project
> 
> I've tested the Linux from your repo on Octeon2 and it looks good to me.
> I've only tested startup though. Therefore,
> 
> Tested-by: Alexander Sverdlin <alexander.sverdlin@...ia.com>
> 

Great! Thank you very much for doing this. I'll include the info about all the
tested platforms to the cover letter of the next patchset.

> I've noticed one positive effect I cannot explain -- with almost the same
> physical memory map I observe almost 2 megabytes more available memory
> after startup:
> 
> without patches:
> 
> root@(none):~ >free
>               total        used        free      shared  buff/cache   available
> Mem:         955040       16264      839948       80068       98828      810068
> Swap:             0           0           0
> 
> memory map:
> 
> memory: 0000000001090dc0 @ 0000000009000000 (usable after init)
> memory: 0000000005400000 @ 0000000002b00000 (usable)
> memory: 0000000000c00000 @ 0000000008200000 (usable)
> memory: 0000000004800000 @ 000000000a100000 (usable)
> memory: 000000001fc00000 @ 0000000020000000 (usable)
> memory: 0000000010000000 @ 0000000040000000 (usable)
> memory: 000000000190a9d0 @ 0000000001100000 (usable)
> 
> ----------------------------------------
> 
> with patches:
> 
> root@(none):~ >free
>               total        used        free      shared  buff/cache   available
> Mem:         955028       14292      841884       80068       98852      811996
> Swap:             0           0           0
> 
> memory map:
> 
> memory: 0000000001090e00 @ 0000000009000000 (usable after init)
> memory: 0000000005400000 @ 0000000002b00000 (usable)
> memory: 0000000000c00000 @ 0000000008200000 (usable)
> memory: 0000000004800000 @ 000000000a100000 (usable)
> memory: 000000001fc00000 @ 0000000020000000 (usable)
> memory: 0000000010000000 @ 0000000040000000 (usable)
> memory: 000000000190c9d0 @ 0000000001100000 (usable)
> 

That's interesting. My suggestion is that the old code used to reserve all
the memory below kernel _end symbol. So if the kernel isn't loaded right at
the start of the lowest memory range, then there is going to be a wasted
memory between the range start and the _text kernel symbol:
[PATCH 04/14] MIPS: memblock: Discard bootmem initialization
My code reserves only the memory occupied by the kernel within [_text, _end]:
[PATCH 05/14] MIPS: memblock: Add reserved memory regions to memblock

There might be some other reason of the lesser memory consumption though.
Hopefully I didn't forget to reserve some necessary memory ranges.)

Regards,
-Sergey

> 
> > Signed-off-by: Serge Semin <fancer.lancer@...il.com>
> > 
> > Serge Semin (14):
> >   MIPS: memblock: Add RESERVED_NOMAP memory flag
> >   MIPS: memblock: Surely map BSS kernel memory section
> >   MIPS: memblock: Reserve initrd memory in memblock
> >   MIPS: memblock: Discard bootmem initialization
> >   MIPS: memblock: Add reserved memory regions to memblock
> >   MIPS: memblock: Reserve kdump/crash regions in memblock
> >   MIPS: memblock: Mark present sparsemem sections
> >   MIPS: memblock: Simplify DMA contiguous reservation
> >   MIPS: memblock: Allow memblock regions resize
> >   MIPS: memblock: Perform early low memory test
> >   MIPS: memblock: Print out kernel virtual mem layout
> >   MIPS: memblock: Discard bootmem from Loongson3 code
> >   MIPS: memblock: Discard bootmem from SGI IP27 code
> >   MIPS: memblock: Deactivate bootmem allocator
> 
> -- 
> Best regards,
> Alexander Sverdlin.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ