From: Lukasz Luba <lukasz.luba@arm.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
Linux PM <linux-pm@vger.kernel.org>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
Zhang Rui <rui.zhang@intel.com>,
Linux ACPI <linux-acpi@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v1 0/3] thermal: core: Remove thermal zones during unregistration
Date: Mon, 11 Dec 2023 13:38:16 +0000 [thread overview]
Message-ID: <a317fd5b-85df-409f-96e2-8123eea6ca73@arm.com> (raw)
In-Reply-To: <1880915.tdWV9SEqCh@kreacher>
Hi Rafael,
On 12/8/23 19:11, Rafael J. Wysocki wrote:
> Hi All,
>
> This patch series adds a mechanism to guarantee that
> thermal_zone_device_unregister() will not return until all of the active
> references to the thermal zone device object in question have been dropped
> and it has been deleted (patch [1/3]).
>
> This supersedes the approach used so far in which all thermal zone sysfs
> attribute callbacks check if the zone device is still registered under the
> zone lock, so as to return early if that is not the case, as it means that
> device_del() has been called for the thermal zone in question (and returned).
> It is not necessary to do that any more after patch [1/3], so patch [2/3]
> removes those checks from the code and drops zone locking that is not
> necessary any more either.
>
> Patch [3/3] uses the observation that the thermal subsystem does not need to
> check if a thermal zone device is registered at all, because it can use its
> own data to determine whether or not the thermal zone is going away and so
> it may not be worth updating it, for example.
>
> Please refer to the patch changelogs for details.
>
> The series depends on new thermal material in linux-next, but it should not
> substantially depend on any changes that have not made it into linux-next yet.
>
> Thanks!
>
>
>
I like the concept with completion thing for this.
I have tired to stress test these patches with my mock
thermal zone module load/unload and it works good.
The test was doing the these bits:
for i in $(seq 1 1000000) ; do cat
/sys/class/thermal/thermal_zone2/trip_point_0_temp > /dev/null 2>&1 ; done &
for i in $(seq 1 10000) ; do insmod /data/selftest_ipa.ko ; rmmod
selftest_ipa ; done &
I couldn't trigger any issues in reading from this
trip temp file in background, which should go now w/o the
locking. I thought it would be nice test, since we have
direct call to trips array 'tz->trips[trip_id].temperature'.
Let me know if you think about other scenario for stress testing it.
(I have also checked the 'temp' sysfs read, where the mutex for
tz is used - also no issues).
Feel free to add to all patches:
Reviewed-and-tested-by: Lukasz Luba <lukasz.luba@arm.com>
Regards,
Lukasz
next prev parent reply other threads:[~2023-12-11 13:37 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-08 19:11 [PATCH v1 0/3] thermal: core: Remove thermal zones during unregistration Rafael J. Wysocki
2023-12-08 19:13 ` [PATCH v1 1/3] thermal: core: Make thermal_zone_device_unregister() return after freeing the zone Rafael J. Wysocki
2023-12-11 16:28 ` Daniel Lezcano
2023-12-11 16:42 ` Rafael J. Wysocki
2023-12-11 17:34 ` Daniel Lezcano
2023-12-11 17:54 ` Rafael J. Wysocki
2023-12-08 19:19 ` [PATCH v1 2/3] thermal: Drop redundant and confusing device_is_registered() checks Rafael J. Wysocki
2023-12-11 17:39 ` Daniel Lezcano
2023-12-11 17:58 ` Rafael J. Wysocki
2023-12-12 10:27 ` Daniel Lezcano
2023-12-08 19:20 ` [PATCH v1 3/3] thermal: core: Rework thermal zone availability check Rafael J. Wysocki
2023-12-12 10:28 ` Daniel Lezcano
2023-12-11 13:38 ` Lukasz Luba [this message]
2023-12-11 13:44 ` [PATCH v1 0/3] thermal: core: Remove thermal zones during unregistration Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a317fd5b-85df-409f-96e2-8123eea6ca73@arm.com \
--to=lukasz.luba@arm.com \
--cc=daniel.lezcano@linaro.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=rui.zhang@intel.com \
--cc=srinivas.pandruvada@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox