Received: by 10.213.65.68 with SMTP id h4csp765431imn; Fri, 6 Apr 2018 08:31:35 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+N5JDh+dMbR6OvT7E3Mz215/j0Dc9zemYaNB4BVYznmCTs8NJT5yht79GUpkIDDvod1Bej X-Received: by 2002:a17:902:7102:: with SMTP id a2-v6mr27533749pll.87.1523028695488; Fri, 06 Apr 2018 08:31:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523028695; cv=none; d=google.com; s=arc-20160816; b=Rp2AccTa0pZ01E8lG0k1BdDt7V9g9+HXDXyXJkaWN4io61ihRYqCsO/w1dN0fSor6M ND8kNSaJnLrf2pHwD3/uFIVf4tokaFQ1J5OYERoRaryyT78z/YzW4dgMsEnaDonaVCkK I6XLjv7s9fpvqc6qvuFSnBQi69CH2faLTevDeqR1ClaKozg2zLmjqqfYi8d5trkm0GQr +yU1aKDE73uLJAg36J9Z8ABgnEA2Dvlq5gw6gprJaL9PJsM/ssgZFxNCcblc2+kQKjMQ m3gLluphjdChZmxbPdKgvF1xTNjiv1rm6X1Wvt4G2GX39+GeeBasdEsLXstz/e/KfZW9 BuWw== 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:to:subject:dkim-signature :arc-authentication-results; bh=/PI0JSqRnIE4HdVsvz+h5nW2cqvITv/FhIYn2jl7Kzw=; b=CAjeTRYCAxRIqlI5CBWcvC0BOMgg+ovAh7e0Mj0eb4zpG400F8S4k2PAlk1IpdKJmM L//wrpNy+LZlNA2FytBNi8neSfxc7cXFwO5MpHfW/YKI9YuO4HbpAe6dS/TBuDhvNnMJ E8If+elBiM+l+lSmT4IfDMaFlq/D3NQoPHjhPor8QLlA1DLWUkl1YnfX5E9r3U136G6z mY5qPXQYIGucR7OeIO1+FJGil6CfRipnJqRnOw+AZeHzzdpZFvqscPY4YWsD3k0y/0WR 0oTeqfWCvVVpDGq/OkxIt4AvwUihNC3ps8mX4VJNEQSx+9Wy9edDUJK2//qHpPxKgQg1 KtqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mozilla.com header.s=google header.b=IlcLRawd; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mozilla.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si8579825plj.275.2018.04.06.08.31.21; Fri, 06 Apr 2018 08:31:35 -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; dkim=pass header.i=@mozilla.com header.s=google header.b=IlcLRawd; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mozilla.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753921AbeDFPaI (ORCPT + 99 others); Fri, 6 Apr 2018 11:30:08 -0400 Received: from mail-qk0-f180.google.com ([209.85.220.180]:37206 "EHLO mail-qk0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753685AbeDFPaG (ORCPT ); Fri, 6 Apr 2018 11:30:06 -0400 Received: by mail-qk0-f180.google.com with SMTP id w6so1568072qkb.4 for ; Fri, 06 Apr 2018 08:30:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mozilla.com; s=google; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=/PI0JSqRnIE4HdVsvz+h5nW2cqvITv/FhIYn2jl7Kzw=; b=IlcLRawd5/yTAxNsdDTDxzybTmzpMpA0zn52yhLaj/b7ec/eqiLhHvDS8o22BakTw3 3MJoGkhJfv7mTot+tWuBGOWwafhUnXlYvyGothHOZC9eTthcfsSSnOg6wAaAZllMMxWj k41tLJu4G/5oczCRGosG5LMh7AFBFKkGlUsHg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=/PI0JSqRnIE4HdVsvz+h5nW2cqvITv/FhIYn2jl7Kzw=; b=tTGktss1KRmUQ9XUMtqmhhkOti1h89wNVVp5geF/LEZDHRDiB6Qaq6DFHoJjcEJ1I8 q1A8EoipAYlifCPzbMY4+l4ntHcCvyV5eqL9WVzejXd2bb0zjP4T7IDzPf2Xoyn9zO8Z qygJzUcaCKDRrx2cKK6Eb6qmwePyb10WDnpr/mkZiBA4nUZwEPy/n6p+FojTTibwCjtn nsttPZbzT8IriO15+s2lCR0EuwtPqI708Hq17Q+zMLyU3tyCqFVYjwgFOTHQQCNz5gKh P2yEz+wASoKqLb1UAXrfJNl+5/qnLe8mgUr9VZd51kPB1r7Y8P8yb3tmMC0s64Oxi1p5 ou7Q== X-Gm-Message-State: ALQs6tAGNNKQzVE3D+flGWxN8QGKhZc0Cq0QB9qQ9p2BS7rE50Fjnocp DMYLx02SdlvtRJyKwx4r7jD1lbrMo9tIMg== X-Received: by 10.55.65.65 with SMTP id o62mr35885161qka.270.1523028604625; Fri, 06 Apr 2018 08:30:04 -0700 (PDT) Received: from obelix.jmvalin.ca (modemcable231.101-131-66.mc.videotron.ca. [66.131.101.231]) by smtp.gmail.com with ESMTPSA id z7sm8131577qke.19.2018.04.06.08.30.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Apr 2018 08:30:03 -0700 (PDT) Subject: Re: AMD graphics performance regression in 4.15 and later To: =?UTF-8?Q?Christian_K=c3=b6nig?= , airlied@linux.ie, alexander.deucher@amd.com, Felix.Kuehling@amd.com, labbott@redhat.com, akpm@linux-foundation.org, michel.daenzer@amd.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <9ca940f1-7f21-c420-de45-13d72e783ab6@amd.com> From: Jean-Marc Valin Message-ID: Date: Fri, 6 Apr 2018 11:30:02 -0400 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: <9ca940f1-7f21-c420-de45-13d72e783ab6@amd.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Christian, Is there a way to turn off these huge pages at boot-time/run-time? Right now the recent kernels are making Firefox pretty much unusable for me. I've been able to revert the patch from 4.15 but it's not really a long-term solution. You mention that the purpose of the patch is to improve performance, but I haven't actually noticed anything running faster on my system. Is there any particular test where I'm supposed to see an improvement compared to 4.14? I'm not sure what you mean by "We mitigated the problem by avoiding the slow coherent DMA code path on almost all platforms on newer kernels". I tested up to 4.16 and the performance regression is just as bad as it is for 4.15. Unlike the older hardware reported on kernel bug 198511, the hardware I have is quite recent (RX 560) and still being sold. I've also confirmed that neither nvidia (on the same machine) nor intel GPUs (on a less powerful machine) are affected, so it seems like there's a way to avoid that slow performance. I'm not saying that what Firefox is doing is ideal (I don't know what it does and why), but it still seems like something that should still be avoided in the kernel. Cheers, Jean-Marc On 04/06/2018 04:03 AM, Christian König wrote: > Hi Jean, > > yeah, that is a known problem. Using huge pages improves the performance > because of better TLB usage, but for the cost of higher allocation > overhead. > > What we found is that firefox is doing something rather strange by > allocating large textures and then just trowing them away again > immediately. > > We mitigated the problem by avoiding the slow coherent DMA code path on > almost all platforms on newer kernels, but essentially somebody needs to > figure out why firefox and/or the user space stack is doing this > constant allocation/freeing of memory. > > There is also a bug tracker on bugs.kernel.org about this, but I can't > find it any more of hand. > > Regards, > Christian. > > Am 06.04.2018 um 02:30 schrieb Jean-Marc Valin: >> Hi, >> >> I noticed a serious graphics performance regression between 4.14 and >> 4.15. It is most noticeable with Firefox (tried FF57 through FF60) and >> causes scrolling to be really choppy/sluggish. I've confirmed that the >> problem is also there on 4.16, while 4.13 works fine. >> >> After a bisection, I've narrowed the regression down to this commit: >> >> commit 648bc3574716400acc06f99915815f80d9563783 >> Author: Christian König >> Date:   Thu Jul 6 09:59:43 2017 +0200 >> >>      drm/ttm: add transparent huge page support for DMA allocations v2 >> >> >> Some details about my system: >> Distro: Fedora 27 (up-to-date) >> Video: MSI Radeon RX 560 AERO >> CPU: Dual-socket Xeon E5-2640 v4 (20 cores total) >> RAM: 128 GB ECC >> >> >> As a comparison, when running Firefox with 4.15 on a Lenovo W540 laptop >> (with Intel graphics only) the responsiveness is much better then what >> I'm getting on the Xeon machine above with the Radeon card, so this >> really seems to be an AMD-only issue. >> >> Any way to fix the issue? >> >> Thanks, >> >>     Jean-Marc >> _______________________________________________ >> dri-devel mailing list >> dri-devel@lists.freedesktop.org >> https://lists.freedesktop.org/mailman/listinfo/dri-devel >