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 BFCE86B7845 for ; Thu, 6 Sep 2018 06:46:54 -0400 (EDT) Received: by mail-oi0-f69.google.com with SMTP id v4-v6so12414204oix.2 for ; Thu, 06 Sep 2018 03:46:54 -0700 (PDT) Received: from foss.arm.com (foss.arm.com. [217.140.101.70]) by mx.google.com with ESMTP id r11-v6si2963198oie.134.2018.09.06.03.46.53 for ; Thu, 06 Sep 2018 03:46:53 -0700 (PDT) Date: Thu, 6 Sep 2018 11:47:07 +0100 From: Will Deacon Subject: Re: [PATCH v11 0/3] remain and optimize memblock_next_valid_pfn on arm and arm64 Message-ID: <20180906104707.GL3592@arm.com> References: <1534907237-2982-1-git-send-email-jia.he@hxt-semitech.com> <20180905145755.cc89819d446f311e4b8e8f95@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180905145755.cc89819d446f311e4b8e8f95@linux-foundation.org> Sender: owner-linux-mm@kvack.org List-ID: To: Andrew Morton Cc: Jia He , Russell King , Catalin Marinas , 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, Jia He On Wed, Sep 05, 2018 at 02:57:55PM -0700, Andrew Morton wrote: > On Wed, 22 Aug 2018 11:07:14 +0800 Jia He wrote: > > > Commit b92df1de5d28 ("mm: page_alloc: skip over regions of invalid pfns > > where possible") optimized the loop in memmap_init_zone(). But it causes > > possible panic bug. So Daniel Vacek reverted it later. > > > > 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. > > > > 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." > > > > 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/arm64. > > > > 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 > > Thanks. I switched to v11. It would be nice to see some confirmation > from ARM people please? I'll take a look... Will