From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08DFDC433F5 for ; Fri, 1 Apr 2022 10:43:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5B70E8D0002; Fri, 1 Apr 2022 06:43:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 568168D0001; Fri, 1 Apr 2022 06:43:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 40A428D0002; Fri, 1 Apr 2022 06:43:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.28]) by kanga.kvack.org (Postfix) with ESMTP id 333B28D0001 for ; Fri, 1 Apr 2022 06:43:25 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id 075A9121B95 for ; Fri, 1 Apr 2022 10:43:15 +0000 (UTC) X-FDA: 79307973150.04.A2B56E1 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf19.hostedemail.com (Postfix) with ESMTP id 87E7E1A0009 for ; Fri, 1 Apr 2022 10:43:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1648809794; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+4pBRJ5YN5a24OMJIf40rb52pBXc7gp40076N5cz8GU=; b=SLEbSpuk0w46PFkb0Wo2+bMnIhsz42yAB/tl0PGZzPqATTs8ME5OEAoqWOIrnrA4dzxvAc MYngs/tK10L9E8vPrPd+wZSEYbkC1gZfTA6Cvu6nv6NULEQazfmjOeoCpkIyYXhjQ3jWeu GpMf8tDN6H3fnl7EAKuuv+qHiJ2Upd8= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-55-4enbHcNpO4yvDwSPXcfD1g-1; Fri, 01 Apr 2022 06:43:13 -0400 X-MC-Unique: 4enbHcNpO4yvDwSPXcfD1g-1 Received: by mail-wm1-f72.google.com with SMTP id i6-20020a1c5406000000b0038c97ed0db5so1002728wmb.7 for ; Fri, 01 Apr 2022 03:43:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:organization:in-reply-to :content-transfer-encoding; bh=+4pBRJ5YN5a24OMJIf40rb52pBXc7gp40076N5cz8GU=; b=HehAWsabYBlRz8XJ7fE7fncYHcXGldgAwQCWAOpcNnUbJo4uV7j6n5wLYKGyuIXoIs IL/t+MfxHOOBXm66wXgThgs42DUvW5Jch67u2NROj0u7WRmLteuS+ZQIRbhMrfpg6rIV ZvWL8DI+kWAxiF4Rk4o0/CAmGMy1L8K2tuiVp2Adm8U0MymjQaDQpQb1KKTe0p/3cefl L1l7Xe8i+9X2Tyk+JoSIlXq4q1WYtOUkYD2JzugIyuZm0hiTU3+tFYXDj4aojF5gVHCx pLUl8bSbF65uKqrqWVRTcEP6PZ3bkoXMfKLFavUf3vLs6NFwWYXF5/w/RT8CAOpLyraV QNjQ== X-Gm-Message-State: AOAM531O9XBZPIpBi5rFFZPegKQOXSqHPxCPZ0vimKyC7ePbrWqqOSrn gp2EY/bEWs3mX/mnHw8xB3i8efSZ5dRJEohXCXoA4Qjo8QUlW93TriVsgKCPOXeWXVJXn5/J9cF XIDjyUgikhgI= X-Received: by 2002:a05:600c:2192:b0:38c:8b45:ecf5 with SMTP id e18-20020a05600c219200b0038c8b45ecf5mr8320505wme.85.1648809791888; Fri, 01 Apr 2022 03:43:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRTBc25bk4mXGUimWBG0gQaL17FMWYkZ/3pdWCRPJysHyjJZ+NIDT/7uYxgPkQaxE1+XJR8A== X-Received: by 2002:a05:600c:2192:b0:38c:8b45:ecf5 with SMTP id e18-20020a05600c219200b0038c8b45ecf5mr8320486wme.85.1648809791602; Fri, 01 Apr 2022 03:43:11 -0700 (PDT) Received: from ?IPV6:2003:cb:c706:9e00:229d:4a10:2574:c6fa? (p200300cbc7069e00229d4a102574c6fa.dip0.t-ipconnect.de. [2003:cb:c706:9e00:229d:4a10:2574:c6fa]) by smtp.gmail.com with ESMTPSA id b10-20020a05600018aa00b002042a98168csm2125388wri.15.2022.04.01.03.43.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 01 Apr 2022 03:43:11 -0700 (PDT) Message-ID: <0aefbc18-4232-0bae-b37a-d4c6995e3d00@redhat.com> Date: Fri, 1 Apr 2022 12:43:10 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.2 Subject: Re: [PATCH v2 1/2] hugetlb: Fix hugepages_setup when deal with pernode To: Peng Liu , mike.kravetz@oracle.com, akpm@linux-foundation.org, yaozhenguo1@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org References: <20220401101232.2790280-1-liupeng256@huawei.com> <20220401101232.2790280-2-liupeng256@huawei.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: <20220401101232.2790280-2-liupeng256@huawei.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=SLEbSpuk; spf=none (imf19.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspam-User: X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 87E7E1A0009 X-Stat-Signature: nzyfhhbybwdxmancrhakqc9fmx33wbor X-HE-Tag: 1648809794-558470 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 01.04.22 12:12, Peng Liu wrote: > Hugepages can be specified to pernode since "hugetlbfs: extend > the definition of hugepages parameter to support node allocation", > but the following problem is observed. > > Confusing behavior is observed when both 1G and 2M hugepage is set > after "numa=off". > cmdline hugepage settings: > hugepagesz=1G hugepages=0:3,1:3 > hugepagesz=2M hugepages=0:1024,1:1024 > results: > HugeTLB registered 1.00 GiB page size, pre-allocated 0 pages > HugeTLB registered 2.00 MiB page size, pre-allocated 1024 pages > > Furthermore, confusing behavior can be also observed when invalid > node behind valid node. > > To fix this, hugetlb_hstate_alloc_pages should be called even when > hugepages_setup going to invalid. Shouldn't we bail out if someone requests node-specific allocations but we are not running with NUMA? What's the result after your change? > > Cc: I am not sure if this is really stable material. > Fixes: b5389086ad7b ("hugetlbfs: extend the definition of hugepages parameter to support node allocation") > Signed-off-by: Peng Liu -- Thanks, David / dhildenb