From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA8C7C33C99 for ; Wed, 8 Jan 2020 02:25:33 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A575E206DB for ; Wed, 8 Jan 2020 02:25:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A575E206DB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 224B46E15F; Wed, 8 Jan 2020 02:25:33 +0000 (UTC) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 70E836E15F for ; Wed, 8 Jan 2020 02:25:31 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Jan 2020 18:25:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,408,1571727600"; d="scan'208,217";a="254072389" Received: from shao2-debian.sh.intel.com (HELO [10.239.13.6]) ([10.239.13.6]) by fmsmga002.fm.intel.com with ESMTP; 07 Jan 2020 18:25:29 -0800 Subject: Re: [drm/mgag200] 90f479ae51: vm-scalability.median -18.8% regression To: Thomas Zimmermann , Feng Tang References: <20190729095155.GP22106@shao2-debian> <1c0bf22b-2c69-6b45-f700-ed832a3a5c17@suse.de> <14fdaaed-51c8-b270-b46b-cba7b5c4ba52@suse.de> <20190805070200.GA91650@shbuild999.sh.intel.com> <2f524683-d9ee-77b6-1253-5645dff050a7@suse.de> <20190805125239.GB96155@shbuild999.sh.intel.com> <89eedbfc-6174-e59d-921e-b92d11a52331@suse.de> From: Rong Chen Message-ID: <654bacf5-0567-0552-5cdb-c155d96d92bf@intel.com> Date: Wed, 8 Jan 2020 10:25:11 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <89eedbfc-6174-e59d-921e-b92d11a52331@suse.de> Content-Language: en-US X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stephen Rothwell , michel@daenzer.net, lkp@01.org, dri-devel , ying.huang@intel.com Content-Type: multipart/mixed; boundary="===============1623882156==" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This is a multi-part message in MIME format. --===============1623882156== Content-Type: multipart/alternative; boundary="------------2B2DDFE1C3666A2C8AC448B2" Content-Language: en-US This is a multi-part message in MIME format. --------------2B2DDFE1C3666A2C8AC448B2 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Hi Thomas, The previous throughput was reduced from 43955 to 35691, and there is a little increase in next-20200106, but there is no obvious change after the patchset: commit: f1f8555dfb ("drm/bochs: Use shadow buffer for bochs framebuffer console") 90f479ae51 ("drm/mgag200: Replace struct mga_fbdev with generic framebuffer emulation") f1f8555dfb9a70a2 90f479ae51afa45efab97afdde9 ---------------- --------------------------- %stddev %change %stddev \ | \ 43955 ± 2% -18.8% 35691 vm-scalability.median commit: 9eb1b48ca4 ("Add linux-next specific files for 20200106") 5f20199bac ("drm/fb-helper: Synchronize dirty worker with vblank") next-20200106 5f20199bac9b2de71fd2158b90 ---------------- -------------------------- %stddev change %stddev \ | \ 38550 38744 38549 38744 vm-scalability.median Best Regards, Rong Chen On 1/6/20 9:19 PM, Thomas Zimmermann wrote: > Hi Feng, > > do you still have the test setup that produced the performance penalty? > > If so, could you give a try to the patchset at [1]? I think I've fixed > the remaining issues in earlier versions and I'd like to see if it > actually improves performance. > > Best regards > Thomas > > [1] > https://lists.freedesktop.org/archives/dri-devel/2019-December/247771.html > > Am 05.08.19 um 14:52 schrieb Feng Tang: >> Hi Thomas, >> >> On Mon, Aug 05, 2019 at 12:22:11PM +0200, Thomas Zimmermann wrote: >> >> [snip] >> >>>>> 2019-08-03 19:29:17 ./case-anon-cow-seq-hugetlb >>>>> 2019-08-03 19:29:17 ./usemem --runtime 300 -n 4 --prealloc --prefault >>>>> -O -U 815394406 >>>>> 917318700 bytes / 659419 usecs = 1358497 KB/s >>>>> 917318700 bytes / 659658 usecs = 1358005 KB/s >>>>> 917318700 bytes / 659916 usecs = 1357474 KB/s >>>>> 917318700 bytes / 660168 usecs = 1356956 KB/s >>>>> >>>>> Rong, Feng, could you confirm this by disabling the cursor or blinking? >>>> Glad to know this method restored the drop. Rong is running the case. >>>> >>>> While I have another finds, as I noticed your patch changed the bpp from >>>> 24 to 32, I had a patch to change it back to 24, and run the case in >>>> the weekend, the -18% regrssion was reduced to about -5%. Could this >>>> be related? >>> In the original code, the fbdev console already ran with 32 bpp [1] and >>> 16 bpp was selected for low-end devices. [2][3] The patch only set the >>> same values for userspace; nothing changed for the console. >> I did the experiment becasue I checked the commit >> >> 90f479ae51afa4 drm/mgag200: Replace struct mga_fbdev with generic framebuffer emulation >> >> in which there is code: >> >> diff --git a/drivers/gpu/drm/mgag200/mgag200_main.c b/drivers/gpu/drm/mgag200/mgag200_main.c >> index b10f726..a977333 100644 >> --- a/drivers/gpu/drm/mgag200/mgag200_main.c >> +++ b/drivers/gpu/drm/mgag200/mgag200_main.c >> @@ -162,7 +162,7 @@ int mgag200_driver_load(struct drm_device *dev, unsigned long flags) >> if (IS_G200_SE(mdev) && mdev->mc.vram_size < (2048*1024)) >> dev->mode_config.preferred_depth = 16; >> else >> - dev->mode_config.preferred_depth = 24; >> + dev->mode_config.preferred_depth = 32; >> dev->mode_config.prefer_shadow = 1; >> >> My debug patch was kind of restoring of this part. >> >> Thanks, >> Feng >> >>> Best regards >>> Thomas >>> >>> [1] >>> https://cgit.freedesktop.org/drm/drm-tip/tree/drivers/gpu/drm/mgag200/mgag200_fb.c?id=5d17718997367c435dbe5341a8e270d9b19478d3#n259 >>> [2] >>> https://cgit.freedesktop.org/drm/drm-tip/tree/drivers/gpu/drm/mgag200/mgag200_fb.c?id=5d17718997367c435dbe5341a8e270d9b19478d3#n263 >>> [3] >>> https://cgit.freedesktop.org/drm/drm-tip/tree/drivers/gpu/drm/mgag200/mgag200_fb.c?id=5d17718997367c435dbe5341a8e270d9b19478d3#n286 >>> >>>> commit: >>>> f1f8555dfb9 drm/bochs: Use shadow buffer for bochs framebuffer console >>>> 90f479ae51a drm/mgag200: Replace struct mga_fbdev with generic framebuffer emulation >>>> 01e75fea0d5 mgag200: restore the depth back to 24 >>>> >>>> f1f8555dfb9a70a2 90f479ae51afa45efab97afdde9 01e75fea0d5ff39d3e588c20ec5 >>>> ---------------- --------------------------- --------------------------- >>>> 43921 ± 2% -18.3% 35884 -4.8% 41826 vm-scalability.median >>>> 14889337 -17.5% 12291029 -4.1% 14278574 vm-scalability.throughput >>>> >>>> commit 01e75fea0d5ff39d3e588c20ec52e7a4e6588a74 >>>> Author: Feng Tang >>>> Date: Fri Aug 2 15:09:19 2019 +0800 >>>> >>>> mgag200: restore the depth back to 24 >>>> >>>> Signed-off-by: Feng Tang >>>> >>>> diff --git a/drivers/gpu/drm/mgag200/mgag200_main.c b/drivers/gpu/drm/mgag200/mgag200_main.c >>>> index a977333..ac8f6c9 100644 >>>> --- a/drivers/gpu/drm/mgag200/mgag200_main.c >>>> +++ b/drivers/gpu/drm/mgag200/mgag200_main.c >>>> @@ -162,7 +162,7 @@ int mgag200_driver_load(struct drm_device *dev, unsigned long flags) >>>> if (IS_G200_SE(mdev) && mdev->mc.vram_size < (2048*1024)) >>>> dev->mode_config.preferred_depth = 16; >>>> else >>>> - dev->mode_config.preferred_depth = 32; >>>> + dev->mode_config.preferred_depth = 24;> dev->mode_config.prefer_shadow = 1; >>>> >>>> r = mgag200_modeset_init(mdev); >>>> >>>> Thanks, >>>> Feng >>>> >>>>> >>>>> The difference between mgag200's original fbdev support and generic >>>>> fbdev emulation is generic fbdev's worker task that updates the VRAM >>>>> buffer from the shadow buffer. mgag200 does this immediately, but relies >>>>> on drm_can_sleep(), which is deprecated. >>>>> >>>>> I think that the worker task interferes with the test case, as the >>>>> worker has been in fbdev emulation since forever and no performance >>>>> regressions have been reported so far. >>>>> >>>>> >>>>> So unless there's a report where this problem happens in a real-world >>>>> use case, I'd like to keep code as it is. And apparently there's always >>>>> the workaround of disabling the cursor blinking. >>>>> >>>>> Best regards >>>>> Thomas >>>>> >>> -- >>> Thomas Zimmermann >>> Graphics Driver Developer >>> SUSE Linux GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany >>> GF: Felix Imendörffer, Mary Higgins, Sri Rasiah >>> HRB 21284 (AG Nürnberg) >>> >> >> >> _______________________________________________ >> dri-devel mailing list >> dri-devel@lists.freedesktop.org >> https://lists.freedesktop.org/mailman/listinfo/dri-devel >> --------------2B2DDFE1C3666A2C8AC448B2 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
Hi Thomas,

