Received: by 10.223.176.46 with SMTP id f43csp2596284wra; Thu, 25 Jan 2018 12:18:24 -0800 (PST) X-Google-Smtp-Source: AH8x225U88uwRW4LfP0KQ2mMhPkgr+h1lmKqS9dj7c3+wJjaR2dxnUonENnXE7qbW7HJ6wHh2eWf X-Received: by 10.98.35.14 with SMTP id j14mr17092759pfj.62.1516911503906; Thu, 25 Jan 2018 12:18:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516911503; cv=none; d=google.com; s=arc-20160816; b=FAMa7v60dJqFnRv1njB/VHyoDBdcNVM96AssbxmF9X/sQ7nkEVZPMEnYKFOe76KiNQ MqYzEfkZk4j8tEyKAn9nTspb1V/7A6+uCEb4/xZgJLqatQOvYF+Npa6kYQLtR3/tKNbv NLE5iScutEFXy2wK8KiYs1mhRnKhb2Y1Q73V9PqeAhvLo7O7FDNk1QENw9UFzKnPzUdZ XJvWaIBwZP38Ry+PiMc0/LolQhiuADfzxBNwk2pCLl7XZEBLIoAlb3dJqjav+DnRpBJv 7FZtSb06Skj2CVnAnzp8kZfQ7b+bsHUYuSbdaMaPiDFNNRQ/4tOJcueSwRrd7vewOr8f aT6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=exSu4RQnhYmBJMdRLPC6ZWODtn8fpoayRxA+TgGn92s=; b=ONUFLs9ogu8UmrJAc/vSN6ZuTcAAvYDtj9SK2iHVwrtqOgEUMyyzJiJmWNpIsokWL3 TpD1Qr72LxiL0AHbbbBpbV3QxmE/8rm+p5sURLzdWqVSLHwuVB6XOaKzkDu0L6ZEGesI sNBp3NnFBHKsQkh+0NBYxNMTEaYaHy3wHNuVPMYaOkf0HdBVekgE1yI5WmQ8L+9S2/sL fQVGwodiMO6IVXn9yGa2O1fuUMDgWPCbj2cEqb7TEyCX+ochGN/cYM+OZKimlaYzTVVt 2jOW77GVHhNgD0Fd7XBTa1NcZKoNZRdgP/sgA8IMFBMal9RuGnd9xD7RVFYDh9CiFI7i tzNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ajiNDEr7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 68si5131864pfm.104.2018.01.25.12.18.07; Thu, 25 Jan 2018 12:18:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ajiNDEr7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751318AbeAYURh (ORCPT + 99 others); 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 Received: by mail-lf0-f68.google.com with SMTP id t79so11415440lfe.3 for ; Thu, 25 Jan 2018 12:17:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=exSu4RQnhYmBJMdRLPC6ZWODtn8fpoayRxA+TgGn92s=; b=ajiNDEr74qyzLYQvx3eQHP9IfUr+n/YZALoHu8zB1P4UD6t2LWLKIqUbMhl2j9MgCi KHCkTH8DtDYbS8LYh38bZ2g1C5qfZTCmCOkg2AyNMFPa51ax0QnOXRBvO527AY5qwXxg LxUCroXMD39n8ZwKGiZjx+CBB2w6Wb9Kuul3commXD5hC60l3TCpoMyeUliTzg0/ahL/ MGcB2xXJERIHj8aJ1clsxLE6pNzR0yd1PXBtrg3/b4uHjNUw/4Gi3pJVV+fIuxjvo51d pzoq8kyyYBA2aqDSdE86x/yfuceJZ8Hsx0Rk1/taSGY+SLbHd1KJ0KIrxkPSCi4SBZnb EQKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=exSu4RQnhYmBJMdRLPC6ZWODtn8fpoayRxA+TgGn92s=; b=fBoDdFez+HahGcQl4tOKqo1FIdUU4UIhMmeGRI324py/AtABgunS6my6X7Q9dua7Wp bVLq06PWMvrYizCDDpJ2lCheSguX3tszFjbxBEeyDObdWI7poK1rrsdzzZl5gl0kP1vg KwfdxavDSvqZeVEcZ5ICVBuhe5WKnGkbrmaDAV8eE+hPHF7p3jGKJiN/w/p9Dp6VA8QP B6XFIgdPraMjhTjR7RQxs7aaHrgtFk1EY1d5+jcrY3lNm6d239HOcWWJHMC+qXwyY8aK ZsBsuvItfCBMj4TonXpiF/EmyeeRAK8CYan7kw0CQGay9rFbb3r6wXtyFN5+JZXTJhyF EeZw== X-Gm-Message-State: AKwxytfEMQc4V9JEKTjUPBMpyIrtjjjyCVtcNwhnJwF7ZmulptyDARUR d3y3xDOcNqNfYxyR3LJqNE0= X-Received: by 10.46.68.11 with SMTP id r11mr6403903lja.13.1516911453943; Thu, 25 Jan 2018 12:17:33 -0800 (PST) Received: from mobilestation ([95.79.164.146]) by smtp.gmail.com with ESMTPSA id l66sm1118852lfe.15.2018.01.25.12.17.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Jan 2018 12:17:33 -0800 (PST) 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 Precedence: bulk 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.