aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2017-07-31 12:45:41 -0400
committerBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>2017-07-31 12:45:41 -0400
commitdd0c41f8a7e0babdadc61d5201ac8505a79dec05 (patch)
treea65967d3a2da4734565d4c606ff2be3e5d4b6a9f
parent7b4dfbe7880cf2092db3c94c6a34ae6ffa8aa344 (diff)
efifb: allow user to disable write combined mapping.
This patch allows the user to disable write combined mapping of the efifb framebuffer console using an nowc option. A customer noticed major slowdowns while logging to the console with write combining enabled, on other tasks running on the same CPU. (10x or greater slow down on all other cores on the same CPU as is doing the logging). I reproduced this on a machine with dual CPUs. Intel(R) Xeon(R) CPU E5-2609 v3 @ 1.90GHz (6 core) I wrote a test that just mmaps the pci bar and writes to it in a loop, while this was running in the background one a single core with (taskset -c 1), building a kernel up to init/version.o (taskset -c 8) went from 13s to 133s or so. I've yet to explain why this occurs or what is going wrong I haven't managed to find a perf command that in any way gives insight into this. 11,885,070,715 instructions # 1.39 insns per cycle vs 12,082,592,342 instructions # 0.13 insns per cycle is the only thing I've spotted of interest, I've tried at least: dTLB-stores,dTLB-store-misses,L1-dcache-stores,LLC-store,LLC-store-misses,LLC-load-misses,LLC-loads,\mem-loads,mem-stores,iTLB-loads,iTLB-load-misses,cache-references,cache-misses For now it seems at least a good idea to allow a user to disable write combining if they see this until we can figure it out. Note also most users get a real framebuffer driver loaded when kms kicks in, it just happens on these machines the kernel didn't support the gpu specific driver. Signed-off-by: Dave Airlie <airlied@redhat.com> Acked-by: Peter Jones <pjones@redhat.com> Cc: Andy Lutomirski <luto@kernel.org> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
-rw-r--r--Documentation/fb/efifb.txt6
-rw-r--r--drivers/video/fbdev/efifb.c8
2 files changed, 13 insertions, 1 deletions
diff --git a/Documentation/fb/efifb.txt b/Documentation/fb/efifb.txt
index a59916c29b33..1a85c1bdaf38 100644
--- a/Documentation/fb/efifb.txt
+++ b/Documentation/fb/efifb.txt
@@ -27,5 +27,11 @@ You have to add the following kernel parameters in your elilo.conf:
27 Macbook Pro 17", iMac 20" : 27 Macbook Pro 17", iMac 20" :
28 video=efifb:i20 28 video=efifb:i20
29 29
30Accepted options:
31
32nowc Don't map the framebuffer write combined. This can be used
33 to workaround side-effects and slowdowns on other CPU cores
34 when large amounts of console data are written.
35
30-- 36--
31Edgar Hucek <gimli@dark-green.com> 37Edgar Hucek <gimli@dark-green.com>
diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c
index ff01bed7112f..1e784adb89b1 100644
--- a/drivers/video/fbdev/efifb.c
+++ b/drivers/video/fbdev/efifb.c
@@ -17,6 +17,7 @@
17#include <asm/efi.h> 17#include <asm/efi.h>
18 18
19static bool request_mem_succeeded = false; 19static bool request_mem_succeeded = false;
20static bool nowc = false;
20 21
21static struct fb_var_screeninfo efifb_defined = { 22static struct fb_var_screeninfo efifb_defined = {
22 .activate = FB_ACTIVATE_NOW, 23 .activate = FB_ACTIVATE_NOW,
@@ -99,6 +100,8 @@ static int efifb_setup(char *options)
99 screen_info.lfb_height = simple_strtoul(this_opt+7, NULL, 0); 100 screen_info.lfb_height = simple_strtoul(this_opt+7, NULL, 0);
100 else if (!strncmp(this_opt, "width:", 6)) 101 else if (!strncmp(this_opt, "width:", 6))
101 screen_info.lfb_width = simple_strtoul(this_opt+6, NULL, 0); 102 screen_info.lfb_width = simple_strtoul(this_opt+6, NULL, 0);
103 else if (!strcmp(this_opt, "nowc"))
104 nowc = true;
102 } 105 }
103 } 106 }
104 107
@@ -255,7 +258,10 @@ static int efifb_probe(struct platform_device *dev)
255 info->apertures->ranges[0].base = efifb_fix.smem_start; 258 info->apertures->ranges[0].base = efifb_fix.smem_start;
256 info->apertures->ranges[0].size = size_remap; 259 info->apertures->ranges[0].size = size_remap;
257 260
258 info->screen_base = ioremap_wc(efifb_fix.smem_start, efifb_fix.smem_len); 261 if (nowc)
262 info->screen_base = ioremap(efifb_fix.smem_start, efifb_fix.smem_len);
263 else
264 info->screen_base = ioremap_wc(efifb_fix.smem_start, efifb_fix.smem_len);
259 if (!info->screen_base) { 265 if (!info->screen_base) {
260 pr_err("efifb: abort, cannot ioremap video memory 0x%x @ 0x%lx\n", 266 pr_err("efifb: abort, cannot ioremap video memory 0x%x @ 0x%lx\n",
261 efifb_fix.smem_len, efifb_fix.smem_start); 267 efifb_fix.smem_len, efifb_fix.smem_start);