From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk0-f199.google.com (mail-qk0-f199.google.com [209.85.220.199]) by kanga.kvack.org (Postfix) with ESMTP id 62D836B04FC for ; Thu, 16 Aug 2018 18:54:46 -0400 (EDT) Received: by mail-qk0-f199.google.com with SMTP id c22-v6so154015qkb.18 for ; Thu, 16 Aug 2018 15:54:46 -0700 (PDT) Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0097.outbound.protection.outlook.com. [104.47.33.97]) by mx.google.com with ESMTPS id u73-v6si509597qkl.208.2018.08.16.15.54.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 16 Aug 2018 15:54:44 -0700 (PDT) From: Pasha Tatashin Subject: Re: [RESEND PATCH v10 2/6] mm: page_alloc: remain memblock_next_valid_pfn() on arm/arm64 Date: Thu, 16 Aug 2018 22:54:38 +0000 Message-ID: <20180816225437.5zkchip422esdqwh@xakep.localdomain> References: <1530867675-9018-1-git-send-email-hejianet@gmail.com> <1530867675-9018-3-git-send-email-hejianet@gmail.com> In-Reply-To: <1530867675-9018-3-git-send-email-hejianet@gmail.com> Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-ID: <46623D63BEBB1E4ABFC291B2624C8EAD@namprd21.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: owner-linux-mm@kvack.org List-ID: To: Jia He Cc: Russell King , Catalin Marinas , Will Deacon , Mark Rutland , Ard Biesheuvel , Andrew Morton , Michal Hocko , Wei Yang , Kees Cook , Laura Abbott , Vladimir Murzin , Philip Derrin , AKASHI Takahiro , James Morse , Steve Capper , Pasha Tatashin , 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 18-07-06 17:01:11, Jia He wrote: > From: Jia He >=20 > 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. >=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. > 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." >=20 > Thus it would be better if we remain memblock_next_valid_pfn on arm/arm64= . >=20 > Suggested-by: Daniel Vacek > Signed-off-by: Jia He The version of this patch in linux-next has few fixes, I reviewed that one looks good to me. Reviewed-by: Pavel Tatashin =