From patchwork Wed May 8 03:43:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Neri X-Patchwork-Id: 796008 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) (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 124D31A2C12; Wed, 8 May 2024 03:37:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715139422; cv=none; b=DQvoyUkeAjcvCc40IspHx5OxTsppMpZM2aX6ySZRxYbbcJ1jHq1bydYeD94qK2Bw1grjq19QaUiWIzc5g4zHe3L1k+iwgOkDjQF+LnHO2UZtLRNBR2xlSDbh3RKppNnlQSYKttQ+vF5Uw7fdjeS9/Xey4DCFjdFw7+eFIUbvLKo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715139422; c=relaxed/simple; bh=kR97mbQ0Rry62elnu9tL23JQRgk/0e+OWskQwenqFE0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=UVAOSJ8wyf7YjMwbu9/xLg2kCFxawTWL+mofK9CJJAMAQh9DuvZ53SyrplMAUSiyDv3G6Z39pBJt/tc2hC6xNy0Q0OGmu7lk+6gL0wuzDWj5XZ/SsM16+RqrLRpVdSMw4Wgxa+5pCg+zpsIQEUZ1SjhXu+C0+nNfJuIPCwOYDYw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=ekxUbIjD; arc=none smtp.client-ip=192.198.163.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ekxUbIjD" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1715139421; x=1746675421; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=kR97mbQ0Rry62elnu9tL23JQRgk/0e+OWskQwenqFE0=; b=ekxUbIjDqebK5mQi5mQUZxcVWBryOtgnVe7Eba5+fTb6GGK8RG/JSkCN ozWG5wLJ2D80P73eISCZNWTal5Pv8xiomlEtGbvizwuKecaaHcwwDjTtu YzTWoBVuoiGGT4FTS5s+gcQU5QHnX6jpzwFaAA8+Kyc2z0lZzAVaN/X9K nw9ZLFVeA/GwJ9FGM1pOzCha4YXRkq9QwRqFPWUiRmjWTArH59okGQHmD dcl/HDzspttDHisAbb1DR9wFzp4T+rqbgMUqte1Fe9T7B6mdb/l6Mq6IJ pql1dLvjPMb4YIssL16ybBkJKcPUd/q8MHMdQvzdd5xKo0ZgYrc6dLp82 A==; X-CSE-ConnectionGUID: 8YH2gV0LSNSlbCSCmhWdQg== X-CSE-MsgGUID: Ozsttdn8TCahAvDjIZkS1g== X-IronPort-AV: E=McAfee;i="6600,9927,11066"; a="10820907" X-IronPort-AV: E=Sophos;i="6.08,144,1712646000"; d="scan'208";a="10820907" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 May 2024 20:36:54 -0700 X-CSE-ConnectionGUID: sPr03TCfQ/mzWXbDwBqnoQ== X-CSE-MsgGUID: GsF2qpQeT8aoHHIVck2jwg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,144,1712646000"; d="scan'208";a="33551924" Received: from ranerica-svr.sc.intel.com ([172.25.110.23]) by orviesa005.jf.intel.com with ESMTP; 07 May 2024 20:36:52 -0700 From: Ricardo Neri To: "Rafael J. Wysocki" Cc: Zhang Rui , Srinivas Pandruvada , Len Brown , Stanislaw Gruszka , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Ricardo Neri Subject: [PATCH v2 1/4] thermal: intel: hfi: Rename HFI_UPDATE_INTERVAL Date: Tue, 7 May 2024 20:43:49 -0700 Message-Id: <20240508034352.18414-2-ricardo.neri-calderon@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240508034352.18414-1-ricardo.neri-calderon@linux.intel.com> References: <20240508034352.18414-1-ricardo.neri-calderon@linux.intel.com> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: The name of the constant HFI_UPDATE_INTERVAL is misleading. It is not a periodic interval at which HFI updates are processed. It is the delay in the processing of an HFI update after the arrival of an HFI interrupt. Acked-by: Zhang Rui Signed-off-by: Ricardo Neri --- Cc: Len Brown Cc: Srinivas Pandruvada Cc: Stanislaw Gruszka Cc: Zhang Rui Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- Changes since v1: * None --- drivers/thermal/intel/intel_hfi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/intel/intel_hfi.c b/drivers/thermal/intel/intel_hfi.c index fbc7f0cd83d7..e2b82d71ab6b 100644 --- a/drivers/thermal/intel/intel_hfi.c +++ b/drivers/thermal/intel/intel_hfi.c @@ -166,7 +166,7 @@ static struct hfi_features hfi_features; static DEFINE_MUTEX(hfi_instance_lock); static struct workqueue_struct *hfi_updates_wq; -#define HFI_UPDATE_INTERVAL HZ +#define HFI_UPDATE_DELAY HZ #define HFI_MAX_THERM_NOTIFY_COUNT 16 static void get_hfi_caps(struct hfi_instance *hfi_instance, @@ -322,7 +322,7 @@ void intel_hfi_process_event(__u64 pkg_therm_status_msr_val) raw_spin_unlock(&hfi_instance->event_lock); queue_delayed_work(hfi_updates_wq, &hfi_instance->update_work, - HFI_UPDATE_INTERVAL); + HFI_UPDATE_DELAY); } static void init_hfi_cpu_index(struct hfi_cpu_info *info) From patchwork Wed May 8 03:43:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Neri X-Patchwork-Id: 796007 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) (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 D2C461427B; Wed, 8 May 2024 03:37:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715139425; cv=none; b=Ffj5GwWJBYr8aJ6QuwzkahKQYZy5THcqN1dMAbSDWH9hJZ2LWClSnV7kX0mBDGVKz2pTt19e0DKpFeHmRlqEAPXqfmjIs+2bnmpOjdiQ7W/YZQlMPmHLVSWMDBreRiI0S5Si1VAgWUEI0Wm7ZF2tdsspgPgXeCSDkHREsOtc9+A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715139425; c=relaxed/simple; bh=4EtO7Ihxo5VDSVZMZHwbrvD7dG2Ao6rUGaoUS1eTOZQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=t4jn4iKRZ/M0oIaaQMe+6EZB5C/ViKdTA8bc+ZEAOaekk3+OLFC7cB60E4QrSwCSOLtYijCLFDmKOMmw1Lf/H3DLtZkrcpvA191di5CHOewegGADOG6ST3IPozLuCD3CBmbSTURl72FTHdJzErUrbX0OdX8KvsW879Zr05gZwA0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=MuDWTmBH; arc=none smtp.client-ip=192.198.163.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="MuDWTmBH" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1715139423; x=1746675423; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=4EtO7Ihxo5VDSVZMZHwbrvD7dG2Ao6rUGaoUS1eTOZQ=; b=MuDWTmBHvTsWhbrxOEr96olWQjMkMNZE5s/xYt2ckswYhjfqk3NkMj3X P+oM9UyacdOdR/mtUXS/FYBXN/abFCSdpir1n+R35IjKiEgE9k9fn48Ub dQFjBTULSRtJ5U5Prf4IXNzofp5oJJbUlCR60IWZcZQpYGgJ7Jx/xn7Va l3x7vPM2t/Ur0ri1QGRS16F1u2AX3IH1fvymvHXRatjrp57b/PrJemHmx 29TfQaMaOaeuPUHQY/ye9NReJnsVC/uGP+/P5bO5/m7DbWCbPxwmTQKkb h5k8Thf7U4V1fLK8fTjxkDkZ6xn5ThY94K1xRdfUV1uDsjchlIR0oyOnE Q==; X-CSE-ConnectionGUID: Uoj6XVXxTRObfBrEF1RRqA== X-CSE-MsgGUID: LlhtH1cARlS+ek2T2xA0KA== X-IronPort-AV: E=McAfee;i="6600,9927,11066"; a="10820909" X-IronPort-AV: E=Sophos;i="6.08,144,1712646000"; d="scan'208";a="10820909" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 May 2024 20:36:54 -0700 X-CSE-ConnectionGUID: OquyvCiyTdmGzQr/C/CbLg== X-CSE-MsgGUID: 5s7cCh53TsC+p/h9jzDOtw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,144,1712646000"; d="scan'208";a="33551927" Received: from ranerica-svr.sc.intel.com ([172.25.110.23]) by orviesa005.jf.intel.com with ESMTP; 07 May 2024 20:36:53 -0700 From: Ricardo Neri To: "Rafael J. Wysocki" Cc: Zhang Rui , Srinivas Pandruvada , Len Brown , Stanislaw Gruszka , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Ricardo Neri Subject: [PATCH v2 2/4] thermal: intel: hfi: Shorten the thermal netlink event delay to 100ms Date: Tue, 7 May 2024 20:43:50 -0700 Message-Id: <20240508034352.18414-3-ricardo.neri-calderon@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240508034352.18414-1-ricardo.neri-calderon@linux.intel.com> References: <20240508034352.18414-1-ricardo.neri-calderon@linux.intel.com> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: The delay between an HFI interrupt and its corresponding thermal netlink event has so far been hard-coded to CONFIG_HZ jiffies (1 second). This delay is too long for hardware that generates updates every tens of milliseconds. The HFI driver uses a delayed workqueue to send thermal netlink events. No subsequent events will be sent if there is pending work. As a result, much of the information of consecutive hardware updates will be lost if the workqueue delay is too long. User space entities may act on obsolete data. If the delay is too short, multiple events may overwhelm listeners. Set the delay to 100ms to strike a balance between too many and too few events. Use milliseconds instead of jiffies to improve readability. Signed-off-by: Ricardo Neri --- Cc: Len Brown Cc: Srinivas Pandruvada Cc: Stanislaw Gruszka Cc: Zhang Rui Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- Changes since v1: * Dropped the debugfs interface. Instead, updated the delay from 1s to 100ms. --- drivers/thermal/intel/intel_hfi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/intel/intel_hfi.c b/drivers/thermal/intel/intel_hfi.c index e2b82d71ab6b..d82b8788b0f8 100644 --- a/drivers/thermal/intel/intel_hfi.c +++ b/drivers/thermal/intel/intel_hfi.c @@ -166,7 +166,7 @@ static struct hfi_features hfi_features; static DEFINE_MUTEX(hfi_instance_lock); static struct workqueue_struct *hfi_updates_wq; -#define HFI_UPDATE_DELAY HZ +#define HFI_UPDATE_DELAY_MS 100 #define HFI_MAX_THERM_NOTIFY_COUNT 16 static void get_hfi_caps(struct hfi_instance *hfi_instance, @@ -322,7 +322,7 @@ void intel_hfi_process_event(__u64 pkg_therm_status_msr_val) raw_spin_unlock(&hfi_instance->event_lock); queue_delayed_work(hfi_updates_wq, &hfi_instance->update_work, - HFI_UPDATE_DELAY); + msecs_to_jiffies(HFI_UPDATE_DELAY_MS)); } static void init_hfi_cpu_index(struct hfi_cpu_info *info) From patchwork Wed May 8 03:43:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Neri X-Patchwork-Id: 796006 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) (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 49371171A2; Wed, 8 May 2024 03:37:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715139426; cv=none; b=ElKtybpoMkxXBgc2qUjlKgxaIbbJss5qFJS7E5tMUyg5zSfNVI0zwqIaBu9iymor7m0k++ik1LnDWVzWnSHll5bhSLLYAPF8I7z5c1ioLWX04ihQ6Yu3uzSAg4caAuLVVBMtftNRflu9FUH6icSrakLEhFs4hhVm/Hmct3ypKtM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715139426; c=relaxed/simple; bh=VX4j3o8PuAumvX98LolK5x0BnWOyxYhPrqsi65acJqo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=H7QvClJp8UNtN9vRWX0Jkl8cWXZUAoklY5vEf7YZvkbqqi8A/D9o3rrYKoGzr6rL/7jd9R3In30qweLzcgXSh0dB4I6bjY69TE+vcZdqg9rn22OyaNbOFkIe1gtghY40lwitE3NC5YphznfDKa956cV7x64ZqtvkgyK13vXvHKo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=PWP4irtH; arc=none smtp.client-ip=192.198.163.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="PWP4irtH" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1715139425; x=1746675425; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=VX4j3o8PuAumvX98LolK5x0BnWOyxYhPrqsi65acJqo=; b=PWP4irtHuQ108ZNBr7YuB4alK36lD8S9r+ieInP4BDA3WyOn8508usPG frfX8bA9ZekPjNQE0EwdmBtgW4YaS1MvnffTNG8JHDxVF3wOVYkGI9dZ2 07ZJIUgu7kD9oNZF2h4+eyHAUT3XfqdAxTLzfVZIviF0lL7sMHTluEaou 6oOdEFXVLsAqbyznPEu0h84CW2KLC0o+NjOwaGzDzojwAzGLGFIWRjmBX ESfnS5BfdfelUjiS5gRH/owDCG9PcPXN7KsBKLXn7HcfbmtJccf3gxVCP JitxFgm1k+72dlyViBeVInkJZuyU5cgsSNiymIy3pGcJJoQZEMG0WJsPa A==; X-CSE-ConnectionGUID: ZNtiUPYrS6unZkD3KADRkg== X-CSE-MsgGUID: Iq+ZyGcDSEegd77kbALTaQ== X-IronPort-AV: E=McAfee;i="6600,9927,11066"; a="10820910" X-IronPort-AV: E=Sophos;i="6.08,144,1712646000"; d="scan'208";a="10820910" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 May 2024 20:36:54 -0700 X-CSE-ConnectionGUID: YyQ012U5RCqIHJrpvyf/sQ== X-CSE-MsgGUID: 98kccrMhRkq07nRyGxlmfA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,144,1712646000"; d="scan'208";a="33551931" Received: from ranerica-svr.sc.intel.com ([172.25.110.23]) by orviesa005.jf.intel.com with ESMTP; 07 May 2024 20:36:53 -0700 From: Ricardo Neri To: "Rafael J. Wysocki" Cc: Zhang Rui , Srinivas Pandruvada , Len Brown , Stanislaw Gruszka , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Ricardo Neri Subject: [PATCH v2 3/4] thermal: intel: hfi: Rename HFI_MAX_THERM_NOTIFY_COUNT Date: Tue, 7 May 2024 20:43:51 -0700 Message-Id: <20240508034352.18414-4-ricardo.neri-calderon@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240508034352.18414-1-ricardo.neri-calderon@linux.intel.com> References: <20240508034352.18414-1-ricardo.neri-calderon@linux.intel.com> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: When processing a hardware update, HFI generates as many thermal netlink events as needed to relay all the updated CPU capabilities to user space. The constant HFI_MAX_THERM_NOTIFY_COUNT is the number of CPU capabilities updated per each of those events. Give this constant a more descriptive name. Signed-off-by: Ricardo Neri --- Cc: Len Brown Cc: Srinivas Pandruvada Cc: Stanislaw Gruszka Cc: Zhang Rui Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- Changes since v1: * None --- drivers/thermal/intel/intel_hfi.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/thermal/intel/intel_hfi.c b/drivers/thermal/intel/intel_hfi.c index d82b8788b0f8..c6658f8c5cca 100644 --- a/drivers/thermal/intel/intel_hfi.c +++ b/drivers/thermal/intel/intel_hfi.c @@ -167,7 +167,7 @@ static DEFINE_MUTEX(hfi_instance_lock); static struct workqueue_struct *hfi_updates_wq; #define HFI_UPDATE_DELAY_MS 100 -#define HFI_MAX_THERM_NOTIFY_COUNT 16 +#define HFI_THERMNL_CAPS_PER_EVENT 16 static void get_hfi_caps(struct hfi_instance *hfi_instance, struct thermal_genl_cpu_caps *cpu_caps) @@ -218,14 +218,14 @@ static void update_capabilities(struct hfi_instance *hfi_instance) get_hfi_caps(hfi_instance, cpu_caps); - if (cpu_count < HFI_MAX_THERM_NOTIFY_COUNT) + if (cpu_count < HFI_THERMNL_CAPS_PER_EVENT) goto last_cmd; - /* Process complete chunks of HFI_MAX_THERM_NOTIFY_COUNT capabilities. */ + /* Process complete chunks of HFI_THERMNL_CAPS_PER_EVENT capabilities. */ for (i = 0; - (i + HFI_MAX_THERM_NOTIFY_COUNT) <= cpu_count; - i += HFI_MAX_THERM_NOTIFY_COUNT) - thermal_genl_cpu_capability_event(HFI_MAX_THERM_NOTIFY_COUNT, + (i + HFI_THERMNL_CAPS_PER_EVENT) <= cpu_count; + i += HFI_THERMNL_CAPS_PER_EVENT) + thermal_genl_cpu_capability_event(HFI_THERMNL_CAPS_PER_EVENT, &cpu_caps[i]); cpu_count = cpu_count - i; From patchwork Wed May 8 03:43:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Neri X-Patchwork-Id: 795651 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) (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 4FE0414A9F; Wed, 8 May 2024 03:37:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715139424; cv=none; b=kzz36w2WIMV1YD5WBuWwDGegfGRXFMDkZzZ5w4WByoS63kb8mFX+9Lv/EcVntO+SG7dCm4ooXf9MW3NVG83cQcyhCSjcbw3pzweYyo9u7IOuXFSefuSVg1mk4+zeGHwJd9cC9CrR+anyQex7Nj8nBRtcOb41Eh2upp8w2hFxqxU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715139424; c=relaxed/simple; bh=K+HG7L12mRkwMo3ylUVsmFfW2pNh/hN2w+jXyyLa2fE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=qQAIbkslFMsw1QzGBpKw0baDhxS3pWsirA3QZjbdAg2vqB/5S1Ey72UHqMLjl7f9KnkcHBJIac6vg1CJmLwARisr6RlmlY9EnSSoS+H8U9fktnR1vt6+gQtk0x6MlopFMB5KnNRH9bdSOKf1Cl0EuZGyyseKtFQ7L22dohYceIE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=fde7jpnD; arc=none smtp.client-ip=192.198.163.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="fde7jpnD" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1715139423; x=1746675423; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=K+HG7L12mRkwMo3ylUVsmFfW2pNh/hN2w+jXyyLa2fE=; b=fde7jpnDp4N09pNphklmarcMSCAKieauw0waH99wgd979x7uv5eh/vbC QbAg/gCZjpTGmX19g+vDGxDwFV0Ur+1h1FM4E9ph8WBghiX8uZA0xQrjz gn/LZPTNsf6c/ddWwxOG3BQmZlu7QsQR/qtZWvDoU4D2g8S/57HvnnVBk bntPt5u4ZG7VIljT4GTI9IN71J1wL3BgvrBgtHtph3xk9WcGrOskDav6F DttqEE7180FmyUh4R5gJj2cW5s81oRLLxjclkL+BB+aKEjywzp/O3PMto 0HSJ0tmrigmBZ/YJLW03VqqFRMewxsjtB0j+cGPzm2+xHxw+w8zCZzSK2 Q==; X-CSE-ConnectionGUID: p76twJoiR9el0vK9PW66kg== X-CSE-MsgGUID: 5isWQIReQlOFtBA+hYYelQ== X-IronPort-AV: E=McAfee;i="6600,9927,11066"; a="10820911" X-IronPort-AV: E=Sophos;i="6.08,144,1712646000"; d="scan'208";a="10820911" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 May 2024 20:36:55 -0700 X-CSE-ConnectionGUID: K6MZavhyS/Wv84QMfOZ7uw== X-CSE-MsgGUID: 5qRDoizsQuKXKBRfgiCGeQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,144,1712646000"; d="scan'208";a="33551935" Received: from ranerica-svr.sc.intel.com ([172.25.110.23]) by orviesa005.jf.intel.com with ESMTP; 07 May 2024 20:36:53 -0700 From: Ricardo Neri To: "Rafael J. Wysocki" Cc: Zhang Rui , Srinivas Pandruvada , Len Brown , Stanislaw Gruszka , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Ricardo Neri Subject: [PATCH v2 4/4] thermal: intel: hfi: Increase the number of CPU capabilities per netlink event Date: Tue, 7 May 2024 20:43:52 -0700 Message-Id: <20240508034352.18414-5-ricardo.neri-calderon@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240508034352.18414-1-ricardo.neri-calderon@linux.intel.com> References: <20240508034352.18414-1-ricardo.neri-calderon@linux.intel.com> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: The number of updated CPU capabilities per netlink event is hard-coded to 16. On systems with more than 16 CPUs (a common case), it takes more than one thermal netlink event to relay all the new capabilities after an HFI interrupt. This adds unnecessary overhead to both the kernel and user space entities. Increase the number of CPU capabilities updated per event to 64. Any system with 64 CPUs or less can now update all the capabilities in a single thermal netlink event. Signed-off-by: Ricardo Neri --- Cc: Len Brown Cc: Srinivas Pandruvada Cc: Stanislaw Gruszka Cc: Zhang Rui Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- Changes since v2: * Dropped the debugfs interface. Instead, increased the size of the thermal netlink message size to 64 CPU capabilities. --- drivers/thermal/intel/intel_hfi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/thermal/intel/intel_hfi.c b/drivers/thermal/intel/intel_hfi.c index c6658f8c5cca..a180a98bb9f1 100644 --- a/drivers/thermal/intel/intel_hfi.c +++ b/drivers/thermal/intel/intel_hfi.c @@ -167,7 +167,7 @@ static DEFINE_MUTEX(hfi_instance_lock); static struct workqueue_struct *hfi_updates_wq; #define HFI_UPDATE_DELAY_MS 100 -#define HFI_THERMNL_CAPS_PER_EVENT 16 +#define HFI_THERMNL_CAPS_PER_EVENT 64 static void get_hfi_caps(struct hfi_instance *hfi_instance, struct thermal_genl_cpu_caps *cpu_caps)