Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1766995rwd; Mon, 15 May 2023 02:45:53 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ66lxU/68yiGKLWBFiRWK6EAPX3pU6LHps3DfCqM8RTE8aTy/KmfStUU25G+u1g9EeTCc6k X-Received: by 2002:a05:6a21:3398:b0:103:946d:8a4c with SMTP id yy24-20020a056a21339800b00103946d8a4cmr21656115pzb.5.1684143953636; Mon, 15 May 2023 02:45:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684143953; cv=none; d=google.com; s=arc-20160816; b=afmY8+wtaW+flO5YEy+ApkT8v8B57KDo9sQK6IC6Uul953dVhNW9C9TtV8C3pthxvV BTFE+zD5KPDP3MbYG2IyzjNhV/5lbTcmq+4+VQ3TN/2ol8xRQ390V+7hqV4V1CElJcU8 tELTc0hJnkImldTN9VsEdYO2xzoJEX7v7Uw+1ZBRGDWMomoNevYEFZ8yZAX/6Ze/37i4 O04HyFTQX8BKZYnrxX70o0CgtpxAp6/pSETqbWGS3fbnTBPHjAsIz4/hvPwWHLxBac61 x0VGmH7aeSPE0ahRLDN6beSYW64oC2JhW/MjJnM37ovB/HI+w9rR21eFxS8qzzRFpPx+ QZ/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=qneuMWhtOE+R25gU3FAOJvSSaBoni69GSkTylpWVCzs=; b=r1qUumKeZ/WxVeZ+KSh75gn8E9sL8zeENnXuvvjKpz4uUYYP6l5Bx0jpqXLLXhXgiy y7T8q8GfJ3YLtwKg2vjB/QQcRPLsidWJgUxD5El8zk4+xiaSlAR7VDNK4JxeAXCowco/ AHxm8Dj0F+CRlus/ltPgcUto2bzWZsd2i2xtZxDRtDd4VklHgD4C+Mr/hXYOvgHpYTPp y6BPNT5LKeO+lIP5e9TUoxAnV3bM7bPqJ7v44v46MGmmb55dgIOGlscrpuZvxYc4l1w7 inp75IVi8hgxe5L+DCuPUZ+bYPKow/8yF6czseSc4XZfn2JfUPB8IJK95m8VIjN1i67E e0DQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j13-20020a63cf0d000000b005139e5df68asi15419132pgg.433.2023.05.15.02.45.41; Mon, 15 May 2023 02:45:53 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240519AbjEOJjq (ORCPT + 99 others); Mon, 15 May 2023 05:39:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240503AbjEOJjP (ORCPT ); Mon, 15 May 2023 05:39:15 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 30B423C06 for ; Mon, 15 May 2023 02:36:43 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CFC4A2F4; Mon, 15 May 2023 02:36:56 -0700 (PDT) Received: from bogus (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1016B3F67D; Mon, 15 May 2023 02:36:10 -0700 (PDT) Date: Mon, 15 May 2023 10:36:08 +0100 From: Sudeep Holla To: Ricardo Neri Cc: Radu Rendec , linux-kernel@vger.kernel.org, Catalin Marinas , Will Deacon , Pierre Gondois , Sudeep Holla , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v4 1/3] cacheinfo: Add arch specific early level initializer Message-ID: <20230515093608.etfprpqn3lmgybe6@bogus> References: <20230412185759.755408-1-rrendec@redhat.com> <20230412185759.755408-2-rrendec@redhat.com> <20230510191207.GA18514@ranerica-svr.sc.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230510191207.GA18514@ranerica-svr.sc.intel.com> X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 On Wed, May 10, 2023 at 12:12:07PM -0700, Ricardo Neri wrote: > Hi, > > I had posted a patchset[1] for x86 that initializes > ci_cacheinfo(cpu)->num_leaves during SMP boot. > It is entirely clear to me if this is just a clean up or a fix to some issue you faced ? Just wanted to let you know Prateek from AMD has couple of fixes [2] > This means that early_leaves and a late cache_leaves() are equal but > per_cpu_cacheinfo(cpu) is never allocated. Currently, x86 does not use > fetch_cache_info(). > > I think that we should check here that per_cpu_cacheinfo() has been allocated to > take care of the case in which early and late cache leaves remain the same: > > - if (cache_leaves(cpu) <= early_leaves) > + if (cache_leaves(cpu) <= early_leaves && per_cpu_cacheinfo(cpu)) > > Otherwise, in v6.4-rc1 + [1] I observe a NULL pointer dereference from > last_level_cache_is_valid(). > I think this is different issue as Prateek was just observing wrong info after cpuhotplug operations. But the patches manage the cpumap_populated state better with the patches. Can you please look at that as weel ? -- Regards, Sudeep [2] https://lore.kernel.org/all/20230508084115.1157-1-kprateek.nayak@amd.com