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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9AC65C433F5 for ; Tue, 2 Nov 2021 13:52:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 73BDF604AC for ; Tue, 2 Nov 2021 13:52:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231419AbhKBNyn (ORCPT ); Tue, 2 Nov 2021 09:54:43 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:43750 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229530AbhKBNyj (ORCPT ); Tue, 2 Nov 2021 09:54:39 -0400 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 1DC641FD3D; Tue, 2 Nov 2021 13:52:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1635861124; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QuhDls7hbN4UKLnf4cjWDbk3jK59u3TGKj6IxVYK1C0=; b=Mz70zonVUxIqoOeRaeX5b5iUesoDtqU//LQYeHkDgXEKjZQk4BPwUh8Q16H3FfqeqNwUqG Px3SmOC855+OXTRcIH6tJp7WxKC2sHqjGKVlqQLMhnQXvfVydyFhK0UDRonvKC1dYzjzep Z1Ha7d1cNAV4S2M5nLHI/2S9uU+il6o= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1635861124; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QuhDls7hbN4UKLnf4cjWDbk3jK59u3TGKj6IxVYK1C0=; b=DF7kJtMQlHoUDmQXqJHlVbSNLh6MVgIoT2I1y+rquXauor8l5KxpS/H5gNXP7KX88yHphb N9rPZG2TjYJCrEAg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 7E41613D66; Tue, 2 Nov 2021 13:52:03 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id uxBiG4NCgWHKGAAAMHmgww (envelope-from ); Tue, 02 Nov 2021 13:52:03 +0000 Date: Tue, 2 Nov 2021 14:52:01 +0100 From: Oscar Salvador To: Michal Hocko Cc: David Hildenbrand , Alexey Makhalov , "linux-mm@kvack.org" , Andrew Morton , "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" , Oscar Salvador Subject: Re: [PATCH] mm: fix panic in __alloc_pages Message-ID: <20211102135201.GA4348@linux> References: <42abfba6-b27e-ca8b-8cdf-883a9398b506@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 02, 2021 at 02:25:03PM +0100, Michal Hocko wrote: > I think we want to learn how exactly Alexey brought that cpu up. Because > his initial thought on add_cpu resp cpu_up doesn't seem to be correct. > Or I am just not following the code properly. Once we know all those > details we can get in touch with cpu hotplug maintainers and see what > can we do. I am not really familiar with CPU hot-onlining, but I have been taking a look. As with memory, there are two different stages, hot-adding and onlining (and the counterparts). Part of the hot-adding being: acpi_processor_get_info acpi_processor_hotadd_init arch_register_cpu register_cpu One of the things that register_cpu() does is to set cpu->dev.bus pointing to &cpu_subsys, which is: struct bus_type cpu_subsys = { .name = "cpu", .dev_name = "cpu", .match = cpu_subsys_match, #ifdef CONFIG_HOTPLUG_CPU .online = cpu_subsys_online, .offline = cpu_subsys_offline, #endif }; Then, the onlining part (in case of a udev rule or someone onlining the device) would be: online_store device_online cpu_subsys_online cpu_device_up cpu_up ... online node Since Alexey disabled the udev rule and no one onlined the CPU, online_store()-> device_online() wasn't really called. The following only applies to x86_64: I think we got confused because cpu_device_up() is also called from add_cpu(), but that is an exported function and x86 does not call add_cpu() unless for debugging purposes (check kernel/torture.c and arch/x86/kernel/topology.c). It does the onlining through online_store()... So we can take add_cpu() off the equation here. -- Oscar Salvador SUSE Labs