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 X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31B7FC433ED for ; Tue, 18 May 2021 13:14:33 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E365F6108C for ; Tue, 18 May 2021 13:14:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E365F6108C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:References:In-Reply-To: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=m2/oZBz/YoDQisO/c8j0Ubz+C9wpGKBlcNLRjgBUgas=; b=S/eIu6yP6K2GkQshMKyRkfiZA u4WwBZb8cT23mItgEWMtUoRIMuoPmk9KigHFUlhDr0oJL3NThKJzKgP39uOdUnLx9SzLyVJ+ggwFk D5LHGUkz0JTs4S9ZGSoNkYGbLmZ58iGJWeCHY8OfHr5Vywk33v1+6xwMZ2Ehh8Y3lWi38s+NNMCAK JPTcwUOoSd5u6NqheykXGpBTnigvFjT+n4Um917eHoYMaRnHJSrmRI2q2HzsdjuTkmEZOOLDtfNoV 5g8uPHVIoQBGWyJjGHxyd1NfBTnswje1gMtAjp3brPuCLXjUonWk8uboFN7gQPbSwd9MzW3dTC5y7 Per0myqPQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lizWP-000qUM-Mh; Tue, 18 May 2021 13:12:29 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lizWH-000qTs-Jo for linux-arm-kernel@desiato.infradead.org; Tue, 18 May 2021 13:12:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Type:MIME-Version:Message-ID: Date:References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=DzIL2UzZDFpthycuvuiEmwNlRN4MMWa0G9kJO0ADy38=; b=DXd0ztc+x1OgrGBRNgsIo6VhEQ XQBPUkXUKu9HnBwwgCnjuOUl2zBIKqOm+plAkQgyDWn0PvqKSNEmMkfZS1RgxYKuX49BF3iR7gYzM w3gfwSpVxJrnpZTRVLucvC4KezksN+uUasm202u5Y0kE6rI0ld2qnnoeyZ1cZ6VgFLTe0vpJ8c6yp WUUVhalJWlw6Bo8B44kaETLrAe778Z5KHeAjyfuVbsjhDKF0sN2NHLFVl3Bz2kq484YIX71Jg0QUY RPT4rJ+jhlMxIAAgnB8CVEAHzIus2QGQeLswYB4GbXITzbuilkxairk0lTRJcyP+UN/v1hri0l1Gi +XDVEEfg==; Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lizWF-00Efp7-1l for linux-arm-kernel@lists.infradead.org; Tue, 18 May 2021 13:12:20 +0000 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 DA511D6E; Tue, 18 May 2021 06:12:17 -0700 (PDT) Received: from e113632-lin (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6DD873F73B; Tue, 18 May 2021 06:12:16 -0700 (PDT) From: Valentin Schneider To: Ionela Voinescu , Sudeep Holla , "Rafael J . Wysocki" , Thomas Gleixner , Ingo Molnar , Giovanni Gherdovich , Catalin Marinas , Will Deacon Cc: linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 2/3] arch_topology: obtain cpu capacity using information from CPPC In-Reply-To: <20210514095339.12979-3-ionela.voinescu@arm.com> References: <20210514095339.12979-1-ionela.voinescu@arm.com> <20210514095339.12979-3-ionela.voinescu@arm.com> Date: Tue, 18 May 2021 14:12:14 +0100 Message-ID: <87eee41901.mognet@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210518_061219_154740_B47CF7CD X-CRM114-Status: UNSURE ( 9.23 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 14/05/21 10:53, Ionela Voinescu wrote: > +#ifdef CONFIG_ACPI_CPPC_LIB > +#include > + > +void init_cpu_capacity_cppc(void) > +{ > + struct cppc_perf_caps perf_caps; > + int cpu; > + > + if (likely(acpi_disabled || !acpi_cpc_valid())) > + return; > + > + raw_capacity = kcalloc(num_possible_cpus(), sizeof(*raw_capacity), > + GFP_KERNEL); Per the below loop, the memory shouldn't need to be cleared. > + if (!raw_capacity) > + return; > + > + for_each_possible_cpu(cpu) { > + if (!cppc_get_perf_caps(cpu, &perf_caps)) { > + raw_capacity[cpu] = perf_caps.highest_perf; > + pr_debug("%s: CPU%d cpu_capacity=%u (raw).\n", > + __func__, cpu, raw_capacity[cpu]); > + } else { > + pr_err("%s: CPU%d missing highest performance.\n", > + __func__, cpu); > + pr_err("%s: fallback to 1024 for all CPUs\n", > + __func__); > + goto exit; > + } > + } > + > + topology_normalize_cpu_scale(); > + schedule_work(&update_topology_flags_work); > + pr_debug("%s: cpu_capacity initialization done\n", __func__); > + > +exit: > + free_raw_capacity(); > +} > +#endif _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel