Bug 178221

Summary: radeon performance drop from 4.8 to 4.9-rc1 in Shadow of Mordor
Product: Drivers Reporter: Christian Nissen (christiannissen)
Component: Video(DRI - non Intel)Assignee: drivers_video-dri
Status: RESOLVED CODE_FIX    
Severity: normal CC: alexdeucher, regressions, szg00000
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 4.9-RC1 Subsystem:
Regression: No Bisected commit-id:
Attachments: glxinfo output

Description Christian Nissen 2016-10-17 22:44:11 UTC
Created attachment 241881 [details]
glxinfo output

Hello,

I have a Radeon HD7950 and use Kubuntu 16.04 with Kernel 4.8 and padoka ppa (for mesa) to play Shadow of Mordor. I just tried out the 4.9-rc1 and noticed a significant performance drop in the built in benchmark.

Kernel; Resolution; Details Setting; Min FPS; Avg FPS; Max FPS
4.8; FullHD; Very High; 21,37; 37,29; 64,47
4.8; FullHD; Lowest; 27,42; 48,70; 86,77
4.8; 384x216; Very High; 20,30; 39,66; 73,23
4.8; 384x216; Lowest; 27,14; 50,30; 87,34
4.9; FullHD; Very High; 15,15; 29,59; 59,51
4.9; FullHD; Lowest; 26,00; 39,20; 67,31
4.9; 384x216; Very High; 14,94; 30,33; 58,00
4.9; 384x216; Lowest; 22,07; 37,98; 70,93

4.8.1 seems fine as well, but I only tested FullHD / Very High getting the same results as with 4.8.

All runs used:
- mesa (1:12.1~git161016172400.c61eb3c~y~padoka0)
- libdrm (2.4.71+git1610081859.a44c9c3~x~padoka0)


I build the 4.9-rc1 kernel as described on https://wiki.ubuntu.com/KernelTeam/GitKernelBuild 

If it helps I could try to bisect the kernel but that might take a few days (maybe even a week or two) depending on how much free time I have.
Comment 1 Alex Deucher 2016-10-18 03:02:39 UTC
This was bisected to"

87744ab3832b83ba71b931f86f9cfdb000d07da5 is the first bad commit
commit 87744ab3832b83ba71b931f86f9cfdb000d07da5
Author: Dan Williams <dan.j.williams@intel.com>
Date:   Fri Oct 7 17:00:18 2016 -0700

    mm: fix cache mode tracking in vm_insert_mixed()

    vm_insert_mixed() unlike vm_insert_pfn_prot() and vmf_insert_pfn_pmd(),
    fails to check the pgprot_t it uses for the mapping against the one
    recorded in the memtype tracking tree.  Add the missing call to
    track_pfn_insert() to preclude cases where incompatible aliased mappings
    are established for a given physical address range.

    Link: http://lkml.kernel.org/r/
147328717909.35069.14256589123570653697.stgit@dwillia2-
desk3.amr.corp.intel.com
    Signed-off-by: Dan Williams <dan.j.williams@intel.com>
    Cc: David Airlie <airlied@linux.ie>
    Cc: Matthew Wilcox <mawilcox@microsoft.com>
    Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Does reverting that commit fix your issue?

See:
https://lists.freedesktop.org/archives/dri-devel/2016-October/120693.html
Comment 2 Christian Nissen 2016-10-18 19:31:49 UTC
(In reply to Alex Deucher from comment #1)
> Does reverting that commit fix your issue?

Yes that did it. 

Only tested Full HD with Very High Details.

Kernel compiled from; Min FPS; Avg FPS; Max FPS
d66ba15bde22703b3c0cec6782519cb0765a6777; 21,14; 36,85; 63,29
87744ab3832b83ba71b931f86f9cfdb000d07da5; 15,78; 30,47; 59,13

Had to compile with CONFIG_OPROFILE and CONFIG_FRAME_POINTER disabled, to avoid this error: https://patchwork.kernel.org/patch/9364811/
Comment 3 The Linux kernel's regression tracker (Thorsten Leemhuis) 2016-10-30 11:12:26 UTC
FYI: I added this report to the list of regressions for Linux 4.9. I'll
watch this thread for further updates on this issue to document progress
in my weekly reports. Please let me know via regressions@leemhuis.info
in case the discussion moves to a different place (bugzilla or another
mail thread for example). tia!

Current status (afaics): Stuck? Nothing happend in https://lists.freedesktop.org/archives/dri-devel/2016-October/120693.html for ten days   

Ciao, Thorsten
Comment 4 Alex Deucher 2016-10-30 16:15:23 UTC
Fix pull was requested last week:
https://lists.freedesktop.org/archives/dri-devel/2016-October/122110.html
Comment 5 Christian Nissen 2016-11-19 19:06:45 UTC
Did a quick retested with 4.9-rc5. I'm now getting 37-ish average FPS on both 4.8 and 4.9. Thanks a lot for your efforts.

Changing the status to Resolved - CODE_FIX.