Skip to contentSkip to conversation

drivers: GHES_ASSIST feature cause kernel to have a 5ms scheduling latency on AMD ROME's platform

PATCH New [email protected] 2 participants 3 messages May 29, 2020 – May 31, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers: GHES_ASSIST feature cause kernel to have a 5ms scheduling latency on AMD ROME's platform

From: Ruihui Dian <[email protected]>

AMD ROME's BIOS implement a feature(GHES_ASSIST)which is declared in ACPI 6.3,and can't be disabled by BIOS setting. This feature make kerenl register more than 10K poll timer. There are more than 10K GHESdevices under "/sys/bus/platform/drivers/GHES". These 10K timers will preempt the CPU resources and affect kernel's schedule. How to reproduce:
running cyclictest benchmark on AMD ROME platform GHES_ASSIST still don't be supported by upsteam, and the ACPI 6.2 still isn't published, So we should disable it in drivers.

---
 drivers/acpi/apei/hest.c | 10 ++++++----
 include/acpi/actbl1.h    |  3 ++-
 2 files changed, 8 insertions(+), 5 deletions(-)
drivers/acpi/apei/hest.c +6 -4
index 8224024..f929bab 100644
@@ -141,8 +141,9 @@ static int __init hest_parse_ghes_count(struct acpi_hest_header *hest_hdr, void
 {
 	int *count = data;
 
-	if (hest_hdr->type == ACPI_HEST_TYPE_GENERIC_ERROR ||
-	    hest_hdr->type == ACPI_HEST_TYPE_GENERIC_ERROR_V2)
+	if ((hest_hdr->type == ACPI_HEST_TYPE_GENERIC_ERROR &&
+	   !(hest_hdr->source_id&ACPI_HEST_GHES_ASSIST_MSK)) ||
+	   hest_hdr->type == ACPI_HEST_TYPE_GENERIC_ERROR_V2)
 		(*count)++;
 	return 0;
 }
@@ -153,8 +154,9 @@ static int __init hest_parse_ghes(struct acpi_hest_header *hest_hdr, void *data)
 	struct ghes_arr *ghes_arr = data;
 	int rc, i;
 
-	if (hest_hdr->type != ACPI_HEST_TYPE_GENERIC_ERROR &&
-	    hest_hdr->type != ACPI_HEST_TYPE_GENERIC_ERROR_V2)
+	if ((hest_hdr->type != ACPI_HEST_TYPE_GENERIC_ERROR &&
+	    hest_hdr->type != ACPI_HEST_TYPE_GENERIC_ERROR_V2) ||
+	    hest_hdr->source_id&CPI_HEST_GHES_ASSIST_MSK)
 		return 0;
 
 	if (!((struct acpi_hest_generic *)hest_hdr)->enabled)
include/acpi/actbl1.h +2 -1
index 4354954..5dbbab4 100644
@@ -1155,7 +1155,8 @@ struct acpi_hest_aer_common {
 #define ACPI_HEST_FIRMWARE_FIRST        (1)
 #define ACPI_HEST_GLOBAL                (1<<1)
 #define ACPI_HEST_GHES_ASSIST           (1<<2)
-
+/* If type==9 and Source ID bit [15:12] =!0, It is GHES_ASSIT structure*/
+#define ACPI_HEST_GHES_ASSIST_MSK	(0xF000)
 /*
  * Macros to access the bus/segment numbers in Bus field above:
  *  Bus number is encoded in bits 7:0
Signature · 1 line
1.8.3.1
#1 lore raw
Thank you for the patch! Yet something to improve:

Hi,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on pm/linux-next]
[also build test ERROR on v5.7-rc7 next-20200529]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/dianruihui-163-com/drivers-GHES_ASSIST-feature-cause-kernel-to-have-a-5ms-scheduling-latency-on-AMD-ROME-s-platform/20200601-002242
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 2388a096e7865c043e83ece4e26654bd3d1a20d5)

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64

If you fix the issue, kindly add following tag as appropriate

All errors (new ones prefixed by >>, old ones prefixed by <<):

>> drivers/acpi/apei/hest.c:159:26: error: use of undeclared identifier 'CPI_HEST_GHES_ASSIST_MSK'

hest_hdr->source_id&CPI_HEST_GHES_ASSIST_MSK)
^
1 error generated.

vim +/CPI_HEST_GHES_ASSIST_MSK +159 drivers/acpi/apei/hest.c

150
151 static int __init hest_parse_ghes(struct acpi_hest_header *hest_hdr, void *data)
152 {
153 struct platform_device *ghes_dev;
154 struct ghes_arr *ghes_arr = data;
155 int rc, i;
156
157 if ((hest_hdr->type != ACPI_HEST_TYPE_GENERIC_ERROR &&
158 hest_hdr->type != ACPI_HEST_TYPE_GENERIC_ERROR_V2) ||

 > 159		    hest_hdr->source_id&CPI_HEST_GHES_ASSIST_MSK)

160 return 0;
161
162 if (!((struct acpi_hest_generic *)hest_hdr)->enabled)
163 return 0;
164 for (i = 0; i < ghes_arr->count; i++) {
165 struct acpi_hest_header *hdr;
166 ghes_dev = ghes_arr->ghes_devs[i];
167 hdr = *(struct acpi_hest_header **)ghes_dev->dev.platform_data;
168 if (hdr->source_id == hest_hdr->source_id) {
169 pr_warn(FW_WARN HEST_PFX "Duplicated hardware error source ID: %d.\n",
170 hdr->source_id);
171 return -EIO;
172 }
173 }
174 ghes_dev = platform_device_alloc("GHES", hest_hdr->source_id);
175 if (!ghes_dev)
176 return -ENOMEM;
177
178 rc = platform_device_add_data(ghes_dev, &hest_hdr, sizeof(void *));
179 if (rc)
180 goto err;
181
182 rc = platform_device_add(ghes_dev);
183 if (rc)
184 goto err;
185 ghes_arr->ghes_devs[ghes_arr->count++] = ghes_dev;
186
187 return 0;
188 err:
189 platform_device_put(ghes_dev);
190 return rc;
191 }
192

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

#2 lore raw
In reply to [email protected]
Thank you for the patch! Yet something to improve:

Hi,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on pm/linux-next]
[also build test ERROR on v5.7-rc7 next-20200529]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/dianruihui-163-com/drivers-GHES_ASSIST-feature-cause-kernel-to-have-a-5ms-scheduling-latency-on-AMD-ROME-s-platform/20200601-002242
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
config: x86_64-rhel (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
reproduce (this is a W=1 build):
        # save the attached .config to linux build tree
        make W=1 ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate

All errors (new ones prefixed by >>, old ones prefixed by <<):

drivers/acpi/apei/hest.c: In function 'hest_parse_ghes':

>> drivers/acpi/apei/hest.c:159:26: error: 'CPI_HEST_GHES_ASSIST_MSK' undeclared (first use in this function); did you mean 'ACPI_HEST_GHES_ASSIST_MSK'?
159 |      hest_hdr->source_id&CPI_HEST_GHES_ASSIST_MSK)
|                          ^~~~~~~~~~~~~~~~~~~~~~~~
|                          ACPI_HEST_GHES_ASSIST_MSK

drivers/acpi/apei/hest.c:159:26: note: each undeclared identifier is reported only once for each function it appears in

vim +159 drivers/acpi/apei/hest.c

150
151 static int __init hest_parse_ghes(struct acpi_hest_header *hest_hdr, void *data)
152 {
153 struct platform_device *ghes_dev;
154 struct ghes_arr *ghes_arr = data;
155 int rc, i;
156
157 if ((hest_hdr->type != ACPI_HEST_TYPE_GENERIC_ERROR &&
158 hest_hdr->type != ACPI_HEST_TYPE_GENERIC_ERROR_V2) ||

 > 159		    hest_hdr->source_id&CPI_HEST_GHES_ASSIST_MSK)

160 return 0;
161
162 if (!((struct acpi_hest_generic *)hest_hdr)->enabled)
163 return 0;
164 for (i = 0; i < ghes_arr->count; i++) {
165 struct acpi_hest_header *hdr;
166 ghes_dev = ghes_arr->ghes_devs[i];
167 hdr = *(struct acpi_hest_header **)ghes_dev->dev.platform_data;
168 if (hdr->source_id == hest_hdr->source_id) {
169 pr_warn(FW_WARN HEST_PFX "Duplicated hardware error source ID: %d.\n",
170 hdr->source_id);
171 return -EIO;
172 }
173 }
174 ghes_dev = platform_device_alloc("GHES", hest_hdr->source_id);
175 if (!ghes_dev)
176 return -ENOMEM;
177
178 rc = platform_device_add_data(ghes_dev, &hest_hdr, sizeof(void *));
179 if (rc)
180 goto err;
181
182 rc = platform_device_add(ghes_dev);
183 if (rc)
184 goto err;
185 ghes_arr->ghes_devs[ghes_arr->count++] = ghes_dev;
186
187 return 0;
188 err:
189 platform_device_put(ghes_dev);
190 return rc;
191 }
192

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org