Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1755120ioo; Mon, 23 May 2022 02:29:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxdenAB66PuRW1+6KEAEo4mVFnFAzmeau8fVSEBgHcUVZENzI34p8xLtRiwPZGVpV5fFhp X-Received: by 2002:a17:90a:bc8e:b0:1df:fd2c:1a08 with SMTP id x14-20020a17090abc8e00b001dffd2c1a08mr17195088pjr.243.1653298197965; Mon, 23 May 2022 02:29:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653298197; cv=none; d=google.com; s=arc-20160816; b=Dt5A2L9plc4pyK1D/d6caaS868knAXsOomszfKlFfKfnX81AfxzJ4wt/ejSs3rSWxB tjQKuuYsGWJzt6AcWxI6Cf3SKs/lv4daAoUsVSB3ySWdJdv3ZuqMpvB5qbVzbESP5/yb IFGrF79DhsMih8b+NBEQT7xd3DQ9YoRBhTvAKLc9ciHv8x0l0BIcJ51C41I7bV8qp0Rb K/EtQC6Tg0G00nE5evEgz9SQKNqqAqg6qKSjg7FX/vsyUDNp8qtvAiuQMLSxg2onn645 MqxdglaAvsNKpKBdk6jiEaf/5WkEmO6tDwqxqyyCkhs3rlRqpkNJziwwHDRCmkR40ilM gGow== 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:subject:user-agent:mime-version:date:message-id :dkim-signature; bh=Pnpr494hnLQiQgSniXG4dedtD9vAIlrv2YCFBq6/bJk=; b=q5Wi9M4SlSVab0rOBoBm1IFdAFiehQelO5eQ9Qt3VSZ6o8ELuowvgwVrSvyRL6P9iM PAlgf68DPPxngBFsWCUJL3oQLDV+MhfIXIWTE2dMdQ8KXKvLWg5rBIawIjzSwqtSlSk8 /2X+FUcART/hQbYmRo4fRuy3KkVEQ8hJnjabrdoQAlfTTBCUuuG5cHFYpq59ZtcD39F/ PH3204aJio9n56tX9svBz+FGVjrtCBjGqpDfArGpYlGuJrQ9v2AsChO3pjc/8SE+n9e7 l376mOCXlen5le5sTjm4HuHBoEo7Y3mQxGnNuWg4Q4fmkCmjV6K/APpZuH8/hR5PAsRz msGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@raspberrypi.com header.s=google header.b=RT0d0o+r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=raspberrypi.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id i18-20020a17090332d200b0015ee6096fadsi10911550plr.69.2022.05.23.02.29.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 02:29:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@raspberrypi.com header.s=google header.b=RT0d0o+r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=raspberrypi.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E3ACA49697; Mon, 23 May 2022 02:29:55 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232918AbiEWJ3t (ORCPT + 99 others); Mon, 23 May 2022 05:29:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232917AbiEWJ3q (ORCPT ); Mon, 23 May 2022 05:29:46 -0400 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35E62496A7 for ; Mon, 23 May 2022 02:29:45 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id z17so1487350wmf.1 for ; Mon, 23 May 2022 02:29:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=message-id:date:mime-version:user-agent:subject:to:cc:references :from:in-reply-to:content-transfer-encoding; bh=Pnpr494hnLQiQgSniXG4dedtD9vAIlrv2YCFBq6/bJk=; b=RT0d0o+rGT9eb8OtGLbDP+vie/YBmOdJAGORMRmiTnzK739Xyadin/nUD6vaMhvk9o IsUks9JtWQvggrD1p6QMAGVACssRzUdHNUiyjHY/YY+jORUQjWrW9thr0UIIXpJ07U9C Ia43er3d5Bkq1EQ33yngwcoBal3e5KWHNw4paiSoQomLtU8xIjZ8COxgWDhuxu19j/v+ Ymb7H06vcg8dF83QJhUt37Ex7EArAbHwKmpqZYZzaUjX/3BunO/I3gmiq22q9mtg53V+ ingo0Wbjw8vJWqfhl+cMs01B9pr/zT4B4ACkIh8b+FR+VJV5lQefpFrStl2h+lKtS4DK 0k8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :to:cc:references:from:in-reply-to:content-transfer-encoding; bh=Pnpr494hnLQiQgSniXG4dedtD9vAIlrv2YCFBq6/bJk=; b=ctcPMRHG5JcUPJAIHCpvAujNmDAS2tA+PaKzdMfhmiqqOpQ1uvmrwnO330Imuio4P2 +zqFsFAyfLFg95MCwHJuX0w3mwzomkalEJQSQdCCF4Nmk8oRO2Ojl8nhgKOrsweJessE H/61pM+iTjGCnxxJZpTa3OiSeGq8enS1AOIHFc2V++lDsRc+5tJ1sFEIT1wC7yU0ojVf PfcCjWvNcIDp5/BaKtDlWCpLBQKJvzLrArwOzErZ1+LUvoGswkyLdfGYuWRxLRqwTfR8 mjRN/LvUDP4tC8A8QtvwLWrDD1Y8FwpmSglsNpJ4DiTwd+qWz0drMBRLkmDutn1Jt23L Bk1w== X-Gm-Message-State: AOAM533VClvW/iySF1oaB5EicpFmycFvY2CpwQITX+aul4XHZqDvWxjf 61vbRKM9d7QCh5A9xxtrKgcweg== X-Received: by 2002:a1c:a4c3:0:b0:397:3bf0:d14d with SMTP id n186-20020a1ca4c3000000b003973bf0d14dmr12783340wme.186.1653298183704; Mon, 23 May 2022 02:29:43 -0700 (PDT) Received: from ?IPV6:2a00:1098:3142:14:3110:d736:2a7:6aff? ([2a00:1098:3142:14:3110:d736:2a7:6aff]) by smtp.gmail.com with ESMTPSA id l16-20020a1c7910000000b003972dcfb614sm9260131wme.14.2022.05.23.02.29.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 23 May 2022 02:29:43 -0700 (PDT) Message-ID: <58cb7fbb-d317-83e6-0427-d3f3944b24b8@raspberrypi.com> Date: Mon, 23 May 2022 10:29:42 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: vchiq: Performance regression since 5.18-rc1 To: Stefan Wahren , 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> From: Phil Elwell In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 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. 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: 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