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 C2579C433EF for ; Thu, 3 Feb 2022 08:27:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1A8AB8D012F; Thu, 3 Feb 2022 03:27:22 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 159CD8D0129; Thu, 3 Feb 2022 03:27:22 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0209B8D012F; Thu, 3 Feb 2022 03:27:21 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0081.hostedemail.com [216.40.44.81]) by kanga.kvack.org (Postfix) with ESMTP id E666D8D0129 for ; Thu, 3 Feb 2022 03:27:21 -0500 (EST) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id A198995C8F for ; Thu, 3 Feb 2022 08:27:21 +0000 (UTC) X-FDA: 79100789082.28.7A566BD Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf24.hostedemail.com (Postfix) with ESMTP id 39B51180004 for ; Thu, 3 Feb 2022 08:27:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643876840; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mcKEYXqPIU6EmxmVYKokVd8YQg0IyQZTYFGDXp+PzRQ=; b=HNnuHQoDTCQMkz+s8IyuBAwVYsPRV1YGqMqoEVmAqVPUpApDNHpiCZvC2mAvYCAU/+isiK GJxqBlzaoQRcbZWbZ8P8iLwL27U6jk/j19hCvAiGTu2GqgvxYyaP1xoew+WEeNnpBKSc5O Roqi8Qgn+6OCuf1j1JIcye4z0Pq5J0c= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-391-F-7tYQI7PUek1bI0KdcrQQ-1; Thu, 03 Feb 2022 03:27:19 -0500 X-MC-Unique: F-7tYQI7PUek1bI0KdcrQQ-1 Received: by mail-wr1-f72.google.com with SMTP id q4-20020adfbb84000000b001dd3cfddb2dso395842wrg.11 for ; Thu, 03 Feb 2022 00:27:19 -0800 (PST) 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 :content-language:to:cc:references:from:organization:subject :in-reply-to:content-transfer-encoding; bh=mcKEYXqPIU6EmxmVYKokVd8YQg0IyQZTYFGDXp+PzRQ=; b=EWmqtJs/NT/kI908TQ8ZxsyRMP+z82LxKbV/an9jQIcxApIAiTuJIvwe/nfWoCFs04 PJ8f0tTQZu6DVTBhsaq2fAckPoZR+A93Uaet4ANDR6WEJaNxSu64j1mBYDFcN9A2dgk/ XIo854CbmO+Xs641npLqUFaN/X6izpQDJ9piDtbhp4L47tWL7BC+ScKy3lJWlQJF/whW TuDrC7gfxTdJD3m9YT7abDTDdn2LOjvNP4u4WrRz2r/5CovNPLwxjf/2ZZSXXdAiPrfQ qrheUUQQBFwn03d4djrGznza5s21jABih08LlnzUE9Sv/i/hiFAXOaDt65CkHLkUvJjr IBSQ== X-Gm-Message-State: AOAM533BFeG6OYt4/np0v1Mr6/tt8DLUf5kl+8lyjGkKtIZJRnDUEk/N 3RELgqqvhXQjhRlGDDnkfTCVcZ87/DFkRbW3vqUOoyM4suDbe8EgqS8h54phRgqjyAuLcFnumAH 64b6b/pmofFo= X-Received: by 2002:adf:e4c4:: with SMTP id v4mr27933913wrm.332.1643876838441; Thu, 03 Feb 2022 00:27:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJwWBN8FmjCQATCY1dHn479U4lb3by48KSEH1vwLr1w8qX2V41BfYO7Sf/m5ssgb3DEEE7rXzA== X-Received: by 2002:adf:e4c4:: with SMTP id v4mr27933900wrm.332.1643876838184; Thu, 03 Feb 2022 00:27:18 -0800 (PST) Received: from ?IPV6:2003:d8:2f11:9700:838c:3860:6500:5284? (p200300d82f119700838c386065005284.dip0.t-ipconnect.de. [2003:d8:2f11:9700:838c:3860:6500:5284]) by smtp.gmail.com with ESMTPSA id 5sm22514099wrb.113.2022.02.03.00.27.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 03 Feb 2022 00:27:17 -0800 (PST) Message-ID: Date: Thu, 3 Feb 2022 09:27:16 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 To: Mike Rapoport , Wei Yang Cc: Michal Hocko , Andrew Morton , linux-mm@kvack.org, LKML , Alexey Makhalov , Dennis Zhou , Eric Dumazet , Oscar Salvador , Tejun Heo , Christoph Lameter , Nico Pache , Rafael Aquini References: <20220127085305.20890-1-mhocko@kernel.org> <20220127085305.20890-3-mhocko@kernel.org> <20220201024119.2ailcw4rp5thambz@master> <20220203002116.akpk5um5nkpeflve@master> From: David Hildenbrand Organization: Red Hat Subject: Re: [PATCH 2/6] mm: handle uninitialized numa nodes gracefully In-Reply-To: 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 X-Stat-Signature: 5ypk4cqfrkuxygzxbi4gawae1rd5zcbj X-Rspam-User: nil Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=HNnuHQoD; spf=none (imf24.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-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 39B51180004 X-HE-Tag: 1643876841-527631 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 03.02.22 08:23, Mike Rapoport wrote: > On Thu, Feb 03, 2022 at 12:21:16AM +0000, Wei Yang wrote: >> On Tue, Feb 01, 2022 at 10:54:37AM +0100, Michal Hocko wrote: >>> On Tue 01-02-22 02:41:19, Wei Yang wrote: >>>> On Thu, Jan 27, 2022 at 03:47:40PM +0100, Michal Hocko wrote: >>>> [...] >>>>>>> + /* >>>>>>> + * not marking this node online because we do not want to >>>>>>> + * confuse userspace by sysfs files/directories for node >>>>>>> + * without any memory attached to it (see topology_init) >>>>>>> + * The pgdat will get fully initialized when a memory is >>>>>>> + * hotpluged into it by hotadd_init_pgdat >>>>>>> + */ >>>> >>>> Hmm... which following step would mark the node online? On x86, the node is >>>> onlined in alloc_node_date(). This is not onlined here. >>> >>> The comment tries to explain that this happens during the memory >>> hotplug. Or maybe I have missed your question? >>> >> >> I am not sure for others, while the comment confused me a little. >> >> Currently in kernel, there are two situations for node online: >> >> * during memory hotplug >> * during sys-init >> >> For memory hotplug, we allocate pgdat and online node. And current hot-add >> process has already put them in two steps: >> >> 1. __try_online_node() >> 2. node_set_online() >> >> So emphasize "not online" node here, confuse me a little. It is a natural >> thing to not online node until it has memory. >> >> But from another point of view, the comment here is reasonable. During >> sys-init, we online node at the same time when creating pgdat. And even for >> memory-less node on x86, we online them too. >> >> Well, this is all about the comment. I have tried to grab may head but not >> come up with a better idea. >> >> Or maybe this is just my personal feeling, don't bother if no-one else feel >> like this. > > I shuffled the words a bit, maybe this sounds better not only to me :) > > /* > * We do not want to confuse userspace by sysfs files/directories for node > * without any memory attached to it, so this node is not marked as > * N_MEMORY and not marked online so that topology_init() won't create > * sysfs hierarchy for this node. The pgdat will get fully initialized by > * hotadd_init_pgdat() when memory is hotpluged into this node > */ > Note that the topology_init() part might change soon [1] so maybe we want to rephrase that to "so that no sysfs hierarchy will be created via register_one_node() for this node." right away. or (because there is also /sys/devices/system/node/online ) "so that the node won't be indicated as online to user space, for example, via register_one_node()." [1] https://lkml.kernel.org/r/20220128151540.164759-1-david@redhat.com -- Thanks, David / dhildenb