linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mirsad Goran Todorovac <mirsad.todorovac@alu.unizg.hr>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: "linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	devel@acpica.org
Subject: Re: BUG: bisected: thermald regression (MEMLEAK) in commit c7ff29763989bd09c433f73fae3c1e1c15d9cda4
Date: Tue, 15 Nov 2022 19:57:13 +0100	[thread overview]
Message-ID: <c10bc878-1830-eb4f-1cc8-19e5ac15417c@alu.unizg.hr> (raw)
In-Reply-To: <CAJZ5v0j3_nX2eUvG5naoTVCayfUUqOoNB0NMQQhCQDcv5P8DWw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3422 bytes --]

On 15.11.2022. 15:49, Rafael J. Wysocki wrote:
> On Tue, Nov 15, 2022 at 3:40 PM Mirsad Goran Todorovac
> <mirsad.todorovac@alu.unizg.hr> wrote:
>>
>> On 28.10.2022. 20:25, Rafael J. Wysocki wrote:
>>> On Thu, Oct 27, 2022 at 8:20 PM Mirsad Goran Todorovac
>>> <mirsad.todorovac@alu.unizg.hr> wrote:
>>>>
>>>> Re-sending compressed attachments to fit into the size limit.
>>>>
>>>> On 27. 10. 2022. 20:03, Mirsad Goran Todorovac wrote:
>>>>> P.S.
>>>>>
>>>>> Forgot another useful thing you've mentioned: please find attached the
>>>>> dmesg output.
>>>>>
>>>>> Good luck!
>>>
>>> I'm wondering if the problem is reproducible with this patch applied:
>>>
>>> https://patchwork.kernel.org/project/linux-acpi/patch/20221019073443.248215-1-chenzhongjin@huawei.com/
>>
>> Dear Rafael,
>>
>> Thousand apologies. Your email was still bold in my Thunderbird, which
>> means that I failed to notice it and open it.
>>
>> The patch applied successfully to commit c7ff29763989 and it is
>> currently building and still has to undergo torture tests.
> 
> Actually, that fix was problematic too.
> 
> I would recommend testing with this one applied instead:
> 
> https://patchwork.kernel.org/project/linux-acpi/patch/2669303.mvXUDI8C0e@kreacher/

Hi Rafael,

I have applied this patch, as it is evident from the git diff command:

mtodorov@domac:~/linux/kernel/linux_stable_build$ git diff 
c7ff29763989bd09c433f73fae3c1e1c15d9cda4
diff --git a/drivers/acpi/acpica/dsmethod.c b/drivers/acpi/acpica/dsmethod.c
index 8e011e59b9b4..ee1832ba39a2 100644
--- a/drivers/acpi/acpica/dsmethod.c
+++ b/drivers/acpi/acpica/dsmethod.c
@@ -517,7 +517,7 @@ acpi_ds_call_control_method(struct acpi_thread_state 
*thread,
         info = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_evaluate_info));
         if (!info) {
                 status = AE_NO_MEMORY;
-               goto cleanup;
+               goto pop_walk_state;
         }

         info->parameters = &this_walk_state->operands[0];
@@ -529,7 +529,7 @@ acpi_ds_call_control_method(struct acpi_thread_state 
*thread,

         ACPI_FREE(info);
         if (ACPI_FAILURE(status)) {
-               goto cleanup;
+               goto pop_walk_state;
         }

         next_walk_state->method_nesting_depth =
@@ -575,6 +575,12 @@ acpi_ds_call_control_method(struct 
acpi_thread_state *thread,

         return_ACPI_STATUS(status);

+pop_walk_state:
+
+       /* On error, pop the walk state to be deleted from thread */
+
+       acpi_ds_pop_walk_state(thread);
+
  cleanup:

         /* On error, we must terminate the method properly */

However, after a couple of hundred executions of:

   for a in {0..2000}; do
	echo $a
	systemctl stop thermald
	sleep 1
	systemctl start thermald
	sleep 1
   done

it first starts with a single leak, until the number of restarts is
greater than 500. Currently the number of unreferenced objects is 93.

Please find the log and config attached.

The script that reproduced the bug was also run simultaneously:

for a in {0..2000}; do echo -n $a': '; \
	grep thermald /sys/kernel/debug/kmemleak | wc -l; \
	cat /sys/kernel/debug/kmemleak > /dev/null; \
	tail -40 /sys/kernel/debug/kmemleak > /dev/null; \
done


-- 
Mirsad Todorovac
System engineer
Faculty of Graphic Arts | Academy of Fine Arts
University of Zagreb
Republic of Croatia, the European Union
--
Sistem inženjer
Grafički fakultet | Akademija likovnih umjetnosti
Sveučilište u Zagrebu

[-- Attachment #2: thermald-kmemleak-20221115.log.gz --]
[-- Type: application/gzip, Size: 2943 bytes --]

[-- Attachment #3: thermald-leak-fix-wysocki.config.gz --]
[-- Type: application/gzip, Size: 63795 bytes --]

      reply	other threads:[~2022-11-15 18:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <e0f06714-5a49-a4e6-24e6-c4103c820819@alu.unizg.hr>
2022-10-24 15:51 ` BUG: bisected: thermald regression (MEMLEAK) in commit c7ff29763989bd09c433f73fae3c1e1c15d9cda4 srinivas pandruvada
2022-10-24 18:34   ` Mirsad Goran Todorovac
2022-10-24 18:39     ` srinivas pandruvada
2022-10-24 18:56       ` Mirsad Goran Todorovac
2022-10-26 17:52         ` Mirsad Goran Todorovac
2022-10-26 22:48           ` srinivas pandruvada
     [not found]             ` <78e347e9-c8b1-f228-ca32-0ad6186a6285@alu.unizg.hr>
2022-10-27 18:20               ` Mirsad Goran Todorovac
2022-10-28 18:25                 ` Rafael J. Wysocki
2022-11-15 10:36                   ` Thorsten Leemhuis
2022-11-15 11:17                     ` Mirsad Goran Todorovac
2022-11-15 14:40                   ` Mirsad Goran Todorovac
2022-11-15 14:49                     ` Rafael J. Wysocki
2022-11-15 18:57                       ` Mirsad Goran Todorovac [this message]

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=c10bc878-1830-eb4f-1cc8-19e5ac15417c@alu.unizg.hr \
    --to=mirsad.todorovac@alu.unizg.hr \
    --cc=devel@acpica.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=rafael@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).