Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp649857pxb; Tue, 1 Feb 2022 07:41:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJw/5sCscxwCJZnCfiCuhavTvPs1MFqU+/mcaZZi/rBbpAaBHdRTm6vjSl0tFe6jhIlFMR+q X-Received: by 2002:a05:6402:190f:: with SMTP id e15mr25637156edz.195.1643730068611; Tue, 01 Feb 2022 07:41:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643730068; cv=none; d=google.com; s=arc-20160816; b=KnyPHF9KC50cjaEVknJ+wfe2Dj7BSRD3KnWui51klKzU0gvv8TusqW82a9hx6M0wNy GCHNsOwWoDOSfdiOllz5noJC6FluhQ/KZBprZEhQZTc2JkujllSpeMdS9fPcQRa5sXf/ lJ0TuDulat8MzX3uUkaYS4BIDHOdxGQgrKFGwdf+FHc4SOTo7cyNlzaPItruut4LSISc tsO660VpFNEwxZ7sdFGSwV3j1wqRekQe8Bw/rSHntf29ZCjPX2YXMeTOzrzO3uQswFr3 FCPmoZ1Fa9kk1tS/7Sw8PlC81EScNuJCyE/T9sdZT/OBfcEXcN610tv3UeA7Azs7Rkpg evkA== 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=ZAt16hzi0jARVC2SH2tfH/9B/mqcxkzoEuuB90n1AMk=; b=uGFSLwWTF7rEVdvC2vwpvZ8LHkOeHe4YrcIfiQLyaBO6u4soCCxMRLPmyknom9YqxQ ezOddEiQ/faPryMnml/Rihh8ad1hI6uhOBRoe66CXbOMYWn52ax17CZlnK0UG9ujCpXk 4a7SWKTJwN4RaQ3nKvQiKsaWg2KdM64sDZGOP2XT0pYinG0cz9yeXAPCghj2INwcutch S86TVaGqjCDxfecVyoaYnMkWqR9EDO+QeQASk1TbDBlCGJcwTFh4eLZQUXmC6+vwtO9K klmYFpO1+G48p+VmLgrO1qmGZWvBLLk19UQ165WSgKV8PnOV6xFxeSHl3J2x0gya83D1 3Tlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DLNgAquR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dp5si5036176ejc.40.2022.02.01.07.40.43; Tue, 01 Feb 2022 07:41:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DLNgAquR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S238030AbiAaHtE (ORCPT + 99 others); Mon, 31 Jan 2022 02:49:04 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:39545 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237965AbiAaHtB (ORCPT ); Mon, 31 Jan 2022 02:49:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643615340; 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=ZAt16hzi0jARVC2SH2tfH/9B/mqcxkzoEuuB90n1AMk=; b=DLNgAquRIbUZTcV6FsD5ygfGUQ5xtsO4FBrARcgfAJzBD3fJ8B+VGw/YqlADGy9tt7PXZp 7efpEfocNzPCn2ioe1ow3QnAT2/he84B3OcuQaGMgdXoqL+vYrHpVQ1M7G4OPLl0qDDlbB sOq6wP8BgOlE2DOgLUmJ/UtqfL5HQhw= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-587-M94Lr8mTPT6vXmGQmkKU7w-1; Mon, 31 Jan 2022 02:48:58 -0500 X-MC-Unique: M94Lr8mTPT6vXmGQmkKU7w-1 Received: by mail-wm1-f70.google.com with SMTP id bg23-20020a05600c3c9700b0034bb19dfdc0so2648748wmb.1 for ; Sun, 30 Jan 2022 23:48:58 -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=ZAt16hzi0jARVC2SH2tfH/9B/mqcxkzoEuuB90n1AMk=; b=c6hJAVGL5zPUrbEAkj3JpomU0V1dLGqp9YqWz6v82uRVCMot+ZHiPVPShv4d2pgdR1 vTwfCigIAbM8rDWX8dijTmGenpoJ305+NG+E7ekxjg3gmDODhO2/70sA8Uniq9kdL8bz yn4wUhBiG1cj5Lhe26TwlUGpzD62NBDQkhZd/VE8yWQ/5vucOoIYeQkNweg0ByCghjBO Hi59cmLnxR+eCxosik54W0t7rF3qDzG6OU6Iwiet+t717IoS4Jpz5yrKXsUOmNhM59HT HIL+NpqX5bu2F9elRYpc2U59Jodd4U7NRoBR0nWK4MWZHFouLuO+8ROtlJIrDITL60JG ahcQ== X-Gm-Message-State: AOAM5306RnYCAfk8l/SLFvKvFt9gVl3VgKdIp4QHtOx8hhIfVx+Y9RnI v4HGtHhME3u0NpG+Detyq0kbGVGX7T9kY5NHaeW/3rwQkpbO/Ggx2ADtrIhrKdcHNh9vFISPIgR 5Qo7KlvqX11Y3NTRGx96wAr5L X-Received: by 2002:a05:6000:1008:: with SMTP id a8mr15911198wrx.563.1643615337602; Sun, 30 Jan 2022 23:48:57 -0800 (PST) X-Received: by 2002:a05:6000:1008:: with SMTP id a8mr15911171wrx.563.1643615337390; Sun, 30 Jan 2022 23:48:57 -0800 (PST) Received: from ?IPV6:2003:cb:c709:b200:f007:5a26:32e7:8ef5? (p200300cbc709b200f0075a2632e78ef5.dip0.t-ipconnect.de. [2003:cb:c709:b200:f007:5a26:32e7:8ef5]) by smtp.gmail.com with ESMTPSA id y6sm5081791wrl.46.2022.01.30.23.48.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 30 Jan 2022 23:48:56 -0800 (PST) Message-ID: <3be2e20c-f0b9-c080-adf4-b0e17c046eb0@redhat.com> Date: Mon, 31 Jan 2022 08:48:54 +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 RFC v1] drivers/base/node: consolidate node device subsystem initialization in node_dev_init() Content-Language: en-US To: Oscar Salvador Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Greg Kroah-Hartman , Michal Hocko , Catalin Marinas , Will Deacon , Thomas Bogendoerfer , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Paul Walmsley , Palmer Dabbelt , Albert Ou , Heiko Carstens , Vasily Gorbik , Yoshinori Sato , Rich Felker , "David S. Miller" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "Rafael J. Wysocki" , x86@kernel.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org References: <20220128151540.164759-1-david@redhat.com> 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 31.01.22 07:23, Oscar Salvador wrote: > On Fri, Jan 28, 2022 at 04:15:40PM +0100, David Hildenbrand wrote: >> ... and call node_dev_init() after memory_dev_init() from driver_init(), >> so before any of the existing arch/subsys calls. All online nodes should >> be known at that point. >> >> This is in line with memory_dev_init(), which initializes the memory >> device subsystem and creates all memory block devices. >> >> Similar to memory_dev_init(), panic() if anything goes wrong, we don't >> want to continue with such basic initialization errors. >> >> The important part is that node_dev_init() gets called after >> memory_dev_init() and after cpu_dev_init(), but before any of the >> relevant archs call register_cpu() to register the new cpu device under >> the node device. The latter should be the case for the current users >> of topology_init(). > Hi Oscar, > So, before this change we had something like this: > > do_basic_setup > driver_init > memory_dev_init > do_init_calls > ... > topology_init > register_nodes/register_one_node > > And after the patch all happens in driver_init() > > driver_init > memory_dev_init > node_dev_init > > I guess this is fine as we do not have any ordering problems (aka: none > of the functions we used to call before expect the nodes not to be > there for some weird reason). > > So, no functional change, right? > Right, and the idea is that the online state of nodes (+ node/zone ranges) already has to be known at that point in time, because otherwise, we'd be in bigger trouble. Thanks! -- Thanks, David / dhildenb