Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1823846ioo; Mon, 23 May 2022 04:17:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnKb9rTMoKJQkTZPSMtUNpNVMjBKWemmZCInRwhRfyfL3yI72B8sO2HRHPdDgmkWu41edc X-Received: by 2002:a17:903:248:b0:155:e660:b774 with SMTP id j8-20020a170903024800b00155e660b774mr22842817plh.174.1653304635234; Mon, 23 May 2022 04:17:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653304635; cv=none; d=google.com; s=arc-20160816; b=wlsLFGPg/0djCikO8GUiC62+pCuopEJjhpGIPQXh2njW60vuOX3ps0PdgmfC5JCDTv tM54rKVzU5x644nYkwYEjzALUc8McYJawwNH1OQVcGRdYlsFwaxKAnMMJ5CPeA57+LLW hamrwvhghYrJgW7+FFjDuljDFMt0HQbQc0dEEWRhGXcuFyV2HYremgmQquXew2kJ+xZQ c6cX7kEqkM/dOZ06x0mBRzYaEbmHCBv1Dmhx5TScSyCksdBtR6sTcgZC33LVDUQLTo/N 3+yo0tO4s3KNSoNJXO44CsaVIy2+s+hxa/0m9p7m8Z63wdJT5e43vAuHfOvFPoSDQGnN bcxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=+NHk+e8aqeJYcwkwe/3O6TOU1tDukhnvd4ohklP/4Og=; b=d8raUrstP+aS9bfFZVcKt2hln6gQkba1wW8hy4X8EuU6oXjqgJN6u+OdTkT7kG0JGo MX1wjy+CuEAP6lqfE8BJZ/RTmYKcQDSuHLjYStA6DYvMB+jLw++tzcsQx7+0hseUI5Kr jZWCyMkTR8IROJ3HEumreD6drheGNzekzpkBzx2E7IlJqn9TaG7TTzidu3HDFS8u3aWT cHkD1b3J3LbHUGhms9RW6SF7EHjB/xVjA0dKiFYqTTC95iGa0ek96DFGaebzS/brbuhf bTVbCBUqbzubnEcAKWpZAuPXru2jOKHFnxw2hcG8u253u7hsw44/bczIGEj+I7LuFzMu oPDw== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id d10-20020a056a00198a00b0050d4affda05si13659214pfl.214.2022.05.23.04.17.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 04:17:15 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C5D2DB00; Mon, 23 May 2022 04:16:28 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234587AbiEWLQR (ORCPT + 99 others); Mon, 23 May 2022 07:16:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234621AbiEWLQN (ORCPT ); Mon, 23 May 2022 07:16:13 -0400 Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2CDFAE75 for ; Mon, 23 May 2022 04:16:07 -0700 (PDT) Received: from [192.168.1.107] ([37.4.249.139]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MBlgy-1o0kTv2V7E-00C9bM; Mon, 23 May 2022 13:15:39 +0200 Message-ID: <2ddd354e-a2b6-077c-25be-6ef1b2118d04@i2se.com> Date: Mon, 23 May 2022 13:15:33 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: vchiq: Performance regression since 5.18-rc1 Content-Language: en-US To: Phil Elwell , paulmck@kernel.org Cc: Marcelo Tosatti , Andrew Morton , Nicolas Saenz Julienne , Borislav Petkov , Minchan Kim , Mel Gorman , Juri Lelli , Thomas Gleixner , Sebastian Andrzej Siewior , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Linux ARM , regressions@lists.linux.dev, riel@surriel.com, viro@zeniv.linux.org.uk References: <77d6d498-7dd9-03eb-60f2-d7e682bb1b20@i2se.com> <20220521234616.GO1790663@paulmck-ThinkPad-P17-Gen-1> <20220523044818.GS1790663@paulmck-ThinkPad-P17-Gen-1> <58cb7fbb-d317-83e6-0427-d3f3944b24b8@raspberrypi.com> From: Stefan Wahren In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:v0owzDcGf9fK8Ws4nmqKw7CTTh0KtFtbT7xHsqNwlfNkIs3Lb47 j76pfT5mGqu42IQaykXUn6f1v9wNyleG6py7caYh1oLmg3OR2xqnRytXj0A0vCyQyNDHq4p bpUXeWitujI0KykBuJRIalFItdav7mnod8oFuYuoIRfWOxKnjSDEwwTSx+IGTUTEC4778uP WvBVOSaqyLrIq4/Zx08GQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:crw/mYeA454=:c9EahJuV/5teRXK2h66llH tjmO2GYEtkQYtF6LDTCSO0/wFIWdXgKie+rUunilr3hrV2sFMT+BSIRgF1TdDdNKB+7Ozz4dI YqYNSREonTfwWiONYz9hqm73vp0xc8NJDOGRY0b62ZZkERHv3sHqMcA3eic+hOIWUa22uksXb pb+7hNgcZXtpxHkD+Pyao6WVrfIWzn9uWCxhOEvz4r24sXz9Dm0fYkLtQw3J8MHG+dxoLYfNh 0SwAH3fp6j/hCXzjLWVus/Z7PJC0Z3UXgxqgJvDChQiUo0vDGdvuLexYHRXM4kQB04P0xjFHs fs/6tIgzZLllgJSLO2VQLK67I1hzm1irxJJQ2/7M3MbBksbxoPuo2DpJokn0iEHi7GpJFX+Wo jhCgoGlXG61v+UaVauururNHwD1gJmorzb7ForHipGAbGhrk6ouk3fZQFJnZTuRBgv1/exIQS u9R9jFvw2M6B/SrhPP9ODJ/Wx977lnDfrXT2daqZxrZUZXxWfWkUzT9kLgzokAUQ9lrJw0V1m 2TeqokhWV2HNdU6WjEcfvJr2ncwVzPzraANEOrut/7Lr2Je5BgNWhU/Szv96pwiQ/T7S0RPy9 OKe/ey/eCuFxmU1HXcYsKBKNMxx+YwuMJCxnRtRyh3q3kwG56CCyVylCSqZg9Y1uThx/B+6lQ 0JIzHs1rEawvTMIlqNehWljIebQa9sqStp+Kpw5hcoBHtiEA4NRcd5Jl/MytoI8NRglAjlQmg l4mU7UvnAl/6bTJ90BffvyUnYMQylRkWvrQKReSN4s+oIfkzrWZZ+Wzls8U= X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Phil, Am 23.05.22 um 13:01 schrieb Phil Elwell: > Hi Stefan, > > On 23/05/2022 11:48, Stefan Wahren wrote: >> Hi Phil, >> >> Am 23.05.22 um 11:29 schrieb Phil Elwell: >>> Hi Stefan, >>> >>> On 23/05/2022 07:19, Stefan Wahren wrote: >>>> Hi Paul, >>>> >>>> Am 23.05.22 um 06:48 schrieb Paul E. McKenney: >>>>> On Sun, May 22, 2022 at 05:11:36PM +0200, Stefan Wahren wrote: >>>>>> Hi Paul, >>>>>> >>>>>> Am 22.05.22 um 01:46 schrieb Paul E. McKenney: >>>>>>> On Sun, May 22, 2022 at 01:22:00AM +0200, Stefan Wahren wrote: >>>>>>>> Hi, >>>>>>>> >>>>>>>> while testing the staging/vc04_services/interface/vchiq_arm >>>>>>>> driver with my >>>>>>>> Raspberry Pi 3 B+ (multi_v7_defconfig) i noticed a huge >>>>>>>> performance >>>>>>>> regression since [ff042f4a9b050895a42cae893cc01fa2ca81b95c] mm: >>>>>>>> lru_cache_disable: replace work queue synchronization with >>>>>>>> synchronize_rcu >>>>>>>> >>>>>>>> Usually i run "vchiq_test -f 1" to see the driver is still >>>>>>>> working [1]. >>>>>>>> >>>>>>>> Before commit: >>>>>>>> >>>>>>>> real    0m1,500s >>>>>>>> user    0m0,068s >>>>>>>> sys    0m0,846s >>>>>>>> >>>>>>>> After commit: >>>>>>>> >>>>>>>> real    7m11,449s >>>>>>>> user    0m2,049s >>>>>>>> sys    0m0,023s >>>>>>>> >>>>>>>> Best regards >>>>>>>> >>>>>>>> [1] - https://github.com/raspberrypi/userland >>>>>>> Please feel free to try the patch shown below.  Or the pair of >>>>>>> patches >>>>>>> from Rik here: >>>>>>> >>>>>>> https://lore.kernel.org/lkml/20220218183114.2867528-2-riel@surriel.com/ >>>>>>> >>>>>>> https://lore.kernel.org/lkml/20220218183114.2867528-3-riel@surriel.com/ >>>>>>> >>>>>> I tried your patch and Rik's patches but in both cases vchiq_test >>>>>> runs 7 >>>>>> minutes instead of ~ 1 second. >>>>> That is surprising.  Do you boot with rcupdate.rcu_normal=1? >>>> No, not explicit. >>>>>    That would >>>>> nullify my patch, but I would expect that Rik's patch would still >>>>> provide >>>>> increased performance even in that case. >>>> I will retest with a fresh SD card image. >>>>> >>>>> Could you please characterize where the slowdown is occurring? >>>> >>>> Unfortunately i don't have a deep insight into driver and >>>> vchiq_test tool. Just a user view. >>>> >>>> Do you think an strace would be a good starting point? >>>> >>>> @Phil Any advices to analyse this issue? >>> >>> Sending many small control packets: >>> >>>    vchiq_test -c 1 10000 >>> >>> essentially tests interrupt latency. Using a small number of large >>> bulk transfers: >>> >>>    vchiq_test -b 10000 1 >>> >>> becomes a test of how long it takes to lock down pages. It also >>> tests DMA transfer speeds, but since the DMA is run by the firmware >>> (which you aren't changing), I think you can rule that. >> Thanks i will try. >>> >>> You may also find it helpful to include "force_turbo=1" in >>> config.txt for more predictable results. >>> >>> By the way, running our 5.18-rc7-based branch on a 3B+ I'm not >>> seeing any performance problems: >> I assume you are using arm/bcm2709_defconfig and not >> arm/multi_v7_defconfig as me? > > That's correct. Simply switching to multi_v7_defconfig breaks vchiq > completely, presumably because it doesn't define CONFIG_BCM2835_VCHIQ. sorry, forgot to mention. I that i enable VCHIQ as module on top of multi_v7_defconfig. > > Phil > >>> >>> pi@raspberrypi:~$ time vchiq_test -f 1 >>> Functional test - iters:1 >>> ======== iteration 1 ======== >>> Testing bulk transfer for alignment. >>> Testing bulk transfer at PAGE_SIZE. >>> >>> real    0m0.512s >>> user    0m0.042s >>> sys     0m0.165s >>> >>> Phil