[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] swiotlb: set IO TLB segment size via cmdline
- To: Roman Skakun <rm.skakun@xxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Wed, 15 Sep 2021 15:49:52 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=xRs3iwL2GN66k/6W48nYP2N7/4zO4rIJIIkNfYSSLuQ=; b=hKb/3wEDzOgnV/lOG4ccZJk/VLhvDji9RO9J29oqaWtt7jrqqabQAy5xJwnxbFUpMIB/PpH8XcBDUc8c0sWqtAv4kWqbV3Fj8MIZn394lkPvohXzl9vJRq28Eukaa5/6KfH9EvPYWd1Ag2Vmu5LjYncxfwKiBmucvWmmPXry1a/fjVlvkt48AdY9yPMHJRmr3F4mYTroB/plskIYjsgYQzathTtAFRkL+pxT5MW5iCcgTbbTqpnHevAvkdMVf1y5N5uNZavsLIyv+xvY3h2y91LXfTi4D42g0TG9jVoVtPYM16l5Sn4cf7VA3GMQJeTVhR4cgVbX1U2pl33FT+WBfg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y8lt9p1Y+LIdUdIgr3fuIzarCZseiGSmYopU30G98+zDs5fp8kr+3twLEoIAcdiv+ka28ZTfxgcTHkGTMxrBqvYpYjx1MHs7jK3ZmZTos43BXkCSuPeRbHKh2hFmmSMFzZ4dcpkaQOJXH9jVzXT16OgriX01UKvToVcVfM15meWUvUDtVZwkNk+BV9q16Wx/BBKPGB8IuP6/phvRsLiyBAV+aXIoQhLnsDoKv/eFi76IuvpcBkb3T8nQsKZo3iDnpNgnHNpd7ZFkzLu5jAa/Mr5G8uzzgik7XKPtZTlxbfRAAq0ZAMUGs5fVSp/ccjgPN3tHo75an6DuYDu7IzkdhQ==
- Authentication-results: lists.linux-foundation.org; dkim=none (message not signed) header.d=none;lists.linux-foundation.org; dmarc=none action=none header.from=suse.com;
- Cc: Andrii Anisov <andrii_anisov@xxxxxxxx>, Roman Skakun <roman_skakun@xxxxxxxx>, Jonathan Corbet <corbet@xxxxxxx>, Thomas Bogendoerfer <tsbogend@xxxxxxxxxxxxxxxx>, Michael Ellerman <mpe@xxxxxxxxxxxxxx>, Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>, Paul Mackerras <paulus@xxxxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>, Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Christoph Hellwig <hch@xxxxxx>, Marek Szyprowski <m.szyprowski@xxxxxxxxxxx>, Robin Murphy <robin.murphy@xxxxxxx>, "Paul E. McKenney" <paulmck@xxxxxxxxxx>, Randy Dunlap <rdunlap@xxxxxxxxxxxxx>, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, "Maciej W. Rozycki" <macro@xxxxxxxxxxx>, Muchun Song <songmuchun@xxxxxxxxxxxxx>, Viresh Kumar <viresh.kumar@xxxxxxxxxx>, Peter Zijlstra <peterz@xxxxxxxxxxxxx>, Lu Baolu <baolu.lu@xxxxxxxxxxxxxxx>, Mike Rapoport <rppt@xxxxxxxxxx>, Will Deacon <will@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-mips@xxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx, linux-doc@xxxxxxxxxxxxxxx, Linux Kernel Mailing List <linux-kernel@xxxxxxxxxxxxxxx>, iommu <iommu@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Wed, 15 Sep 2021 13:50:12 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 15.09.2021 15:37, Roman Skakun wrote:
>>> From: Roman Skakun <roman_skakun@xxxxxxxx>
>>>
>>> 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 "intended
>> 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) = 262144
> bytes, but we requested 3686400 bytes.
> When I change IO_TLB_SEGSIZE to 2048. (2048(IO_TLB_SEGSIZE) *
> 2048(IO_TLB_SHIFT) = 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
|