Received: by 2002:ab2:3319:0:b0:1ef:7a0f:c32d with SMTP id i25csp602591lqc; Fri, 8 Mar 2024 06:51:56 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUg0Pn2GkqwTXZ0Q0Qa30BMShsn3tBW2rwD91xhDJk31a4CljP8WVK2+zUM2PeU439GBOwI4z4iHYWyDKVQvMRGNZOSShM11tnGwS/u/Q== X-Google-Smtp-Source: AGHT+IGwU0361kvkt9QftV1MfdPIQTcipir38EIj9umDWhcQhebCep0JMWI9C28lyrq8xGaSRKoK X-Received: by 2002:ad4:58e8:0:b0:690:a30f:ff2f with SMTP id di8-20020ad458e8000000b00690a30fff2fmr3873962qvb.64.1709909516335; Fri, 08 Mar 2024 06:51:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709909516; cv=pass; d=google.com; s=arc-20160816; b=v/w3dTVU4JvIPSNSNuQXGNxJxlfztBZ37MihyWpsETvihGJ4puQ8KzjGER70xEnI03 OLLez/k0pbnwchvON0POVofJvgHBhhdjqhKnztzu7a68YTy41xlN273Os5eAHNQklpyD Ua1ZISkYUpIMjn1u5/h2L2sUCmWAypXdYHHDwqm4BXTJ6Y70xSFa9lZjO3tySD+Tk2RJ 8TmQRSXRQazqRXEPJ22IEPhryfE8vQCkYBMTbPQQbm/SkZQV/qb5ONzPuHuB9gEhk5Wy R/1gwq5mmC6xld88CodmqzbW6eSZNwnSXmazitZmTvQIejLu8yo9wjEshDoiXPiUexdB uo5Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date; bh=r/8Bxm2e4x68X3XrF4BYg3LiQyeafC4vLuOeMUOmTig=; fh=BGZ6SnPqBO1aS1BcKFm74KRqsB+43p7n4uBICYb0SfA=; b=J1LJ791zhmMj1mvWqTQsRdMlFhQ15kbgMYIiCqz+06dRy716tK0q0s0OzI4F5paq0z IRxOkqwcMV8bX0XVwl+YAi+nZf8n/uuX6IGcIrU5imFj6/5fF6vQTu4IIS6PKsXGs+tH mqA3rcVSu73NoI0s7b/zmFJpqnlv6zKPuwI753mrtcmH1RpyY0WYVh0nsqRkCXh9OMmq kzN48dQJBFLPNnbn15B/IMRY96kvHm2lXQovIq3jIwUjNWuRXmG9/4+Qq7TgMXmWZKC0 VwjzZMB0rEzeT8KjaMZo9cDzuAteSfquv7dR/7hfgs6QVASFs02x64PRexJl9nVijWlU ILkg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-97192-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-97192-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id p8-20020ad45f48000000b0069006d7edccsi19629157qvg.48.2024.03.08.06.51.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 06:51:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-97192-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-97192-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-97192-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 16EA71C2188A for ; Fri, 8 Mar 2024 14:51:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 09CF7567A; Fri, 8 Mar 2024 14:51:52 +0000 (UTC) Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 721C11DFC5; Fri, 8 Mar 2024 14:51:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709909511; cv=none; b=eUEBnIkLev569OYZ34FGTDDA7msvax4ID983LQRsWdcXY74uuzE22clbm0EH5VPd+d2ng8XYRWuDQnlPfeATObz9vIr9q3R2VkISMCh5A6LFKmJEs+iX2Hdn7d5V3DvD1au0+vH+tpfn2N/T1zD8BEgiAdB04la/tvchr16mTCo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709909511; c=relaxed/simple; bh=Tz6KwaY4wnYO1nF9pvINazsOvVULoLiR0sNzUkZKMvY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GXFSHxBK+q0UX4RQVGNHlWSd/g0oaMJ5hVSs+AU3IPyhLip2aBbTFozGoFiLzR2UyBI2tQ3rpgFXH+O06EpvVnmqwZuKgYwHorhQb/pplgFAM2eb58xf6FinMHvHYVX8X6VXyZjYtV2fwab7ppAvW/36RIcy4womAHFbFHedHyw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9F0DDC433F1; Fri, 8 Mar 2024 14:51:46 +0000 (UTC) Date: Fri, 8 Mar 2024 14:51:44 +0000 From: Catalin Marinas To: Marek Szyprowski Cc: "Christoph Lameter (Ampere)" , Mark Rutland , "linux-pm@vger.kernel.org" , "Rafael J. Wysocki" , Viresh Kumar , Will Deacon , Jonathan.Cameron@huawei.com, Matteo.Carlini@arm.com, Valentin.Schneider@arm.com, akpm@linux-foundation.org, anshuman.khandual@arm.com, Eric Mackay , dave.kleikamp@oracle.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux@armlinux.org.uk, robin.murphy@arm.com, vanshikonda@os.amperecomputing.com, yang@os.amperecomputing.com, Nishanth Menon , Stephen Boyd Subject: Re: [PATCH v3] ARM64: Dynamically allocate cpumasks and increase supported CPUs to 512 Message-ID: References: <37099a57-b655-3b3a-56d0-5f7fbd49d7db@gentwo.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Fri, Mar 08, 2024 at 03:01:28PM +0100, Marek Szyprowski wrote: > This patch landed in today's linux-next as commit 0499a78369ad ("ARM64: > Dynamically allocate cpumasks and increase supported CPUs to 512"). > Unfortunately it triggers the following warning during boot on most of > my ARM64-based test boards. Here is an example from Odroid-N2 board: > > ?------------[ cut here ]------------ > ?WARNING: CPU: 4 PID: 63 at drivers/opp/core.c:2554 > dev_pm_opp_set_config+0x390/0x710 > ?Modules linked in: dw_hdmi_i2s_audio meson_gxl smsc onboard_usb_hub(+) > rtc_pcf8563 panfrost snd_soc_meson_axg_sound_card drm_shmem_helper > crct10dif_ce dwmac_generic snd_soc_meson_card_utils gpu_sched > snd_soc_meson_g12a_toacodec snd_soc_meson_g12a_tohdmitx rc_odroid > snd_soc_meson_codec_glue pwm_meson ao_cec_g12a meson_gxbb_wdt meson_ir > snd_soc_meson_axg_frddr snd_soc_meson_axg_toddr snd_soc_meson_axg_tdmin > meson_vdec(C) v4l2_mem2mem videobuf2_dma_contig snd_soc_meson_axg_tdmout > videobuf2_memops axg_audio videobuf2_v4l2 sclk_div videodev > reset_meson_audio_arb snd_soc_meson_axg_fifo clk_phase dwmac_meson8b > stmmac_platform videobuf2_common mdio_mux_meson_g12a meson_drm > meson_dw_hdmi rtc_meson_vrtc stmmac meson_ddr_pmu_g12 mc dw_hdmi > drm_display_helper pcs_xpcs snd_soc_meson_t9015 meson_canvas gpio_fan > display_connector snd_soc_meson_axg_tdm_interface > snd_soc_simple_amplifier snd_soc_meson_axg_tdm_formatter nvmem_meson_efuse > ?hub 1-1:1.0: USB hub found > ?CPU: 4 PID: 63 Comm: kworker/u12:5 Tainted: G???????? C 6.8.0-rc3+ #14677 > ?Hardware name: Hardkernel ODROID-N2 (DT) > ?Workqueue: events_unbound deferred_probe_work_func > ?pstate: 80000005 (Nzcv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) > ?pc : dev_pm_opp_set_config+0x390/0x710 > ?lr : dev_pm_opp_set_config+0x5c/0x710 > ?... > ?Call trace: > ? dev_pm_opp_set_config+0x390/0x710 > ? dt_cpufreq_probe+0x268/0x480 > ? platform_probe+0x68/0xd8 > ? really_probe+0x148/0x2b4 > ? __driver_probe_device+0x78/0x12c > ? driver_probe_device+0xdc/0x164 > ? __device_attach_driver+0xb8/0x138 > ? bus_for_each_drv+0x84/0xe0 > ? __device_attach+0xa8/0x1b0 > ? device_initial_probe+0x14/0x20 > ? bus_probe_device+0xb0/0xb4 > ? deferred_probe_work_func+0x8c/0xc8 > ? process_one_work+0x1ec/0x53c > ? worker_thread+0x298/0x408 > ? kthread+0x124/0x128 > ? ret_from_fork+0x10/0x20 > ?irq event stamp: 317178 > ?hardirqs last? enabled at (317177): [] > ktime_get_coarse_real_ts64+0x10c/0x110 > ?hardirqs last disabled at (317178): [] el1_dbg+0x24/0x8c > ?softirqs last? enabled at (315802): [] > __do_softirq+0x4a0/0x4e8 > ?softirqs last disabled at (315793): [] > ____do_softirq+0x10/0x1c > ?---[ end trace 0000000000000000 ]--- > ?cpu cpu2: error -EBUSY: failed to set regulators > ?cpufreq-dt: probe of cpufreq-dt failed with error -16 > > It looks that cpufreq-dt and/or opp drivers needs some adjustments > related with this change. That's strange. Is this with defconfig? I wonder whether NR_CPUS being larger caused the issue with this specific code. Otherwise CPUMASK_OFFSTACK may not work that well on arm64. > > > > --- > > > > > > Original post: https://www.spinics.net/lists/linux-mm/msg369701.html > > V2: https://lkml.org/lkml/2024/2/7/505 > > > > > > V1->V2 > > > > - Keep quotation marks > > - Remove whiltespace damage > > - Add tested by > > > > V2->V3: > > - Add test results > > - Rework descriptions > > > > > > ?arch/arm64/Kconfig | 16 +++++++++++++++- > > ?1 file changed, 15 insertions(+), 1 deletion(-) > > > > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig > > index aa7c1d435139..4e767dede47d 100644 > > --- a/arch/arm64/Kconfig > > +++ b/arch/arm64/Kconfig > > @@ -1427,7 +1427,21 @@ config SCHED_SMT > > ?config NR_CPUS > > ???? int "Maximum number of CPUs (2-4096)" > > ???? range 2 4096 > > -??? default "256" > > +??? default "512" > > + > > +# > > +# Determines the placement of cpumasks. > > +# > > +# With CPUMASK_OFFSTACK the cpumasks are dynamically allocated. > > +# Useful for machines with lots of core because it avoids increasing > > +# the size of many of the data structures in the kernel. > > +# > > +# If this is off then the cpumasks have a static sizes and are > > +# embedded within data structures. > > +# > > +??? config CPUMASK_OFFSTACK > > +??? def_bool y > > +??? depends on NR_CPUS > 256 > > > > ?config HOTPLUG_CPU > > ???? bool "Support for hot-pluggable CPUs" > > Best regards > -- > Marek Szyprowski, PhD > Samsung R&D Institute Poland > -- Catalin