Re: [PATCH][next] ACPI: OSL: ratelimit ACPICA kernel messages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 18/02/2025 19:13, Rafael J. Wysocki wrote:
+Saket Dumbre

On Thu, Feb 13, 2025 at 7:16 PM Colin Ian King <colin.i.king@xxxxxxxxx> wrote:

In cases where the ACPI AML contains errors there can be quite a large
amount of ACPICA kernel log spamming.

Except when someone wants to see them all which also happens.

And wouldn't this also rate limit debug messages from ACPICA
specifically enabled via the kernel command line?

If so, I'd rather find a way to tell ACPICA to be less verbose.

Yep, makes sense Rafael. The crux of the matter is that there should be some way to reduce repeated identical "ACPI BIOS Error" messages, especially when the AML is triggering this 10+ times a second :-)

Colin


Reduce this by rate limiting the messages.

Signed-off-by: Colin Ian King <colin.i.king@xxxxxxxxx>
---
  drivers/acpi/osl.c | 20 ++++++++++++--------
  1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 5ff343096ece..d4ece68e0fd6 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -159,17 +159,21 @@ void __printf(1, 0) acpi_os_vprintf(const char *fmt, va_list args)
         if (acpi_in_debugger) {
                 kdb_printf("%s", buffer);
         } else {
-               if (printk_get_level(buffer))
-                       printk("%s", buffer);
-               else
-                       printk(KERN_CONT "%s", buffer);
+               if (printk_ratelimit()) {
+                       if (printk_get_level(buffer))
+                               printk("%s", buffer);
+                       else
+                               printk(KERN_CONT "%s", buffer);
+               }
         }
  #else
         if (acpi_debugger_write_log(buffer) < 0) {
-               if (printk_get_level(buffer))
-                       printk("%s", buffer);
-               else
-                       printk(KERN_CONT "%s", buffer);
+               if (printk_ratelimit()) {
+                       if (printk_get_level(buffer))
+                               printk("%s", buffer);
+                       else
+                               printk(KERN_CONT "%s", buffer);
+               }
         }
  #endif
  }
--

Attachment: OpenPGP_0x68C287DFC6A80226.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]
  Powered by Linux