Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ACPI: APEI: GHES: Improve ghes_notify_sea() status check

Performance testing on ARMv8 systems shows significant overhead in error
status handling in SEA error handling.

- ghes_peek_estatus(): 8,138.3 ns (21,160 cycles).
- ghes_clear_estatus(): 2,038.3 ns (5,300 cycles).

Apply the same optimization used in ghes_notify_nmi() to
ghes_notify_sea() by checking for active errors before processing,

Tested-by: Tony Luck <tony.luck@intel.com>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Shuai Xue <xueshuai@linux.alibaba.com>
Reviewed-by: Hanjun Guo <guohanjun@huawei.com>
Link: https://patch.msgid.link/20260112032239.30023-4-xueshuai@linux.alibaba.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Shuai Xue and committed by
Rafael J. Wysocki
b73cf7ea feb2d380

+17 -3
+17 -3
drivers/acpi/apei/ghes.c
··· 1511 1511 static DEFINE_RAW_SPINLOCK(ghes_notify_lock_sea); 1512 1512 int rv; 1513 1513 1514 + if (!ghes_has_active_errors(&ghes_sea)) 1515 + return -ENOENT; 1516 + 1514 1517 raw_spin_lock(&ghes_notify_lock_sea); 1515 1518 rv = ghes_in_nmi_spool_from_list(&ghes_sea, FIX_APEI_GHES_SEA); 1516 1519 raw_spin_unlock(&ghes_notify_lock_sea); ··· 1521 1518 return rv; 1522 1519 } 1523 1520 1524 - static void ghes_sea_add(struct ghes *ghes) 1521 + static int ghes_sea_add(struct ghes *ghes) 1525 1522 { 1523 + int rc; 1524 + 1525 + rc = ghes_map_error_status(ghes); 1526 + if (rc) 1527 + return rc; 1528 + 1526 1529 mutex_lock(&ghes_list_mutex); 1527 1530 list_add_rcu(&ghes->list, &ghes_sea); 1528 1531 mutex_unlock(&ghes_list_mutex); 1532 + 1533 + return 0; 1529 1534 } 1530 1535 1531 1536 static void ghes_sea_remove(struct ghes *ghes) ··· 1541 1530 mutex_lock(&ghes_list_mutex); 1542 1531 list_del_rcu(&ghes->list); 1543 1532 mutex_unlock(&ghes_list_mutex); 1533 + ghes_unmap_error_status(ghes); 1544 1534 synchronize_rcu(); 1545 1535 } 1546 1536 #else /* CONFIG_ACPI_APEI_SEA */ 1547 - static inline void ghes_sea_add(struct ghes *ghes) { } 1537 + static inline int ghes_sea_add(struct ghes *ghes) { return -EINVAL; } 1548 1538 static inline void ghes_sea_remove(struct ghes *ghes) { } 1549 1539 #endif /* CONFIG_ACPI_APEI_SEA */ 1550 1540 ··· 1777 1765 break; 1778 1766 1779 1767 case ACPI_HEST_NOTIFY_SEA: 1780 - ghes_sea_add(ghes); 1768 + rc = ghes_sea_add(ghes); 1769 + if (rc) 1770 + goto err; 1781 1771 break; 1782 1772 case ACPI_HEST_NOTIFY_NMI: 1783 1773 rc = ghes_nmi_add(ghes);