The previous throughput was reduced from 43955 to 35691, and there is a little increase in next-20200106,
but there is no obvious change after the patchset:
 
commit: 
  f1f8555dfb ("drm/bochs: Use shadow buffer for bochs framebuffer console")
  90f479ae51 ("drm/mgag200: Replace struct mga_fbdev with generic framebuffer emulation")

f1f8555dfb9a70a2 90f479ae51afa45efab97afdde9 
---------------- --------------------------- 
         %stddev     %change         %stddev
             \          |                \  
     43955 ±  2%     -18.8%      35691        vm-scalability.median

commit: 

  9eb1b48ca4 ("Add linux-next specific files for 20200106")
  5f20199bac ("drm/fb-helper: Synchronize dirty worker with vblank")

 next-20200106  5f20199bac9b2de71fd2158b90
----------------  --------------------------
         %stddev      change         %stddev
             \          |                \  
     38550                       38744       
     38549                       38744        vm-scalability.median

Best Regards,
Rong Chen

On 1/6/20 9:19 PM, Thomas Zimmermann wrote:
Hi Feng,

do you still have the test setup that produced the performance penalty?

If so, could you give a try to the patchset at [1]? I think I've fixed
the remaining issues in earlier versions and I'd like to see if it
actually improves performance.

Best regards
Thomas

