Skip to content

Commit b73cf7e

Browse files
axiqiarafaeljw
authored andcommitted
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>
1 parent feb2d38 commit b73cf7e

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

drivers/acpi/apei/ghes.c

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1511,29 +1511,41 @@ int ghes_notify_sea(void)
15111511
static DEFINE_RAW_SPINLOCK(ghes_notify_lock_sea);
15121512
int rv;
15131513

1514+
if (!ghes_has_active_errors(&ghes_sea))
1515+
return -ENOENT;
1516+
15141517
raw_spin_lock(&ghes_notify_lock_sea);
15151518
rv = ghes_in_nmi_spool_from_list(&ghes_sea, FIX_APEI_GHES_SEA);
15161519
raw_spin_unlock(&ghes_notify_lock_sea);
15171520

15181521
return rv;
15191522
}
15201523

1521-
static void ghes_sea_add(struct ghes *ghes)
1524+
static int ghes_sea_add(struct ghes *ghes)
15221525
{
1526+
int rc;
1527+
1528+
rc = ghes_map_error_status(ghes);
1529+
if (rc)
1530+
return rc;
1531+
15231532
mutex_lock(&ghes_list_mutex);
15241533
list_add_rcu(&ghes->list, &ghes_sea);
15251534
mutex_unlock(&ghes_list_mutex);
1535+
1536+
return 0;
15261537
}
15271538

15281539
static void ghes_sea_remove(struct ghes *ghes)
15291540
{
15301541
mutex_lock(&ghes_list_mutex);
15311542
list_del_rcu(&ghes->list);
15321543
mutex_unlock(&ghes_list_mutex);
1544+
ghes_unmap_error_status(ghes);
15331545
synchronize_rcu();
15341546
}
15351547
#else /* CONFIG_ACPI_APEI_SEA */
1536-
static inline void ghes_sea_add(struct ghes *ghes) { }
1548+
static inline int ghes_sea_add(struct ghes *ghes) { return -EINVAL; }
15371549
static inline void ghes_sea_remove(struct ghes *ghes) { }
15381550
#endif /* CONFIG_ACPI_APEI_SEA */
15391551

@@ -1765,7 +1777,9 @@ static int ghes_probe(struct platform_device *ghes_dev)
17651777
break;
17661778

17671779
case ACPI_HEST_NOTIFY_SEA:
1768-
ghes_sea_add(ghes);
1780+
rc = ghes_sea_add(ghes);
1781+
if (rc)
1782+
goto err;
17691783
break;
17701784
case ACPI_HEST_NOTIFY_NMI:
17711785
rc = ghes_nmi_add(ghes);

0 commit comments

Comments
 (0)