Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2397882pxb; Sun, 24 Jan 2021 05:43:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJx9WlGxuUrmGK1k1Tba8pTFnvb/6PFtAVsbJt6GaEQvrA0k2lAscXnins5Ecqblug0LH0Wu X-Received: by 2002:a05:6402:1e5:: with SMTP id i5mr10554947edy.86.1611495781825; Sun, 24 Jan 2021 05:43:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611495781; cv=none; d=google.com; s=arc-20160816; b=AED16TWg44z8zS1fB2pX5gpdGgICJzegUzxTmT39UzjgZIOiIiId+W5u7mIPZhe07h ttFDyZ9mPUSrxghNaKwP54qz2oPKTTmPLIwACMt7F8rkgCeSmR5MpGi5roRXTQP3R2QH dhiS1KOnxzsMz0GFnGzwlGKloSoIV5SclDYcIQyiBOixwUMNXTaaJtrx5DGl32ujAI8I UdP+UxygJkErNaKA2YfjAnZjx7uZCOFgMAgZeMmLNVIXlnUJGOEWOQkqZGEqNU2EWnRY aALkMw7gJolJtY8onHBQt2O+1ujB+3plcUFPnXR/HYO4YgW71MKF1oUx3WM8xt+gHjDw F/ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dkim-signature; bh=7re69Ipjr6FlfyGJBeJVrSIxh87fM610EEl8O5Fykhs=; b=jL1noUX/43ZzdbsZ5cEo+t9fYdEBs8vQsG0qpnpeXKGSpwwWQszkfz72fjDX7dEd9A N4t5QJKEC6boK3HmCUcqWhlyXMMIKWEuhhXoV3jnP5W9M4/ak9u2jwzRMo7avQm9g0cH GbMfGJQ3pjeIKq/QYWRVD4Z7/REnB1aCOoSiiYFioRn55n17XY/CaG0UrxX//wLsmRcf GV62/t6D75LeFhm/bX3wdeQgQN8Typ8ro6sKHvfJBjabSsYxMGCSAcyjFoEL9RTffx2J /6nh8IrK3Ldt+2b8ayCetaE+tACB2Dt1OLuucxIH0pbw44UcB7Zr0OpJd3vWYhVS0Ze/ G2iA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=SChrum71; 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=pass (p=NONE sp=NONE dis=NONE) header.from=gmx.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t20si5993715edv.290.2021.01.24.05.42.38; Sun, 24 Jan 2021 05:43:01 -0800 (PST) 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; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=SChrum71; 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=pass (p=NONE sp=NONE dis=NONE) header.from=gmx.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725968AbhAXNmK (ORCPT + 99 others); Sun, 24 Jan 2021 08:42:10 -0500 Received: from mout.gmx.net ([212.227.17.21]:39869 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725268AbhAXNmH (ORCPT ); Sun, 24 Jan 2021 08:42:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1611495617; bh=7wAgiPv/ohlfCwMg9tisuTy2ke21tmeR7vAqXMCF//k=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=SChrum711pKVBIjmSlABNs+x2hOuQJFGu990dPVjstBuVa3XJhnZgdXnFJJwOJsKR 48xVIWtv1ypWU1OBVXDCPMcKBXxtZplzkjN+b4QaZOPIZ/1oL5o+krXFmxaQ9k3Xeu ewIYOY1aBDHuH1Y9/wfX43rujVJE4Ibn9ISsDr+E= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from strobe-jhalfs ([178.6.215.244]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MrhQC-1lp3bx2ZLY-00nimQ; Sun, 24 Jan 2021 14:40:17 +0100 From: Stephen Berman To: "Rafael J. Wysocki" Cc: "Rafael J. Wysocki" , Linux ACPI , LKML , Zhang Rui , Linux PM , Sebastian Andrzej Siewior Subject: Re: [PATCH] ACPI: thermal: Do not call acpi_thermal_check() directly References: <3391226.KRKnzuvfpg@kreacher> <87tur9vscw.fsf@rub.de> Date: Sun, 24 Jan 2021 14:40:15 +0100 In-Reply-To: (Rafael J. Wysocki's message of "Fri, 22 Jan 2021 17:42:59 +0100") Message-ID: <87y2gi78sg.fsf@gmx.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:buJeilmTKkwZrrO4ttbUapuQh6eQwztsRUMLtUVAxpJ7r+EanX0 1ie17qHLsRcTkwBCrP13Eh6MOH1zr3/Uguc1MpV3S6hICB7bc6/4N5G/3qFYACstrDJM4ak nQguyIggxCv3X5OyZbDM1SdgbcORYjRLQnLb1fGPjVlilR/otie3ILtrYM/TDbOXxIpiZfZ 214V32hsDkjFqiiQZltOw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:TE7LdZBVTR8=:W4v244fL6cpGzG85dTMdb4 st5RoCG0bXU+eovNx0TvvZX9s6F3sqrTReeqh//bwz0MVf7MyqPKMyknW4c4agFRZVzEvqux/ dP8tFfBCFaVwFppRRxlH28Euqkj1BBRU4BHSs7J2aY8YcBm/FQDauQDvPFoh/G40LwctyHK/1 KsX/ndF0MenmY0EDolzH2UIwSuFfCCx7ERiUCl02rk2R2YTh/TVRNTah7RC5TBtNOhU3K3atP KLZXlVsSKc+nPeG9jyAsjZFuiMpixz6ncsv3etY2csflm6jJY0Ux7XYOWlFmvEb4XfxoSHpKu ygvKRnu2msIKZtC8yUPkCtQVCze3WTokN8QWVGjWzMI0I+UU5QasN7kCk7l/xETzFaRqwQyPC vKdVuZeB9NemYlXYVHPn15s+9+aprFW6K5aVCdUA06tyug4WtNv7F26+nrkFehZjw4eATUqVd giKD3YlThrU8uxADkg/1lZs71Co49zfk3BET7mLnXTCSuwg75oQV7DkswWLn5PxzHP9e7ozca w4hUxEuKCIc00qHhpUofa4xr44mqjUQ1friZbF2lQJGOiyqY8HfOkp6V0iTpiX828GYmVQe+i XNHuxyuaoL3hDrTH/YERlNYc0wUUsXNB5HfqKtJ7C6L5+XlFNaMfkUb8J5W4zNe/a8nVB3Nz8 dE2h9CaBFdhbBmZ7hkFjIVXSHPapo5jcJEkcnrGSisbKOKAItsRHMqU0eCyVZe2eK9ne1DcZU h9Lux2CnPyNod/fbTwUWJPpy94a2oqwcbR9BcfJlOUlh0wsL5x4RS1q6jNHkyBm/1hhpwAIGt BKmay67h2LkGU55CuDc/ZuFCNH3MFftqKWtNTgNpCZMSQd3B8a2Km+y4yCNv8Pc6gaodfzh4o nZqyyAvAgO2XaadH/qWg== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 22 Jan 2021 17:42:59 +0100 "Rafael J. Wysocki" wrote: > On Fri, Jan 22, 2021 at 5:39 PM Stephen Berman wrote: >> >> On Fri, 22 Jan 2021 17:23:36 +0100 "Rafael J. Wysocki" wrote: >> >> > On Thu, Jan 14, 2021 at 7:35 PM Rafael J. Wysocki wrote: >> >> >> >> From: Rafael J. Wysocki >> >> >> >> Calling acpi_thermal_check() from acpi_thermal_notify() directly >> >> is problematic if _TMP triggers Notify () on the thermal zone for >> >> which it has been evaluated (which happens on some systems), because >> >> it causes a new acpi_thermal_notify() invocation to be queued up >> >> every time and if that takes place too often, an indefinite number of >> >> pending work items may accumulate in kacpi_notify_wq over time. >> >> >> >> Besides, it is not really useful to queue up a new invocation of >> >> acpi_thermal_check() if one of them is pending already. >> >> >> >> For these reasons, rework acpi_thermal_notify() to queue up a thermal >> >> check instead of calling acpi_thermal_check() directly and only allow >> >> one thermal check to be pending at a time. Moreover, only allow one >> >> acpi_thermal_check_fn() instance at a time to run >> >> thermal_zone_device_update() for one thermal zone and make it return >> >> early if it sees other instances running for the same thermal zone. >> >> >> >> While at it, fold acpi_thermal_check() into acpi_thermal_check_fn(), >> >> as it is only called from there after the other changes made here. >> >> >> >> BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=208877 >> >> Reported-by: Stephen Berman >> >> Diagnosed-by: Sebastian Andrzej Siewior >> >> Signed-off-by: Rafael J. Wysocki >> > >> > Well, it's been over a week since this was posted. >> > >> > Does anyone have any comments? >> >> Sorry, I haven't been able to make time to test the patch yet, but I'll >> try to do so this weekend. Is it just the patch below that I should >> apply, ignoring the previous patches you sent? > > Yes. > >> And can I apply it to the current mainline kernel? > > Yes, it should be applicable to the current mainline (at least as of 5.11-rc4). > > Thanks! I've now updated my local repo to 5.11.0-rc4+, installed your patch, rebuilt and installed the kernel, rebooted (without adding 'thermal.tzp=300' to the kernel command line), did some normal activity, then ran 'shutdown -h now', and the machine did just that. So your patch seems to have fixed the problem I reported. Many thanks! Steve Berman