From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751345AbeAYURh (ORCPT ); Thu, 25 Jan 2018 15:17:37 -0500 Received: from mail-lf0-f68.google.com ([209.85.215.68]:36286 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751170AbeAYURf (ORCPT ); Thu, 25 Jan 2018 15:17:35 -0500 X-Google-Smtp-Source: AH8x227yNnUfh1ayQ0oDEdunI65Yz2bRq+myVxmjHrecCMZBkhrHs7VuzSYklUUr5jut3Bx4RxxLzg== Date: Thu, 25 Jan 2018 23:17:49 +0300 From: Serge Semin To: Alexander Sverdlin Cc: ralf@linux-mips.org, miodrag.dinic@mips.com, jhogan@kernel.org, goran.ferenc@mips.com, david.daney@cavium.com, paul.gortmaker@windriver.com, paul.burton@mips.com, alex.belits@cavium.com, Steven.Hill@cavium.com, matt.redfearn@mips.com, kumba@gentoo.org, marcin.nowakowski@mips.com, James.hogan@mips.com, Peter.Wotton@mips.com, Sergey.Semin@t-platforms.ru, linux-mips@linux-mips.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 00/14] MIPS: memblock: Switch arch code to NO_BOOTMEM Message-ID: <20180125201749.GA7074@mobilestation> References: <20180117222312.14763-1-fancer.lancer@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Alexander, On Thu, Jan 25, 2018 at 06:58:07PM +0100, Alexander Sverdlin 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 > 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 > > > > 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.