Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2210177pxb; Thu, 3 Feb 2022 01:35:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJxl0bb/P41KP+0slp5MFAHFiGRkWib+zicc9Edc060Ff2QnY4RIgkcrQiOX6pLRrzW7zvyB X-Received: by 2002:a17:906:4789:: with SMTP id cw9mr28748973ejc.97.1643880925915; Thu, 03 Feb 2022 01:35:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643880925; cv=none; d=google.com; s=arc-20160816; b=w3wz2kcEqUy5qYHKjvQYKAayCauPNZLhj708s0BFcHiFjKyNGBVWZ++OQyTBb4lCBy ynUNhhE/R43sPRUS4PDiocHjZNDeYwPrWqQBEPoNvpjiKm/6vgszKHOCuL6O2C8cSXNK nboN+je4iWUBvyyH/rEvFruGSRcTbxxvzrXp/g5774AXbsfCcJDMUrHXZw7qADlARB5+ PPThRpjCu3WG8GBjzFnOFcwtaxN/TteJFQhQnXbUDICS4jIEeO7sg63P0DmcQW9+k8cb sLs6k2pkmeU+aUIzp+DLSX7I9Wtf8bjinNAXQTq7eCnKKGf7sQ2dX5IkbifhuWL7RD7F L7oA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=/58po+BfL52bHfuX8VFbmVWh0rB49LU1gYEqu53DFas=; b=r7kTeUHSfPDa/wQvzMr+V6WIyiKT2M6LKsAKP21B0qZvit2R6Kxx9YTLYJVp0WTH59 T+mZCbFL9cp8DdLRrMjN6nDG+jqg8czu3ztMqIkUJoAifmMIwA2QLX7ANF+aJrJfd0O5 67yXaK7qONrb4BW6OIP4VPIMUtnfpRQ/9gOp3sSyL3qwvc2XxVmhZKwvKiERCpRQelgS UTFli3TCYhSLLbBljls/TAB6DJzvX6CyDFjRCtG1ccuNAbciFrF+fbIIPNnChEd8bbRc j7VWoXpG1ge27iEcUYkpOcOoj4em1Ije+vwkuz3/zzH8FN1YAFsR3DVJZzBzIjZGoBy+ iECQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Msc0hYHL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b8si12012284ejl.928.2022.02.03.01.34.59; Thu, 03 Feb 2022 01:35:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Msc0hYHL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238721AbiBCJL3 (ORCPT + 99 others); Thu, 3 Feb 2022 04:11:29 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:31255 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231533AbiBCJLZ (ORCPT ); Thu, 3 Feb 2022 04:11:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643879485; 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=/58po+BfL52bHfuX8VFbmVWh0rB49LU1gYEqu53DFas=; b=Msc0hYHLjpdgzLmaxkphXq3PT4FUnFK89QoGaBs/5OwcbVKSFNMR0wrN+umdIq/2sIsx5J 9+UwnvNQPKOxLi2OA6k9mbIoI9MkPO3QoVnnW+YBgoMCduZX/wrZUfrtlkLijqcRXwRVqT 0z1pEgPoHDn7Vv8CmWA5tmiDqXJU5Yg= 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-28-tH2PoFKPP0eu8qVlj8LTDw-1; Thu, 03 Feb 2022 04:11:24 -0500 X-MC-Unique: tH2PoFKPP0eu8qVlj8LTDw-1 Received: by mail-wm1-f72.google.com with SMTP id n22-20020a05600c3b9600b00352d3f6a850so504187wms.3 for ; Thu, 03 Feb 2022 01:11:24 -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:subject :content-language:to:cc:references:from:organization:in-reply-to :content-transfer-encoding; bh=/58po+BfL52bHfuX8VFbmVWh0rB49LU1gYEqu53DFas=; b=lUv2eTAed1b2hDdB3T/Dbqwa1WOpB7n9m5uaHGes7yvLQJYw80P/NR8wK+MYZVZhzd DcEf74gQsvSI7dPfRGvzyp33CLWFgZJeya3mceINnvyX8sMl7TzJtsGHEBzUdGUG4uNR pU4t8EyCIqaQynO00giZofqHoAJafJ0pT+hnUXNwBl+7+KQ4PHQSHhnaYm4qcYJxODLO N90GvftJS7sYloMAjbUTKxCreiXHkV5/MUFkLjP6tFZxMFcDGME1pkWBb84RA6Btto1c kz/bVifCM3WpM1puwHfh4fTdUgska/v5LqlSdr43lQuMU6+bFkq9p2SOmNxC4Qm2x3QB /p+A== X-Gm-Message-State: AOAM531Urjq5NAmTZCMVyqgPvMy9LuAyuv2km1RLzYw1VHZH1Y4As0st q4jIjiRFURmzuXDjrV+WL2Ng6R549wyd6fTQMCN2ShmETUB1eBhXel+60A80H1SXJ+VWq0RgLls c5jk11l/xM9wlrydJ+xyAfJQC X-Received: by 2002:a5d:47ad:: with SMTP id 13mr8490539wrb.297.1643879482965; Thu, 03 Feb 2022 01:11:22 -0800 (PST) X-Received: by 2002:a5d:47ad:: with SMTP id 13mr8490511wrb.297.1643879482706; Thu, 03 Feb 2022 01:11:22 -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 u1sm1551145wrs.47.2022.02.03.01.11.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 03 Feb 2022 01:11:22 -0800 (PST) Message-ID: <15ad305f-a147-4a9c-35e5-bb0a868499ad@redhat.com> Date: Thu, 3 Feb 2022 10:11:21 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Subject: Re: [PATCH 2/6] mm: handle uninitialized numa nodes gracefully Content-Language: en-US To: Mike Rapoport Cc: Wei Yang , 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 In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03.02.22 10:08, Mike Rapoport wrote: > On Thu, Feb 03, 2022 at 09:27:16AM +0100, David Hildenbrand wrote: >> 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. > > Heh, this will be your responsibility to update the comment here when you > post non-RFC version ;-) I'm usually sending patches against Linus' tree. And I'll post non-RFC most probably today (after testing on aarch64) ;) So I'd appreciate if we could just phrase it more generically, as I tried. But of course, we can try making my life harder ;) -- Thanks, David / dhildenb