Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp581448pxb; Tue, 15 Feb 2022 22:48:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJyondSY0VUY8aJI4Z/V4r6cndasJyhoOIcqbAZu7A5Ttm06YVUGgBS3MW2W7S/MFKqtkrtZ X-Received: by 2002:a17:90b:1e08:b0:1b9:fbab:34c0 with SMTP id pg8-20020a17090b1e0800b001b9fbab34c0mr168123pjb.178.1644994092104; Tue, 15 Feb 2022 22:48:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644994092; cv=none; d=google.com; s=arc-20160816; b=BFi2DiAtLJHGdP1tdIvs0B+xUTI7jLYfaySHtnwB9yw4WXaYDiurii6gNHW/SXb/Rq C0+NTcI/X9l1tUjCkXTw0xGqSYph7Nhra/tMHpPYgbxwI4Wb9gHuqmv4TeQAeZqxEJkY EAquiq98CtfI0aiEzJ6AKChJBU3K92EBmsY26x/FzIJi1AH2BXjhg9UiBPDtNA3X+EwN hXtyQBkFkL35JXNDhbtKV5ua0pNNm4MS79szilY1fNfMkAJsn3WQDRluX16mXXXjlVCf 6ob0jzXyuBvzC9impYZc6XK2DtPqWky3PTBg/1eNl0887N9AseT25XGwmeWEZu1kgetp F/Hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=3+wjLXMD1G8uBEKUS5Z8SRFCKrvFbLkX9hiPty1HgOQ=; b=OdqK4R79IA05GxDaAHkXusjfTsCZHMvYNYAq3Lf2D2pFRL1AwfV7+mDfDtX+aZySeZ S1nOSpucStpE4Wz2zQlOzAtN3bC+Kq79uN4xdDAKUKjtCKFEy7Y7KqSuTfEzENoBjtYa nVPiPOfbxKEPrNTIxeJAIq3No0+x1J+RAiyFU7JZsY4P4wdITVGlnzrVO/3Gd5XfS5u+ Ss4lRcUQZ2voqG7i3P04skdXP7B98eDWkqcmt6RgZCw4C75WonxVxDU505TkGWpvFMP5 yM+Z8O8mrkJos1sZt3iAp76fONgkD4jbi95vGcg92VDF3BO9Zlz0fPZb6CPk5aI3F0qg XkUg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id kb18si8992466pjb.44.2022.02.15.22.48.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Feb 2022 22:48:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 50BCD1FFF65; Tue, 15 Feb 2022 22:34:31 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245580AbiBPFYj (ORCPT + 99 others); Wed, 16 Feb 2022 00:24:39 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:60522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230002AbiBPFYh (ORCPT ); Wed, 16 Feb 2022 00:24:37 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 03E8F7A9A9 for ; Tue, 15 Feb 2022 21:24:25 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C33F7113E; Tue, 15 Feb 2022 21:24:24 -0800 (PST) Received: from [10.163.47.182] (unknown [10.163.47.182]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1D5813F66F; Tue, 15 Feb 2022 21:24:22 -0800 (PST) Subject: Re: [PATCH] mm/pages_alloc.c: Don't create ZONE_MOVABLE beyond the end of a node To: Alistair Popple Cc: akpm@linux-foundation.org, jhubbard@nvidia.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, ziy@nvidia.com References: <20220215025831.2113067-1-apopple@nvidia.com> <7b752e06-f345-cbb2-d05c-57e5fc5d8e5a@arm.com> <87bkz8d6nc.fsf@nvdebian.thelocal> From: Anshuman Khandual Message-ID: <370f7851-98b9-5812-7e3d-fea8053fb82c@arm.com> Date: Wed, 16 Feb 2022 10:54:21 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <87bkz8d6nc.fsf@nvdebian.thelocal> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/15/22 10:46 AM, Alistair Popple wrote: > Anshuman Khandual writes: > >> Hi Alistair, >> >> On 2/15/22 8:28 AM, Alistair Popple wrote: >>> ZONE_MOVABLE uses the remaining memory in each node. It's starting pfn >>> is also aligned to MAX_ORDER_NR_PAGES. It is possible for the remaining >>> memory in a node to be less than MAX_ORDER_NR_PAGES, meaning there is >>> not enough room for ZONE_MOVABLE on that node. >> >> How plausible is this scenario on normal systems ? > > Probably not very. I happened to run into this on my development/test x86 VM > which has 8GB and was booted with `numa=fake=4 kernelcore=60%` but in theory I > guess any system that has a node with less than MAX_ORDER_NR_PAGES left over for > ZONE_MOVABLE may be susceptible. > > This was the RAM map: > > [ 0.000000] BIOS-provided physical RAM map: > [ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable > [ 0.000000] BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved > [ 0.000000] BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved > [ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000007ffddfff] usable > [ 0.000000] BIOS-e820: [mem 0x000000007ffde000-0x000000007fffffff] reserved > [ 0.000000] BIOS-e820: [mem 0x00000000b0000000-0x00000000bfffffff] reserved > [ 0.000000] BIOS-e820: [mem 0x00000000fed1c000-0x00000000fed1ffff] reserved > [ 0.000000] BIOS-e820: [mem 0x00000000feffc000-0x00000000feffffff] reserved > [ 0.000000] BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved > [ 0.000000] BIOS-e820: [mem 0x0000000100000000-0x000000027fffffff] usable > > [...] > > [ 0.065897] Early memory node ranges > [ 0.065898] node 0: [mem 0x0000000000001000-0x000000000009efff] > [ 0.065900] node 0: [mem 0x0000000000100000-0x000000007ffddfff] > [ 0.065902] node 1: [mem 0x0000000100000000-0x000000017fffffff] > [ 0.065904] node 2: [mem 0x0000000180000000-0x00000001ffffffff] > [ 0.065906] node 3: [mem 0x0000000200000000-0x000000027fffffff] > > Note the reserved range from 0x000000007ffde000 to 0x000000007fffffff resulting > in node-0 ending at 0x000000007ffddfff. > >> Should not the node always contain MAX_ORDER_NR_PAGES aligned pages ? Also all >> zones which get created from that node should also be MAX_ORDER_NR_PAGES >> aligned ? > > I'm not sure why that would be case given page size and MAX_ORDER_NR_PAGES can > be set via a kernel configuration parameter. Obviously it wasn't the case here I assumed that in general that would be the case. > or this situation would not arise. That said I don't know this code well, and > this was where I decided to stop shaving this yak so it's possible there is an > even deeper underlying issue. > > Either way I don't *think* the fix should introduce any problems as it shouldn't > do anything unless you were going to hit this issue anyway (which took sometime > to track down as the cause wasn't obvious). Fair enough. > >> I am just curious how a node could end up being like this. > > - Anshuman >