[1]
https://lists.freedesktop.org/archives/dri-devel/2019-December/247771.html

Am 05.08.19 um 14:52 schrieb Feng Tang:
Hi Thomas,

On Mon, Aug 05, 2019 at 12:22:11PM +0200, Thomas Zimmermann wrote:

	[snip] 

  2019-08-03 19:29:17  ./case-anon-cow-seq-hugetlb
  2019-08-03 19:29:17  ./usemem --runtime 300 -n 4 --prealloc --prefault
    -O -U 815394406
  917318700 bytes / 659419 usecs = 1358497 KB/s
  917318700 bytes / 659658 usecs = 1358005 KB/s
  917318700 bytes / 659916 usecs = 1357474 KB/s
  917318700 bytes / 660168 usecs = 1356956 KB/s

Rong, Feng, could you confirm this by disabling the cursor or blinking?
Glad to know this method restored the drop. Rong is running the case.

While I have another finds, as I noticed your patch changed the bpp from
24 to 32, I had a patch to change it back to 24, and run the case in
the weekend, the -18% regrssion was reduced to about -5%. Could this
be related?
In the original code, the fbdev console already ran with 32 bpp [1] and
16 bpp was selected for low-end devices. [2][3] The patch only set the
same values for userspace; nothing changed for the console.
I did the experiment becasue I checked the commit 

90f479ae51afa4 drm/mgag200: Replace struct mga_fbdev with generic framebuffer emulation

