Received: by 10.192.165.148 with SMTP id m20csp352353imm; Fri, 20 Apr 2018 07:50:07 -0700 (PDT) X-Google-Smtp-Source: AIpwx49etjzMDzqCkRnHgPeYy0FdS0FkKa0pP4mioc2Sn5bp+zyHOmKdyXVJk6ID6JXTIRt8bko0 X-Received: by 10.167.128.207 with SMTP id a15mr9947951pfn.116.1524235807429; Fri, 20 Apr 2018 07:50:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524235807; cv=none; d=google.com; s=arc-20160816; b=stw3LbTjBW+Nyu1UJzAVcou7mePNQD7VuIexxbzLnVGP1A8K2+tl+hgNDFAdUTassg DlNEsIFveJlAxU36IRbA8jVLQUG8ToEam/x4qwSEOrbbUOyxAcNbmZYgR1PW4GS8iaBM 7NZN//XGEQBd+UOksZEBJdGHk2gDsv9fvukp8rfB+RAoM+mCYxZcyqNHeJhLA9B17VLq 2cagsb/XKHplKtk3yTp9joUlY6Gna8gsfNgZPP0T8dDA5edtGSbkvbB4MbQedFYcVHZx kXRcGoyL5Cl70qWwF2Xk4bojc/aIDfY15Gvs9B/m+2mDzL1oLve5DFOlMkIw0OTem//y HqZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=1AGmy/ClVicDQWfpxZsCRfSPjLUjMHyKm/g6PedNPW0=; b=Mspeq8ZeFqkhTvNa8JyBj/fclK4wUVTMxZ14ogNLZqi25hkWteyFYaFMMtdr5Sui51 6dLj2P1r6HHufVIqr04P5joXFlb01X2ergv2inUfjrhOY/6egj0eAgiwl2DtmoG7EZzj kWgkjlaS33wwysSPLPZE6atyDg1766sKO4q9CCxb9Fvfsu7PzfDqROQR2uhS9xeBWmbU B4LJFs+n5/YzdaYESzImcf8+VBRuyt4XFIxMJptXwSZ9qFKmZduUzNnx83LaDhgOf/c+ mMPDwFCt84pl5lTMoYOVtmkp/yU5DY6x6Faj+TECNqY8yeQW0WVi+99F6nRDYiaRz2YP u7kw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r4si4846013pgt.7.2018.04.20.07.49.52; Fri, 20 Apr 2018 07:50:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755505AbeDTOsQ (ORCPT + 99 others); Fri, 20 Apr 2018 10:48:16 -0400 Received: from mail.netline.ch ([148.251.143.178]:35653 "EHLO netline-mail3.netline.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755487AbeDTOsC (ORCPT ); Fri, 20 Apr 2018 10:48:02 -0400 Received: from localhost (localhost [127.0.0.1]) by netline-mail3.netline.ch (Postfix) with ESMTP id E1F1F2A6048; Fri, 20 Apr 2018 16:47:59 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at netline-mail3.netline.ch Received: from netline-mail3.netline.ch ([127.0.0.1]) by localhost (netline-mail3.netline.ch [127.0.0.1]) (amavisd-new, port 10024) with LMTP id oVdfPQgf1zih; Fri, 20 Apr 2018 16:47:59 +0200 (CEST) Received: from thor (230.154.195.178.dynamic.wline.res.cust.swisscom.ch [178.195.154.230]) by netline-mail3.netline.ch (Postfix) with ESMTPSA id F30CF2A6046; Fri, 20 Apr 2018 16:47:58 +0200 (CEST) Received: from localhost ([::1]) by thor with esmtp (Exim 4.90_1) (envelope-from ) id 1f9XKQ-0006sN-0E; Fri, 20 Apr 2018 16:47:58 +0200 Subject: Re: AMD graphics performance regression in 4.15 and later To: =?UTF-8?Q?Christian_K=c3=b6nig?= , Gabriel C Cc: Jean-Marc Valin , Dave Airlie , Felix.Kuehling@amd.com, LKML , dri-devel@lists.freedesktop.org, alexander.deucher@amd.com, Andrew Morton , Linus Torvalds References: <9ca940f1-7f21-c420-de45-13d72e783ab6@amd.com> <6cebabff-908f-5ebe-4252-760773c4cd6f@amd.com> <312ed341-7052-a61e-331f-d1e8fd5b477e@mozilla.com> <77866d66-2728-8295-d7ee-9975dbf64b99@mozilla.com> <55e1712b-6567-50c5-3789-53dd1ccddb94@gmail.com> From: =?UTF-8?Q?Michel_D=c3=a4nzer?= Message-ID: <2a864040-3888-c30a-2fab-6ff637dddda4@daenzer.net> Date: Fri, 20 Apr 2018 16:47:57 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-CA Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-04-11 11:37 AM, Christian König wrote: > Am 11.04.2018 um 06:00 schrieb Gabriel C: >> 2018-04-09 11:42 GMT+02:00 Christian König >> : >>> Am 07.04.2018 um 00:00 schrieb Jean-Marc Valin: >>>> Hi Christian, >>>> >>>> Thanks for the info. FYI, I've also opened a Firefox bug for that at: >>>> https://bugzilla.mozilla.org/show_bug.cgi?id=1448778 >>>> Feel free to comment since you have a better understanding of what's >>>> going on. >>>> >>>> One last question: right now I'm running 4.15.0 with the "offending" >>>> patch reverted. Is that safe to run or are there possible bad >>>> interactions with other changes. >>> >>> That should work without problems. >>> >>> But I just had another idea as well, if you want you could still test >>> the >>> new code path which will be using in 4.17. >>> >> While Firefox may do some strange things is not about only Firefox. >> >> With your patches my EPYC box is unusable with  4.15++ kernels. >> The whole Desktop is acting weird.  This one is using >> an Cape Verde PRO [Radeon HD 7750/8740 / R7 250E] GPU. >> >> Box is  2 * EPYC 7281 with 128 GB ECC RAM >> >> Also a 14C Xeon box with a HD7700 is broken same way. > > The hardware is irrelevant for this. We need to know what software stack > you use on top of it. > > E.g. desktop environment/Mesa and DDX version etc... > >> >> Everything breaks in X .. scrolling , moving windows , flickering etc. >> >> >> reverting f4c809914a7c3e4a59cf543da6c2a15d0f75ee38 and >> 648bc3574716400acc06f99915815f80d9563783 >> from an 4.15 kernel makes things work again. >> >> >>> Backporting all the detection logic is to invasive, but you could >>> just go >>> into drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c and forcefull use the other >>> code path. >>> >>> Just look out for "#ifdef CONFIG_SWIOTLB" checks and disable those. >>> >> Well you really can't be serious about these suggestions ? Are you ? >> >> Telling peoples to #if 0 random code is not a solution. > > That is for testing and not a permanent solution. > >> You broke existsing working userland with your patches and at least >> please fix that for 4.16. >> >> I can help testing code for 4.17/++ if you wish but that is >> *different* storry. > > Please test Alex's amd-staging-drm-next branch from > git://people.freedesktop.org/~agd5f/linux. I think we're still missing something here. I'm currently running 4.16.2 + the DRM subsystem changes which are going into 4.17 (so I have the changes Christian is referring to) with a Kaveri APU, and I'm seeing similar symptoms as described by Jean-Marc. Some observations: Firefox, Thunderbird, or worst, gnome-shell, can freeze for up to on the order of a minute, during which the kernel is spending most of one core's cycles inside alloc_pages (__alloc_pages_nodemask to be more precise), called from ttm_alloc_new_pages. At least in the case of Firefox, this happens due to Mesa internal BO allocations for glTex(Sub)Image, so it's not obvious that Firefox is doing something wrong. I never noticed this before this week. Before, I was running 4.15.y + DRM subsystem changes from 4.16. Maybe something has changed in core code, trying harder to allocate huge pages. Maybe TTM should only try to use any huge pages that happen to be available, not spend any (/ "too much"?) additional effort trying to free up huge pages? -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer