Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp81759imm; Thu, 16 Aug 2018 15:58:20 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyuyWFjGGvEHmA9ayY1UsmfvcrR6cU4YdSfE2Ykc1PBNIO1vcdOL1KCijICjxVaz/ZzAbtO X-Received: by 2002:a17:902:2e83:: with SMTP id r3-v6mr31195763plb.80.1534460300326; Thu, 16 Aug 2018 15:58:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534460300; cv=none; d=google.com; s=arc-20160816; b=sSsDR98XNgRLJaHefhjOrLUdXeNy8mn96p4UJpI6CkzXzLm1dNNvvpwLSHpLh7qrKC 061mewaq21BA2Qu7hJ15aP8L9wQJUtHaHzr+bU/8T8n96fkw3ZHs6UywolujyVScv/Uo /QcGd47waqEpN7aXaH32dQvyXon7YBbu2WG4t3RUmUZvgA4Y5Oiu2tEoYMZstnVw+UTw 5ouDoOg/n7+y1sB5KUAcW+Khhu0VQJ+NvdMNRZd6vrBY/zu36b0hRKGw/5yW3WfzSGof rgFvCmAX/jOwH2zY6dqZ054Df+6hR0HNmHqDIx3r67/+4xMgPvFOI00NfzoqEI4ZJO1p VLsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:spamdiagnosticmetadata:spamdiagnosticoutput :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=Xn1JKqXhesJECxlzG9Bmwgkch7UgaDyleHYuVJtPfy4=; b=xFb5X1xX4WNLuL/CAZxiENmSyyvGy1u/MkVkvvl8zKhahf8xmqyTARcsGMGjIORBrq xyeL12T1iZL/LcfkhU2DAY6EJdNeFO+K2OpHs6Xy+b7Px6PcnXvtCylBXQ9+rW8UMic9 0TpRveq48k1Y11GahM9w9F4QtPAxEyHADffu2mN7EQ4YmoAljoY305AeFKXvTrAyHIG2 0St2TWKpukCfKww0SknNeLdnd123QSuIv02J4lgzWigcNP+WQkQvzUXDDxEuJVQbcElW PgXhF/5VAP7DPVair94J8p2Z/Y9/fGSno6DxJHC1RouzXt4xPZLHwrHL4LPUao/bQO3v OrQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=Zw8EXMBn; 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=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u136-v6si473187pgc.453.2018.08.16.15.57.39; Thu, 16 Aug 2018 15:58:20 -0700 (PDT) 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=@microsoft.com header.s=selector1 header.b=Zw8EXMBn; 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=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726214AbeHQBzn (ORCPT + 99 others); Thu, 16 Aug 2018 21:55:43 -0400 Received: from mail-bn3nam01on0107.outbound.protection.outlook.com ([104.47.33.107]:10690 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726103AbeHQBzn (ORCPT ); Thu, 16 Aug 2018 21:55:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Xn1JKqXhesJECxlzG9Bmwgkch7UgaDyleHYuVJtPfy4=; b=Zw8EXMBnP87rtiXTpOYdYmWJDIi9P7MPQWtPkIqUqWGqAEwLWTIyZWl9P/W5Ms3YLjByyvIE0WrRcdVkXY5defonmgf7anHr81gJVu4ihJk8jIVmKRO/HyXxg8HETmkZxTougLQqWndw+VMlHat3nVobtKqoUZq9QrcCPPFEoWk= Received: from DM5PR21MB0508.namprd21.prod.outlook.com (10.172.91.142) by DM5PR21MB0474.namprd21.prod.outlook.com (10.172.92.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.7; Thu, 16 Aug 2018 22:54:38 +0000 Received: from DM5PR21MB0508.namprd21.prod.outlook.com ([fe80::65dd:b17f:eb0d:2eee]) by DM5PR21MB0508.namprd21.prod.outlook.com ([fe80::65dd:b17f:eb0d:2eee%8]) with mapi id 15.20.1080.009; Thu, 16 Aug 2018 22:54:38 +0000 From: Pasha Tatashin 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 Subject: Re: [RESEND PATCH v10 2/6] mm: page_alloc: remain memblock_next_valid_pfn() on arm/arm64 Thread-Topic: [RESEND PATCH v10 2/6] mm: page_alloc: remain memblock_next_valid_pfn() on arm/arm64 Thread-Index: AQHUNbQckrhYDDtuAkijz8ueJvYRWA== 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> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [73.69.118.222] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR21MB0474;6:/LFcFPKizceh+46zfDdbD0FoWZ4w0dbWkxIC2RnTaOqdoxcRgqqIDWq9XAT4hzGOFjnpIU90wnoIEHKRwjIq/YP2AacVXVOzFu6r2e7FOMZJhHGbHNZ3PBfFDEh+VzfJOeObRsa36WLNGLeJGhmm2w3TxdAshby51MwqmTNN5wLFbmUfVLSbi+2L4Ne6V7/Bt7RH4Jaz2IT+WY5A5jWTr3RSSPhlZe2bxyubYnOrj8LE0WZgfxCiI3nai4aX00/XQFQO7vDYqjEHGUwk9s0iG74i2JafjIpH5R2c5GA/yNRNkxtjgsrbuar2yr2KYNTeCw4uI8M15dp/OnLNZQ4unVz4AOoeN/m4b+4eYIk1R2fKrk8jNa86vKZrsLusqr+f6PJPT6OzFzkznZaMoP9RMge9nFaEBS6gUMdd5SGKZ8UcgbWRh2vphfwTCbTwYMruvF8bv65VXbPhd3bA994dbQ==;5:+yfd44tEvqcs1LgcQ/tUfVp7lha8ed3xNMifMEx4VRM8SnTe8ancm5DkCKwdrQvjJDKPWwneGfil2W7+09RS4Hu9PjhztBSzGEyOmuaSBwa9a/Iaxxq9qkRVZXcnKDH4dM+iIW2SbCNrDytWtrpjODJ/ObZ7hsGGMuukh21eViY=;7:vscdPNx8AEIqPL20liCE+LBQIQd0DQssQZbyRwT+pZC7Ordb7cahA2Xfa9UB8W7N3NwhNqJoEltz3X9q8/hSlVgEaLJ4y0W+eowlLBOwcAWiR8GzxP1F196m9phHb2aZCnrrK9WjlpoPiZjCWNazeAcd/yTm6qatzGAPCO2ecuBptIfv5s4uVNiJqpaTm4gyfGylSblU7altBru/GVzX9AmeBFk7xXpUYpEqudbug4aBWN9uPqgJuA5Ggvd+/h3t x-ms-office365-filtering-correlation-id: 44220bf8-b25b-4c53-db9d-08d603cb3ece x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7193020);SRVR:DM5PR21MB0474; x-ms-traffictypediagnostic: DM5PR21MB0474: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Pavel.Tatashin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(20180801012)(6040522)(2401047)(5005006)(8121501046)(3231336)(944501410)(52105095)(2018427008)(3002001)(93006095)(93001095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(201708071742011)(7699016);SRVR:DM5PR21MB0474;BCL:0;PCL:0;RULEID:;SRVR:DM5PR21MB0474; x-forefront-prvs: 07665BE9D1 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(346002)(366004)(396003)(376002)(136003)(39860400002)(189003)(199004)(6246003)(68736007)(25786009)(22452003)(54906003)(106356001)(8936002)(105586002)(33896004)(10090500001)(81156014)(8676002)(81166006)(316002)(305945005)(4326008)(5250100002)(39060400002)(7736002)(6116002)(3846002)(1076002)(97736004)(6486002)(86612001)(256004)(217873002)(6436002)(7416002)(7406005)(2900100001)(66066001)(229853002)(5660300001)(6916009)(53936002)(9686003)(6512007)(102836004)(6506007)(26005)(2906002)(99286004)(76176011)(53546011)(186003)(11346002)(476003)(86362001)(10290500003)(72206003)(478600001)(486006)(446003)(14454004)(1411001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR21MB0474;H:DM5PR21MB0508.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: wgY7Kmikjr+44vCJfGjhkHVQozS4qXt/liAkWw3Cni4NU4GXhFoHNGsziesRj/AP6d1O0iDDWeybr1IeKAI7+2QmAhanCqBoMqWPgCQZAdygFBKskpoDRY4CAHEbDKTnOIM2nrrqrx6qHAf5vI0F9IOMOy27IsYDG3CabTlowomlGH9Hm/ANDGE3PyOM2t1AM1XIhbugmUDiARocv+4bflJqyIda/zK9UszNnHtUpsHKF+oTyeAcAu8NYiH/d6dMOL18YiAHveJcc45S289id8NfFYIT46IGHc6rmtqDp2irmQbqF/71IK3oEeg1Gn0AP53Ocd4e4fsIHuXXzXRoUVGioIrlFji+NRbDTYZ98Uo= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-ID: <46623D63BEBB1E4ABFC291B2624C8EAD@namprd21.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 44220bf8-b25b-4c53-db9d-08d603cb3ece X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Aug 2018 22:54:38.4710 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR21MB0474 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 =