Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2565011pxb; Fri, 17 Sep 2021 12:48:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQWJFThJ5KsfIi7wfI0d6+ZNy58QK6KhMvJk9PX+4wx3cM+DATJOHHwoCgtdVolLm3elTo X-Received: by 2002:a6b:3e89:: with SMTP id l131mr9959164ioa.74.1631908113529; Fri, 17 Sep 2021 12:48:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631908113; cv=none; d=google.com; s=arc-20160816; b=paMfLa9tj1C4m4XilKyX6IhRgE6InZDE1uYMjHcqb22WLkr9uYOTptLBMxrusBSGBl X3StZ4PCt0rXld/mnvDsRF5i/+bT/jiklDcDa4v94wyXKwYYzzEkFeym6RAhGQl/rWAE 2v9hLfitAiLVtiHkDzJeHGCNLFG7GihbF7jlcKSJq/eX9qKGJBbzCLBkFZEKbAFUqSPa Pmd1lcB13kLFGJjABOuqrn3DYZvR7Z4YGt8I5rZfxd5ugJuzLrESW+Nd6J/pHXJtBKE2 wWugcv/SrrSJ64l3w7cs6WheDuEEe7W+4sgyoa7HLUtn3m8NqqU0+XCsDY5YW33UDGlL /aSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=GwPKvHPa7SWPdAxFNaWPHxr/qhyv9zoje0np7fedQKE=; b=jqxUhU6KUlcdvNB7RUZFjNJICJJsJAC7Nqb7LazMJnmTmO6E4iz+L69Cdt1braSzs4 LNgIzhwzaTAs/NI7vXDe6CRffCkq9uswjs/593gX/sfTwkhhNafWRSIgw2/W9D+Hsdex jVGb7SnQSOGKvKox78lMsD3CUXN01pyvSvzVixa7MRkXiQkc/UjwwshqaPLSjK+F+42j x+z4FmNy3ZpQdjyzQBFWukrI7Iqvo7wBFlbuzyEOezhWHGYFteKAHu6pr6zskrnhQa4X 9ahIyh56mKT6K18SzZjC6OiuVG0mWkAwj3+47XzzW9bsQu93/hWqkm+qydlHvtGN1ZbL AVJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=WPqhGp7Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y15si5561354ilv.67.2021.09.17.12.48.20; Fri, 17 Sep 2021 12:48:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=WPqhGp7Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241879AbhIQKyl (ORCPT + 99 others); Fri, 17 Sep 2021 06:54:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240684AbhIQKyk (ORCPT ); Fri, 17 Sep 2021 06:54:40 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13435C061574; Fri, 17 Sep 2021 03:53:18 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id d42so9657365lfv.10; Fri, 17 Sep 2021 03:53:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=GwPKvHPa7SWPdAxFNaWPHxr/qhyv9zoje0np7fedQKE=; b=WPqhGp7YFJx9AUCevICXrAodjCpr6nIpm2Ih1DUPRgTO2JIO4D88GB1S962YfHO9vm DRezWJVTxjj9rs0AZRWxJOWrvy9r+qKMeskCPE927IzPuRXFDgRa2iadYLcTMOd/64+4 nzSruXNpaJKUZ/QJMboU8PnvfhM3HxH1/+n2Hxdlkx7TK9deyd8BenrLblqAQ+bMgzVD B6WKlUg0EoDvkkaNdaR+KyTdmSq6OG0BlpLoAPZbqIl9QPO8MWAsO5TjFbpFLhkwDdr4 XYe66QAT2Ou7DTn+qqH8GubuMGhG8e16UInR2xW2MYta03lHYWn05LHNPgYs5vhLU3q9 bpYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=GwPKvHPa7SWPdAxFNaWPHxr/qhyv9zoje0np7fedQKE=; b=T0LpQ8w5B8lTJvVNTMlI+TgfdBMRT/MrX/qcfPOoy5mJM3JH8sh60RsisntFYzx689 xGvyC067l7gigDRi9rWMGjFHmOwtd442hW0fFlapNp6iQ1ijN3b6x9eBuzwBetdRecUc HQobn7I8+pMnc3auDM2tmhbukFc0VfGa2A1dgrBA/EaTb1SPW66LHHM5DjQ0utk4+GBd F64TCVbhhMrx1MEOtAI9k5Ae24VSwYOw4MEoN3ebjeL3v9aqxQQuLi9ACNNrba3w6mCa yBiwoZm4wu0yTWppFIaxFrdb3NkVFa1UFHrUzPOBaZ7Y3mNkW26BmKwsyHyL/AYQ58Qu 8CTg== X-Gm-Message-State: AOAM5322pmm2JT2tao4FGiQcjQKwLkkWhbjEsz8IOOwiDPYrgm0K2Ruk eebLOs8k70EQDetaG+yYiDh1mA1h2EP7G+FTYA0+0OWOUOYORA== X-Received: by 2002:ac2:5310:: with SMTP id c16mr7346042lfh.393.1631875996413; Fri, 17 Sep 2021 03:53:16 -0700 (PDT) MIME-Version: 1.0 References: <20210914151016.3174924-1-Roman_Skakun@epam.com> <7c04db79-7de1-93ff-0908-9bad60a287b9@suse.com> <84ef7ff7-2c9c-113a-4a2c-cef54a6ded51@suse.com> In-Reply-To: <84ef7ff7-2c9c-113a-4a2c-cef54a6ded51@suse.com> From: Roman Skakun Date: Fri, 17 Sep 2021 13:53:05 +0300 Message-ID: Subject: Re: [PATCH] swiotlb: set IO TLB segment size via cmdline To: Jan Beulich Cc: Andrii Anisov , Roman Skakun , Jonathan Corbet , Thomas Bogendoerfer , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Konrad Rzeszutek Wilk , Boris Ostrovsky , Juergen Gross , Stefano Stabellini , Christoph Hellwig , Marek Szyprowski , Robin Murphy , "Paul E. McKenney" , Randy Dunlap , Andrew Morton , Thomas Gleixner , "Maciej W. Rozycki" , Muchun Song , Viresh Kumar , Peter Zijlstra , Lu Baolu , Mike Rapoport , Will Deacon , xen-devel@lists.xenproject.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-doc@vger.kernel.org, Linux Kernel Mailing List , iommu Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jan, >>> In order to be sure to catch all uses like this one (including ones >>> which make it upstream in parallel to yours), I think you will want >>> to rename the original IO_TLB_SEGSIZE to e.g. IO_TLB_DEFAULT_SEGSIZE. >> >> I don't understand your point. Can you clarify this? > > There's a concrete present example: I have a patch pending adding > another use of IO_TLB_SEGSIZE. This use would need to be replaced > like you do here in several places. The need for the additional > replacement would be quite obvious (from a build failure) if you > renamed the manifest constant. Without renaming, it'll take > someone running into an issue on a live system, which I consider > far worse. This is because a simple re-basing of one of the > patches on top of the other will not point out the need for the > extra replacement, nor would a test build (with both patches in > place). It's reasonable. I will change the original IO_TLB_SEGSIZE to IO_TLB_DEFAULT_SEGSIZE in the next patch series. Thanks. =D1=81=D1=80, 15 =D1=81=D0=B5=D0=BD=D1=82. 2021 =D0=B3. =D0=B2 16:50, Jan B= eulich : > > On 15.09.2021 15:37, Roman Skakun wrote: > >>> From: Roman Skakun > >>> > >>> It is possible when default IO TLB size is not > >>> enough to fit a long buffers as described here [1]. > >>> > >>> This patch makes a way to set this parameter > >>> using cmdline instead of recompiling a kernel. > >>> > >>> [1] https://www.xilinx.com/support/answers/72694.html > >> > >> I'm not convinced the swiotlb use describe there falls under "intende= d > >> use" - mapping a 1280x720 framebuffer in a single chunk? > > > > I had the same issue while mapping DMA chuck ~4MB for gem fb when > > using xen vdispl. > > I got the next log: > > [ 142.030421] rcar-fcp fea2f000.fcp: swiotlb buffer is full (sz: > > 3686400 bytes), total 32768 (slots), used 32 (slots) > > > > It happened when I tried to map bounce buffer, which has a large size. > > The default size if 128(IO_TLB_SEGSIZE) * 2048(IO_TLB_SHIFT) =3D 262144 > > bytes, but we requested 3686400 bytes. > > When I change IO_TLB_SEGSIZE to 2048. (2048(IO_TLB_SEGSIZE) * > > 2048(IO_TLB_SHIFT) =3D 4194304bytes). > > It makes possible to retrieve a bounce buffer for requested size. > > After changing this value, the problem is gone. > > But the question remains: Why does the framebuffer need to be mapped > in a single giant chunk? > > >> In order to be sure to catch all uses like this one (including ones > >> which make it upstream in parallel to yours), I think you will want > >> to rename the original IO_TLB_SEGSIZE to e.g. IO_TLB_DEFAULT_SEGSIZE. > > > > I don't understand your point. Can you clarify this? > > There's a concrete present example: I have a patch pending adding > another use of IO_TLB_SEGSIZE. This use would need to be replaced > like you do here in several places. The need for the additional > replacement would be quite obvious (from a build failure) if you > renamed the manifest constant. Without renaming, it'll take > someone running into an issue on a live system, which I consider > far worse. This is because a simple re-basing of one of the > patches on top of the other will not point out the need for the > extra replacement, nor would a test build (with both patches in > place). > > Jan > --=20 Best Regards, Roman.