Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4545995imw; Tue, 19 Jul 2022 08:34:03 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ul0Qw248KCDi/wJXpWVYEI8/gRHWSnIoepwC66vSwGy5yl0VagS4I8dlSRpOI1IFf2SY51 X-Received: by 2002:a05:6402:2388:b0:43a:ba61:36bb with SMTP id j8-20020a056402238800b0043aba6136bbmr43845907eda.78.1658244843617; Tue, 19 Jul 2022 08:34:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658244843; cv=none; d=google.com; s=arc-20160816; b=iNCiHrPPUt1KtbUMi7GpNzRNEjfY6yRiI075ims3P2lWDo9IzMWFHtmCDKfbv7O0Uh sHedM5iAVcK2r0/ce4QUuH/INcVUOpz2edXgB+O64DUo8ulfG/YsUx0gyTpaAzCdsBu2 +nU7Seo8ENrt+CVfmuWXIrw2gjHGga99baMuYrl8HXFoa3FwRrFTR7yJ8PZKDHb+0+Hv k4LdayDZ7pwrDFJstyBTyXw2XWDFjHubSUIAHME4wzUyJpobh4af0WZb809oonojHtzd W8b+aUBu86b5nBzGXYJQ04DvE2XivpgKdVSXyHIITQfKJYtl+AeKK/ByTXBRQkNIdsM6 +xRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=HV4Wgjz/TAUUMEiA/dyksbNxySCx+zbsJF2fZfi2554=; b=wtee9g9FbhblfJ1JiZqOv08LSJe/04XPC8EPhH8TapK+kIgrnVcKKT/THVawHUAV0g cWdMPPZOaS4jypBB8Iowvioi14it+rTK1jdlGfa6keeUpWNSncT0HrpeJDpyS5hwrnyV wLBlmPbIDuKIEMTxn3GbnEWuvAd/9DI8n6HqkCMPWzx2ptJNViuZkr11vuEwnFqbcIW9 Q1H4ZP/7CYgmgALBk2TMUcFuOsZbrG1wXaoTmGTgEhyU3T0JZP3VjOOfZMdY9OZ8pWj7 ed0RlmVBznh7L++J2Gl2V/BU5aaj5CIGHvBDx4ybflPAQsX5+1UKs8Qv6JoQNIdjObeb CMPg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i17-20020a170906091100b0072b1c605e89si15337907ejd.398.2022.07.19.08.33.38; Tue, 19 Jul 2022 08:34:03 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237634AbiGSPYt (ORCPT + 99 others); Tue, 19 Jul 2022 11:24:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233726AbiGSPYr (ORCPT ); Tue, 19 Jul 2022 11:24:47 -0400 Received: from mail-qk1-f182.google.com (mail-qk1-f182.google.com [209.85.222.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97D7656B80 for ; Tue, 19 Jul 2022 08:24:45 -0700 (PDT) Received: by mail-qk1-f182.google.com with SMTP id l3so9262378qkl.3 for ; Tue, 19 Jul 2022 08:24:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HV4Wgjz/TAUUMEiA/dyksbNxySCx+zbsJF2fZfi2554=; b=gmf4YGqjemuHOT8ZL/Bp1Mg52WRVpVhGxdGFTRmncYgDpwg1aHZU3ugM3y3Lb/I6Vk 02ggbPvAwlXO/4+fuHOrDGrbFipslgUYPeLUxEZVE9ww5tiF9BeEUVRPb1wlbYuAf5Lq +Y5IK1PcsmXOWzQWjPqmoAIB+JXmPdZT/op/JNEKn2kR8yEsmLlSXfAw6BihZI8wp3PO ps9FVe//nMJQ6EOSih7QXXxEyhezudOQl7OI4uwEqKudNAp+Yp+Lbgg8LlkehSWY7HS9 K7sSyVaQps4KchtmUD4xvl19f9clvnbHg7Mu3zx0dWRvXeSlyUIiXNFXsX/xkHpu/kiq cKdg== X-Gm-Message-State: AJIora8RAwHii3t4iXVZJTSc9OGsddqxaCM+N3FAdaHWlifTD1VHLJAf oYOihMTN/b4Z4enLYe5IuAGdsFSE6gYBhg== X-Received: by 2002:a05:620a:4452:b0:6b2:4f49:d053 with SMTP id w18-20020a05620a445200b006b24f49d053mr19981340qkp.685.1658244284652; Tue, 19 Jul 2022 08:24:44 -0700 (PDT) Received: from mail-yb1-f172.google.com (mail-yb1-f172.google.com. [209.85.219.172]) by smtp.gmail.com with ESMTPSA id l5-20020a37f905000000b006b56a4400f6sm13535861qkj.16.2022.07.19.08.24.44 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 Jul 2022 08:24:44 -0700 (PDT) Received: by mail-yb1-f172.google.com with SMTP id c131so26364739ybf.9 for ; Tue, 19 Jul 2022 08:24:44 -0700 (PDT) X-Received: by 2002:a25:bc8e:0:b0:66e:fe43:645c with SMTP id e14-20020a25bc8e000000b0066efe43645cmr32967226ybk.202.1658244283883; Tue, 19 Jul 2022 08:24:43 -0700 (PDT) MIME-Version: 1.0 References: <20220715102609.2160689-1-sudeep.holla@arm.com> <20220715102609.2160689-2-sudeep.holla@arm.com> In-Reply-To: <20220715102609.2160689-2-sudeep.holla@arm.com> From: Geert Uytterhoeven Date: Tue, 19 Jul 2022 17:24:32 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH -next v2 2/2] arch_topology: Fix cache attributes detection in the CPU hotplug path To: Sudeep Holla Cc: Linux Kernel Mailing List , Greg Kroah-Hartman , Conor Dooley , Vincent Guittot , Dietmar Eggemann , Ionela Voinescu , Pierre Gondois , Linux ARM , linux-riscv Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sudeep, On Fri, Jul 15, 2022 at 12:28 PM Sudeep Holla wrote: > init_cpu_topology() is called only once at the boot and all the cache > attributes are detected early for all the possible CPUs. However when > the CPUs are hotplugged out, the cacheinfo gets removed. While the > attributes are added back when the CPUs are hotplugged back in as part > of CPU hotplug state machine, it ends up called quite late after the > update_siblings_masks() are called in the secondary_start_kernel() > resulting in wrong llc_sibling_masks. > > Move the call to detect_cache_attributes() inside update_siblings_masks() > to ensure the cacheinfo is updated before the LLC sibling masks are > updated. This will fix the incorrect LLC sibling masks generated when > the CPUs are hotplugged out and hotplugged back in again. > > Reported-by: Ionela Voinescu > Tested-by: Ionela Voinescu > Reviewed-by: Conor Dooley > Reviewed-by: Ionela Voinescu > Signed-off-by: Sudeep Holla > --- > drivers/base/arch_topology.c | 16 ++++++---------- > 1 file changed, 6 insertions(+), 10 deletions(-) > > v1->v2: > - No change in this patch, but 1/2 was added to fix possible > bug "sleeping in the atomic context" with this patch. > - Added all the received tags Thank you, the "Early cacheinfo failed, ret = -12" is gone. Tested-by: Geert Uytterhoeven Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds