Received: by 2002:a05:7412:a9a8:b0:f9:92ae:e617 with SMTP id o40csp38102rdh; Wed, 20 Dec 2023 15:17:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IEdCOLeT2DEQRy8ou385Quv70Gqs7CaKj7Lj9JNN3caWgzeiPnYY0imynfHqqsg8aQpyMe+ X-Received: by 2002:a17:906:1083:b0:a26:8e37:71ca with SMTP id u3-20020a170906108300b00a268e3771camr712644eju.72.1703114226830; Wed, 20 Dec 2023 15:17:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703114226; cv=none; d=google.com; s=arc-20160816; b=OBOJSBLI9bxkGq5wqhfdNKUX6h1J5T8u3podEJ1sX938OG504FCThfCrxpuk5zTJPC NpWGgeZEerBVA3AgYHC71pv3ihAp93UV/HQl2TMH/Z76rOi+GGVwoCbSeW6D64qbGBOY uf/X78cvtivz/Dlu4qMQJWyl/kNKsVRZjqAzGPVbXc+eePPiMaCVZ1GAWKxgq/vn3M6i wz0RgheHxpi7xHCYqwEYUvX4zMK7uX6YV/pYmpQ0VkjO43P4IUFU+y1zp7PWIoVAsH9q OEVE+5E434EQgyQWoEY4pCd2UvdUxsctkR+RN3ni+KlgFRYddn95eyUeStDoyq3rnUmC +uWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=Z4E6lC8UvHFDsLwUOsh35t0MsV1lgIrNDe6wKhBxdno=; fh=BLXDRFxX5XTO46cEytehPgkEKhEpfPIIZAXbZsHkuJk=; b=RLf4/spLCKxQWTzxiYuBs3wYWpMkzmRcgh8ukWMyB2482qP83JN0x+eII9t2/m7EYE vZ0/F12mN3UDyeKfR6XhOPHLZruaedRQ6AJFIpen/zeMnoWJ+Gb2hE7jt/4utfXYnOBU JgjcTaSnXTAIZAidaBk58QXN/vgnkXPaetWf6/5I0R4OzLd+rr7dctgfZ5UpFSlCafvc QNu1QKZGgmlCmjghSctX8APifVcdoAEg/RqYwXertUu+s1XipS5pY1SrQKR35whEvj2g rZ6GDveTlOMyfql0/rxy68pMflY1lxYzqR+Dd0nDj9SZc4sdZc0+7/4tdhNFrLmmGUQH J9AQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-7622-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7622-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id vz23-20020a17090704d700b00a2313949d62si251729ejb.255.2023.12.20.15.17.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 15:17:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7622-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-7622-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7622-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 91B201F2349C for ; Wed, 20 Dec 2023 23:17:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3B4B24A9BB; Wed, 20 Dec 2023 23:16:57 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6F05839FE1; Wed, 20 Dec 2023 23:16:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 AFA1D2F4; Wed, 20 Dec 2023 15:17:38 -0800 (PST) Received: from e129166.arm.com (unknown [10.57.82.217]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 7D2853F64C; Wed, 20 Dec 2023 15:16:52 -0800 (PST) From: Lukasz Luba To: linux-kernel@vger.kernel.org, rafael@kernel.org Cc: linux-pm@vger.kernel.org, daniel.lezcano@linaro.org, rui.zhang@intel.com, lukasz.luba@arm.com Subject: [PATCH v3 0/9] Add callback for cooling list update to speed-up IPA Date: Wed, 20 Dec 2023 23:17:44 +0000 Message-Id: <20231220231753.1824364-1-lukasz.luba@arm.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hi all, The patch set adds a new callback for thermal governors and implementation for Intelligent Power Allocator. The goal is to move some heavy operations like the memory allocations and heavy computations (multiplications) out of throttle() callback hot path. The new callback is generic enough to handle other important update events. It re-uses existing thermal_notify_event definitions. In addition there are some small clean-ups for IPA code. The patch set is based on current pm/bleeding-edge branch (20 Dec). changes: v3: - changed helper name to thermal_governor_update_tz() with also "reason" argument (Rafael) - added thermal_governor_update_tz() to thermal_core.h for use from sysfs functions - changed names of the events (THERMAL_TZ_BIND_CDEV) (Rafael) - patch 2/9 changed header and comment for function (Rafael) - patch 3/9: used unsigned types for num_actors, buffer_size (Rafael) - changed trace functions and added new patch 4/9 to be prepare tracing for different internal IPA array; it also drops dynamic array inside trace event - used new structure power_actor and changed the code in patch 5/9 (Rafael) - keept the local num_actors variable (Rafael) - patch 6/9 skipped redundant parens and changed the header desc. (Rafael) - patch 7/9 changed header and used instance->tz->lock (Rafael) - patch 8/9 removed handle_weight_update() and renamed new event to THERMAL_INSTANCE_WEIGHT_CHANGE (Rafael) - patch 9/9 aliged to use THERMAL_INSTANCE_WEIGHT_CHANGE is switch (Rafael) v2 can be found here [1] Regards, Lukasz [1] https://lore.kernel.org/lkml/20231212134844.1213381-1-lukasz.luba@arm.com/ Lukasz Luba (9): thermal: core: Add governor callback for thermal zone change thermal: gov_power_allocator: Refactor check_power_actors() thermal: gov_power_allocator: Refactor checks in divvy_up_power() thermal: gov_power_allocator: Change trace functions thermal: gov_power_allocator: Move memory allocation out of throttle() thermal: gov_power_allocator: Simplify checks for valid power actor thermal/sysfs: Update instance->weight under tz lock thermal/sysfs: Update governors when the 'weight' has changed thermal: gov_power_allocator: Support new update callback of weights drivers/thermal/gov_power_allocator.c | 269 ++++++++++++++++---------- drivers/thermal/thermal_core.c | 14 ++ drivers/thermal/thermal_core.h | 2 + drivers/thermal/thermal_sysfs.c | 7 + drivers/thermal/thermal_trace_ipa.h | 50 +++-- include/linux/thermal.h | 7 + 6 files changed, 226 insertions(+), 123 deletions(-) -- 2.25.1