From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi0-f69.google.com (mail-oi0-f69.google.com [209.85.218.69]) by kanga.kvack.org (Postfix) with ESMTP id 7FB6A6B0345 for ; Thu, 16 Aug 2018 15:02:47 -0400 (EDT) Received: by mail-oi0-f69.google.com with SMTP id m21-v6so4981249oic.7 for ; Thu, 16 Aug 2018 12:02:47 -0700 (PDT) Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0102.outbound.protection.outlook.com. [104.47.42.102]) by mx.google.com with ESMTPS id l81-v6si65966oig.89.2018.08.16.12.02.46 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 16 Aug 2018 12:02:46 -0700 (PDT) From: Pasha Tatashin Subject: Re: [RESEND PATCH v10 0/6] optimize memblock_next_valid_pfn and early_pfn_valid on arm and arm64 Date: Thu, 16 Aug 2018 19:02:42 +0000 Message-ID: <20180816190241.o6ctjypmbd65jdpl@xakep.localdomain> References: <1530867675-9018-1-git-send-email-hejianet@gmail.com> <20180815153456.974798c62dd5a5e4628db8f5@linux-foundation.org> In-Reply-To: <20180815153456.974798c62dd5a5e4628db8f5@linux-foundation.org> Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: owner-linux-mm@kvack.org List-ID: To: Andrew Morton Cc: Jia He , Russell King , Catalin Marinas , Will Deacon , Mark Rutland , Ard Biesheuvel , Michal Hocko , Wei Yang , Kees Cook , Laura Abbott , Vladimir Murzin , Philip Derrin , AKASHI Takahiro , James Morse , Steve Capper , Gioh Kim , Vlastimil Babka , Mel Gorman , Johannes Weiner , Kemi Wang , Petr Tesarik , YASUAKI ISHIMATSU , Andrey Ryabinin , Nikolay Borisov , Daniel Jordan , Daniel Vacek , Eugeniu Rosca , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" On 18-08-15 15:34:56, Andrew Morton wrote: > On Fri, 6 Jul 2018 17:01:09 +0800 Jia He wrote: >=20 > > Commit b92df1de5d28 ("mm: page_alloc: skip over regions of invalid pfns > > where possible") optimized the loop in memmap_init_zone(). But it cause= s > > possible panic bug. So Daniel Vacek reverted it later. > >=20 > > But as suggested by Daniel Vacek, it is fine to using memblock to skip > > gaps and finding next valid frame with CONFIG_HAVE_ARCH_PFN_VALID. > >=20 > > More from what Daniel said: > > "On arm and arm64, memblock is used by default. But generic version of > > pfn_valid() is based on mem sections and memblock_next_valid_pfn() does > > not always return the next valid one but skips more resulting in some > > valid frames to be skipped (as if they were invalid). And that's why > > kernel was eventually crashing on some !arm machines." > >=20 > > About the performance consideration: > > As said by James in b92df1de5, > > "I have tested this patch on a virtual model of a Samurai CPU with a > > sparse memory map. The kernel boot time drops from 109 to 62 seconds." > > Thus it would be better if we remain memblock_next_valid_pfn on arm/arm= 64. > >=20 > > Besides we can remain memblock_next_valid_pfn, there is still some room > > for improvement. After this set, I can see the time overhead of memmap_= init > > is reduced from 27956us to 13537us in my armv8a server(QDF2400 with 96G > > memory, pagesize 64k). I believe arm server will benefit more if memory= is > > larger than TBs >=20 > This patchset is basically unreviewed at this stage. Could people > please find some time to check it carefully? Working on it. Pavel=