in which there is code:

diff --git a/drivers/gpu/drm/mgag200/mgag200_main.c b/drivers/gpu/drm/mgag200/mgag200_main.c
index b10f726..a977333 100644
--- a/drivers/gpu/drm/mgag200/mgag200_main.c
+++ b/drivers/gpu/drm/mgag200/mgag200_main.c
@@ -162,7 +162,7 @@ int mgag200_driver_load(struct drm_device *dev, unsigned long flags)
 	if (IS_G200_SE(mdev) && mdev->mc.vram_size < (2048*1024))
 		dev->mode_config.preferred_depth = 16;
 	else
-		dev->mode_config.preferred_depth = 24;
+		dev->mode_config.preferred_depth = 32;
 	dev->mode_config.prefer_shadow = 1;
 
My debug patch was kind of restoring of this part.

Thanks,
Feng

Best regards
Thomas

[1]
https://cgit.freedesktop.org/drm/drm-tip/tree/drivers/gpu/drm/mgag200/mgag200_fb.c?id=5d17718997367c435dbe5341a8e270d9b19478d3#n259
[2]
https://cgit.freedesktop.org/drm/drm-tip/tree/drivers/gpu/drm/mgag200/mgag200_fb.c?id=5d17718997367c435dbe5341a8e270d9b19478d3#n263
[3]
https://cgit.freedesktop.org/drm/drm-tip/tree/drivers/gpu/drm/mgag200/mgag200_fb.c?id=5d17718997367c435dbe5341a8e270d9b19478d3#n286

commit: 
  f1f8555dfb9 drm/bochs: Use shadow buffer for bochs framebuffer console
  90f479ae51a drm/mgag200: Replace struct mga_fbdev with generic framebuffer emulation
  01e75fea0d5 mgag200: restore the depth back to 24

f1f8555dfb9a70a2 90f479ae51afa45efab97afdde9 01e75fea0d5ff39d3e588c20ec5 
---------------- --------------------------- --------------------------- 
     43921 ±  2%     -18.3%      35884            -4.8%      41826        vm-scalability.median
  14889337           -17.5%   12291029            -4.1%   14278574        vm-scalability.throughput
 
commit 01e75fea0d5ff39d3e588c20ec52e7a4e6588a74
Author: Feng Tang <feng.tang@intel.com>
Date:   Fri Aug 2 15:09:19 2019 +0800

    mgag200: restore the depth back to 24
    
    Signed-off-by: Feng Tang <feng.tang@intel.com>

diff --git a/drivers/gpu/drm/mgag200/mgag200_main.c b/drivers/gpu/drm/mgag200/mgag200_main.c
index a977333..ac8f6c9 100644
--- a/drivers/gpu/drm/mgag200/mgag200_main.c
+++ b/drivers/gpu/drm/mgag200/mgag200_main.c
@@ -162,7 +162,7 @@ int mgag200_driver_load(struct drm_device *dev, unsigned long flags)
 	if (IS_G200_SE(mdev) && mdev->mc.vram_size < (2048*1024))
 		dev->mode_config.preferred_depth = 16;
 	else
-		dev->mode_config.preferred_depth = 32;
+		dev->mode_config.preferred_depth = 24;>  	dev->mode_config.prefer_shadow = 1;
 
 	r = mgag200_modeset_init(mdev);

Thanks,
Feng


The difference between mgag200's original fbdev support and generic
fbdev emulation is generic fbdev's worker task that updates the VRAM
buffer from the shadow buffer. mgag200 does this immediately, but relies
on drm_can_sleep(), which is deprecated.

I think that the worker task interferes with the test case, as the
worker has been in fbdev emulation since forever and no performance
regressions have been reported so far.


So unless there's a report where this problem happens in a real-world
use case, I'd like to keep code as it is. And apparently there's always
the workaround of disabling the cursor blinking.

Best regards
Thomas

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Linux GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany
GF: Felix Imendörffer, Mary Higgins, Sri Rasiah
HRB 21284 (AG Nürnberg)



_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


    

--------------2B2DDFE1C3666A2C8AC448B2-- --===============1623882156== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel --===============1623882156==--