Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3091217rwd; Mon, 22 May 2023 08:31:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Pc4gqV5/HeQMH8fpDcRIOw6ywLs4rLDa6PeIihuSGE9aKyKF3rgdQOaY6Nn2VAeOs8sSF X-Received: by 2002:a05:6a00:18a4:b0:64c:aa98:a69f with SMTP id x36-20020a056a0018a400b0064caa98a69fmr15274216pfh.1.1684769491523; Mon, 22 May 2023 08:31:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684769491; cv=none; d=google.com; s=arc-20160816; b=cC6z+s8XSB8K9vLRG/uf2ChUgytEm38Bzc6oWMSWBuDt9ZBB8r8YRbdM/gh4em5EKt O2RXH1KyJ2wrLdeQ2Vu1ZnQJiy/cvaqGT5j2u2DOhwVDPPe0czkVBxs+FCVXidgxOpIh vLvYIaR0mKjU2LwAk1Iv7+JpgA908d2km8UckFIbtnKYPYydzXX+LC6ukgBHAmk4E7bq K+t9tb0VF9nfdcW22muZpcXXSXHJiuO43RT5X7+cGy+CpV58divVi0rRUcyxjusQe8+l /B4535fCuD987pJRCqnxIpVtxTwPzbpYM+4I5yKakq07kfr8EuLYWe7EW2CeYbKf6l6A 6KNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=c50s/GFxSguAcCWxFNTxqRS+jPmzCv61x8BO/cceIig=; b=XzezFh6G7es+R0LmEmk1TsdPInBNET+/zuJ9ie7jhjDY0FtIfrKFfo4vj2TBpHOW2P qYQVkFeFUy9kXYq7ItR7k/+ODtlxjQQKKBendP9FWtOH0Z6S4eKkdECusT2yfOVjn0MA KuSb5Fi9ACbhq3c5BjLPJNeBsNT5ebDC+wuuTMrvYvhR15PkjyEuvF0sSwk2c3rs0V01 mUaSdZ0iIWLqKkVxbQNXZWvTpz4IVF4LvSMu4JYZkT4QVhQG0pWWJ3tSx9j+goRqtE7m vjT6jm5706+htmYm79olMbJWcfIYpdgzsHaXhMMV8mzvyfhnY6A81HWM4CIEUceXCIeD Ng/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@8bytes.org header.s=default header.b=ye1AkBuf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i9-20020aa796e9000000b0063b1739532esi4964166pfq.139.2023.05.22.08.31.18; Mon, 22 May 2023 08:31:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@8bytes.org header.s=default header.b=ye1AkBuf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233680AbjEVO7C (ORCPT + 99 others); Mon, 22 May 2023 10:59:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231321AbjEVO7A (ORCPT ); Mon, 22 May 2023 10:59:00 -0400 Received: from mail.8bytes.org (mail.8bytes.org [85.214.250.239]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 50853185 for ; Mon, 22 May 2023 07:58:36 -0700 (PDT) Received: from 8bytes.org (p200300c2773e310086ad4f9d2505dd0d.dip0.t-ipconnect.de [IPv6:2003:c2:773e:3100:86ad:4f9d:2505:dd0d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.8bytes.org (Postfix) with ESMTPSA id B14892476DC; Mon, 22 May 2023 16:58:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=8bytes.org; s=default; t=1684767514; bh=lZHPcZFttC8PwMH3huLv0AsmR9poQhlnJzue5QlLdFM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ye1AkBufdcMtnsCFVaACxTZkR8vc5S5B2YWnJIKjPUsnHtsa4j0AwqbkLEWQ8WVPS GZZBIpH7EFJe9trjXQEBF27HhCsipnxq0Xr6Y4Nvk1gVWp4xB+uDsEWQVoit2SzXJI 0a8a0CAOkRIIUc0INZpmtb2ncvDUYLRvFYrYTGITMfo3mpCmInJM/Dz2p+ZEoE2xDI QCm36mNah4TwpMlWgYrgtWeRuy2VL2Z4YMV3yLz4ZPBfsZleS4IRlBFtJ9MEH42Thv FOpCCgfviHrhbFG8EUunsXJLBWhxwKZlGMUaxXRU0lJBle6UDFfnODTEEblN5sKMIc 1wlKFcZyxwuLg== Date: Mon, 22 May 2023 16:58:33 +0200 From: Joerg Roedel To: Vasant Hegde Cc: Jerry Snitselaar , Peng Zhang , Robin Murphy , will@kernel.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, Li Bin , Xie XiuQi , Yang Yingliang , Suravee Suthikulpanit Subject: Re: [PATCH] iommu: Avoid softlockup and rcu stall in fq_flush_timeout(). Message-ID: References: <20230216071148.2060-1-zhangpeng.00@bytedance.com> <7bede423-690c-4f6a-9c23-def4ad08344e@amd.com> <21f69b43-a1e7-6c84-a360-dae410bedb3f@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <21f69b43-a1e7-6c84-a360-dae410bedb3f@amd.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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, On Fri, Apr 28, 2023 at 11:14:54AM +0530, Vasant Hegde wrote: > Ping. Any suggestion on below proposal (schedule work on each CPU to free iova)? Optimizing the flush-timeout path seems to be working on the symptoms rather than the cause. The main question to look into first is why are so many CPUs competing for the IOVA allocator lock. That is a situation which the flush-queue code is there to avoid, obviously it does not scale to the workloads tested here. Any chance to check why? My guess is that the allocations are too big and not covered by the allocation sizes supported by the flush-queue code. But maybe this is something that can be fixed. Or the flush-queue code could even be changed to auto-adapt to allocation patterns of the device driver? Regards, Joerg