public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] nsrepair2: Improve sorting performance and add tests
@ 2026-02-01 13:03 Nick Huang
  2026-02-01 13:03 ` [PATCH 1/2] ACPI: nsrepair2: Replace O(n²) bubble sort with O(n log n) sort_r() Nick Huang
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Nick Huang @ 2026-02-01 13:03 UTC (permalink / raw)
  To: Rafael J . Wysocki, Robert Moore
  Cc: Len Brown, linux-acpi, acpica-devel, linux-kernel, paladin,
	kusogame68, ceyanglab, n1136402, Nick Huang

   This patch series improves the ACPI nsrepair2 sorting implementation
   and adds comprehensive KUnit tests.

   Patch 1 replaces the O(n²) bubble sort algorithm in acpi_ns_sort_list()
   with the kernel's sort_r() function, which uses heapsort to achieve
   O(n log n) time complexity. This improves performance when sorting
   large ACPI package lists (e.g., _PSS, _TSS) while reducing code
   complexity by leveraging the existing kernel sort API.

   Patch 2 adds KUnit tests to verify the repair functions in nsrepair2.c,
   covering:
     - ACPI operand object creation (integer, string, buffer, package)
     - Namespace node creation and NAMESEG comparison
     - Package structures for _PSS, _CST, _ALR, _PRT methods
     - _HID string format verification
     - _FDE buffer expansion
     - Sorting logic with ascending/descending order



Nick Huang (2):
  ACPI: nsrepair2: Replace O(n²) bubble sort with O(n log n) sort_r()
  ACPI: acpica: Add KUnit tests for nsrepair2 repair functions

 drivers/acpi/acpica/nsrepair2.c      |  87 ++-
 drivers/acpi/acpica/nsrepair2_test.c | 854 +++++++++++++++++++++++++++
 2 files changed, 916 insertions(+), 25 deletions(-)
 create mode 100644 drivers/acpi/acpica/nsrepair2_test.c

-- 
2.43.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-02-15  1:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-01 13:03 [PATCH 0/2] nsrepair2: Improve sorting performance and add tests Nick Huang
2026-02-01 13:03 ` [PATCH 1/2] ACPI: nsrepair2: Replace O(n²) bubble sort with O(n log n) sort_r() Nick Huang
2026-02-01 22:48   ` David Laight
2026-02-03 11:03     ` Nick Huang
2026-02-01 13:03 ` [PATCH 2/2] ACPI: acpica: Add KUnit tests for nsrepair2 repair functions Nick Huang
2026-02-01 15:11   ` Nick Huang
2026-02-13 13:40 ` [PATCH 0/2] nsrepair2: Improve sorting performance and add tests Rafael J. Wysocki
2026-02-15  1:26   ` Nick Huang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox