Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3815780pxv; Tue, 13 Jul 2021 04:35:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxj089D3Tn8VzJAt1RlIxl2kXiM5jawRkj/54AJbm8Jl2uhMwOYJjEnyoa02b9pQ9a/fOiK X-Received: by 2002:a92:8707:: with SMTP id m7mr2606341ild.177.1626176110689; Tue, 13 Jul 2021 04:35:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626176110; cv=none; d=google.com; s=arc-20160816; b=tI5MLnYOgQg3oqts54HVcQA7tjUdRppcL6An+LF/PEqdIR3lkRJoEkQ5jIzVuZoV9u CMvsaLG1j7/7zDG3TPKeKnN6+EgJrtvPWgHAKzhsF3JJ1ub8sDYdOY0rxWvTtl+0AhKV QkT/RwvmDXQ0pw+tJcFFWEZeFEE6vBMYe2OzZ8jRYIEkbAeE3E23Xafh0IMSGW0lr/cy P4AZ+yZcTjejZK+oM2rUm17BfMhbMBhX5OhQdybtxKVlL+utwaMxqDt0PE/xQi1+jFW2 50auOgd4QLuOm2qPxSqPOjxkGS1FC2nyrYmQ/J2DIlu2Wpxkzsqu0RPYXwu9mRGGj8e2 u4BQ== 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=0etUy6y2qfycW8pLLqQsSuEQ5wm8ZdkPdYLsOEKCeBk=; b=ERMOeEcQV81UztxKP9T8e5qHud8ZH8TGsECIy21KsPUtBAagpTkgYdiSEX8VPAp+Et v1LIt5d8cMfACPZbNL4iN+o1jvHhtkrd8JK1IbS0/1yN5bO/bPjulDIj6UgZClaBDGT0 2ET4I0b2uF5rmAuCxE6+jmIrlxkbmCWZLbXS72GAqc+B5fAi8R7WMUJLVMdERMSaRdcn VhwOog4LRsaynPoVdd5wMwcLyTgrgjWUhj98vxOImsNVq41JGCFv1eJuroFWsmiXFmdv HXl7xDuiWgOBHs52PHFi1Ya679gQlEErY62dt6Ul/ssLYdhOLc0g2+PciD+bLR5UO/2H 1K2Q== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w4si23924063iov.14.2021.07.13.04.34.58; Tue, 13 Jul 2021 04:35:10 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235797AbhGMLhX (ORCPT + 99 others); Tue, 13 Jul 2021 07:37:23 -0400 Received: from foss.arm.com ([217.140.110.172]:41712 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235623AbhGMLhW (ORCPT ); Tue, 13 Jul 2021 07:37:22 -0400 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 A1EF21FB; Tue, 13 Jul 2021 04:34:32 -0700 (PDT) Received: from bogus (unknown [10.57.79.213]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3221B3F7D8; Tue, 13 Jul 2021 04:34:31 -0700 (PDT) Date: Tue, 13 Jul 2021 12:33:24 +0100 From: Sudeep Holla To: Xiongfeng Wang Cc: gregkh@linuxfoundation.org, rafael@kernel.org, Sudeep Holla , linux-kernel@vger.kernel.org, james.morse@arm.com Subject: Re: [PATCH] cacheinfo: clear cache_leaves(cpu) in free_cache_attributes() Message-ID: <20210713113315.thsvrvqvqptc7hje@bogus> References: <1626148058-55230-1-git-send-email-wangxiongfeng2@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1626148058-55230-1-git-send-email-wangxiongfeng2@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 13, 2021 at 11:47:38AM +0800, Xiongfeng Wang wrote: > On ARM64, when PPTT(Processor Properties Topology Table) is not > implemented in ACPI boot, we will goto 'free_ci' with the following > print: > Unable to detect cache hierarchy for CPU 0 > The change itself looks good and I am fine with that. However,... > But some other codes may still use 'num_leaves' to iterate through the Can you point me exactly where it is used to make sure there are no other issues associated with that. > 'info_list', such as get_cpu_cacheinfo_id(). If 'info_list' is NULL , it > would crash. So clear 'num_leaves' in free_cache_attributes(). > And can you provide the crash dump please ? If we are not hitting any issue and you just figured this with code inspection, that is fine. It helps to determine if this needs to be backport or just good to have clean up. > Signed-off-by: Xiongfeng Wang > --- > drivers/base/cacheinfo.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/base/cacheinfo.c b/drivers/base/cacheinfo.c > index bfc0959..dad2962 100644 > --- a/drivers/base/cacheinfo.c > +++ b/drivers/base/cacheinfo.c > @@ -297,6 +297,7 @@ static void free_cache_attributes(unsigned int cpu) > > kfree(per_cpu_cacheinfo(cpu)); > per_cpu_cacheinfo(cpu) = NULL; > + cache_leaves(cpu) = 0; I initially thought it might get used and crash in cache_shared_cpu_map_remove but you are setting it later. So where do you suspect it to be used ? Sorry if I am missing something obvious, looking at this code after long time. -- Regards, Sudeep