From: Shuai Xue <xueshuai@linux.alibaba.com>
To: tony.luck@intel.com, guohanjun@huawei.com, mchehab@kernel.org,
yazen.ghannam@amd.com
Cc: dave.jiang@intel.com, Smita.KoralahalliChannabasappa@amd.com,
leitao@debian.org, pengdonglin@xiaomi.com,
xueshuai@linux.alibaba.com, baolin.wang@linux.alibaba.com,
benjamin.cheatham@amd.com, bp@alien8.de,
dan.j.williams@intel.com, james.morse@arm.com, lenb@kernel.org,
linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
rafael@kernel.org, zhuo.song@linux.alibaba.com
Subject: [PATCH v2 3/3] ACPI: APEI: GHES: Improve ghes_notify_sea() status check
Date: Sun, 4 Jan 2026 20:04:05 +0800 [thread overview]
Message-ID: <20260104120405.51555-4-xueshuai@linux.alibaba.com> (raw)
In-Reply-To: <20260104120405.51555-1-xueshuai@linux.alibaba.com>
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>
---
drivers/acpi/apei/ghes.c | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
index 7600063fe263..54a6461d277a 100644
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -1487,6 +1487,9 @@ int ghes_notify_sea(void)
static DEFINE_RAW_SPINLOCK(ghes_notify_lock_sea);
int rv;
+ if (!ghes_has_active_errors(&ghes_sea))
+ return -ENOENT;
+
raw_spin_lock(&ghes_notify_lock_sea);
rv = ghes_in_nmi_spool_from_list(&ghes_sea, FIX_APEI_GHES_SEA);
raw_spin_unlock(&ghes_notify_lock_sea);
@@ -1494,11 +1497,19 @@ int ghes_notify_sea(void)
return rv;
}
-static void ghes_sea_add(struct ghes *ghes)
+static int ghes_sea_add(struct ghes *ghes)
{
+ int rc;
+
+ rc = ghes_map_error_status(ghes);
+ if (rc)
+ return rc;
+
mutex_lock(&ghes_list_mutex);
list_add_rcu(&ghes->list, &ghes_sea);
mutex_unlock(&ghes_list_mutex);
+
+ return 0;
}
static void ghes_sea_remove(struct ghes *ghes)
@@ -1506,10 +1517,11 @@ static void ghes_sea_remove(struct ghes *ghes)
mutex_lock(&ghes_list_mutex);
list_del_rcu(&ghes->list);
mutex_unlock(&ghes_list_mutex);
+ ghes_unmap_error_status(ghes);
synchronize_rcu();
}
#else /* CONFIG_ACPI_APEI_SEA */
-static inline void ghes_sea_add(struct ghes *ghes) { }
+static inline int ghes_sea_add(struct ghes *ghes) { return -EINVAL; }
static inline void ghes_sea_remove(struct ghes *ghes) { }
#endif /* CONFIG_ACPI_APEI_SEA */
@@ -1741,7 +1753,9 @@ static int ghes_probe(struct platform_device *ghes_dev)
break;
case ACPI_HEST_NOTIFY_SEA:
- ghes_sea_add(ghes);
+ rc = ghes_sea_add(ghes);
+ if (rc)
+ goto err;
break;
case ACPI_HEST_NOTIFY_NMI:
rc = ghes_nmi_add(ghes);
--
2.39.3
prev parent reply other threads:[~2026-01-04 12:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-04 12:04 [PATCH v2 0/3] ACPI: APEI: GHES: Performance improvements for error notification handlers Shuai Xue
2026-01-04 12:04 ` [PATCH v2 1/3] ACPI: APEI: GHES: Improve ghes_notify_nmi() status check Shuai Xue
2026-01-04 12:04 ` [PATCH v2 2/3] ACPI: APEI: GHES: Extract helper functions for error status handling Shuai Xue
2026-01-05 5:12 ` Donglin Peng
2026-01-05 5:41 ` Shuai Xue
2026-01-09 21:22 ` Rafael J. Wysocki
2026-01-12 2:57 ` Shuai Xue
2026-01-04 12:04 ` Shuai Xue [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=20260104120405.51555-4-xueshuai@linux.alibaba.com \
--to=xueshuai@linux.alibaba.com \
--cc=Smita.KoralahalliChannabasappa@amd.com \
--cc=baolin.wang@linux.alibaba.com \
--cc=benjamin.cheatham@amd.com \
--cc=bp@alien8.de \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=guohanjun@huawei.com \
--cc=james.morse@arm.com \
--cc=leitao@debian.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=pengdonglin@xiaomi.com \
--cc=rafael@kernel.org \
--cc=tony.luck@intel.com \
--cc=yazen.ghannam@amd.com \
--cc=zhuo.song@linux.alibaba.com \
/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
all inboxes | Powered by JetHome®