mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Nuno Sá" <noname.nuno@gmail.com>
To: Jonathan Cameron <Jonathan.Cameron@Huawei.com>,
	Paul Cercueil <paul@crapouillou.net>
Cc: Jonathan Cameron <jic23@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Michael Hennerich <Michael.Hennerich@analog.com>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 0/6] iio: Add buffer write() support
Date: Thu, 31 Aug 2023 13:01:24 +0200	[thread overview]
Message-ID: <066d686946951e270e8fca127d8332c80b6cfac8.camel@gmail.com> (raw)
In-Reply-To: <20230830171836.000045c3@Huawei.com>

On Wed, 2023-08-30 at 17:18 +0100, Jonathan Cameron wrote:
> On Wed, 30 Aug 2023 17:11:18 +0100
> Jonathan Cameron <Jonathan.Cameron@Huawei.com> wrote:
> 
> > On Mon,  7 Aug 2023 13:21:07 +0200
> > Paul Cercueil <paul@crapouillou.net> wrote:
> > 
> > > [V3 was: "iio: new DMABUF based API, v3"][1]
> > > 
> > > Hi Jonathan,
> > > 
> > > This is a subset of my patchset that introduced a new interface based on
> > > DMABUF objects [1]. It adds write() support to the IIO buffer
> > > infrastructure.
> > > 
> > > The reason it is not the full IIO-DMABUF patchset, is because you
> > > requested performance benchmarks - and our current numbers are barely
> > > better (~ +10%) than the fileio interface. There is a good reason for
> > > that: V3 of the patchset switched from having the IIO core creating the
> > > DMABUFs backed by physically contiguous memory, to having the IIO core
> > > being a simple DMABUF importer, and having the DMABUFs created
> > > externally. We now use the udmabuf driver to create those, and they are
> > > allocated from paged memory. While this works perfectly fine, our
> > > buffers are now cut in 4 KiB chunks (pages), non-contiguous in memory,
> > > which causes the DMA hardware to create an IRQ storm, as it raises an
> > > interrupt after each 4 KiB in the worst case scenario.  
> > 
> > Interesting. I'm guessing you don't necessarily need contiguous memory
> > and huge pages would get rid of most of that overhead?
> > 
> > Given embedded target those huge pages are hard to get so you need
> > hugetlb support to improve the chances of it working.  Some quick searching
> > suggests there is possible support on the way.
> > https://lore.kernel.org/linux-mm/20230817064623.3424348-1-vivek.kasireddy@intel.com/
> > 
> > 
> > > 
> > > Anyway, this is not directly a problem of the IIO-DMABUF code - but I
> > > can't really upstream a shiny new interface that I claim is much faster,
> > > without giving numbers.
> > > 
> > > So while we fix this (either by updating the DMA IP and driver to
> > > support scatter-gather)  
> > 
> > Long run you almost always end up needing that unless contig requirements
> > are small and you want a robust solution.  I'm guessing no IOMMU to pretend
> > it's all contiguous... 
> > 
> > > or by hacking something quick to give us
> > > physically contiguous DMABUFs just for the benchmark), I thought it
> > > would make sense to upstream the few patches of the V3 patchset that are
> > > needed for the IIO-DMABUF interface but aren't directly related.  
> > 
> > Good idea.
> > 
> > > 
> > > As for write() support, Nuno (Cc'd) said he will work on upstreaming the
> > > DAC counterpart of adc/adi-axi-adc.c in the next few weeks, so there
> > > will be a user for the buffer write() support. I hope you are okay with
> > > this - otherwise, we can just wait until this work is done and submit it
> > > all at once.  
> > 
> > Absolutely fine, though I won't pick this up without the user also being
> > ready to go.
> 
> 
> Having looked through these again, they are straight forward so no changes
> requested from me.  Nuno, if you can add this set into appropriate
> point in your series that will make use of it that will make my life easier
> and ensure and minor rebasing etc happens without having to bother Paul.
> 

Sure...

- Nuno Sá
> 

      reply	other threads:[~2023-08-31 11:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-07 11:21 Paul Cercueil
2023-08-07 11:21 ` [PATCH v4 1/6] iio: buffer-dma: Get rid of outgoing queue Paul Cercueil
2023-08-07 11:21 ` [PATCH v4 2/6] iio: buffer-dma: Rename iio_dma_buffer_data_available() Paul Cercueil
2023-08-07 11:21 ` [PATCH v4 3/6] iio: buffer-dma: Enable buffer write support Paul Cercueil
2023-08-07 11:21 ` [PATCH v4 4/6] iio: buffer-dma: split iio_dma_buffer_fileio_free() function Paul Cercueil
2023-08-07 11:21 ` [PATCH v4 5/6] iio: buffer-dmaengine: Support specifying buffer direction Paul Cercueil
2023-08-07 11:21 ` [PATCH v4 6/6] iio: buffer-dmaengine: Enable write support Paul Cercueil
2023-08-07 14:12 ` [PATCH v4 0/6] iio: Add buffer write() support Nuno Sá
2023-08-30 16:11 ` Jonathan Cameron
2023-08-30 16:18   ` Jonathan Cameron
2023-08-31 11:01     ` Nuno Sá [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=066d686946951e270e8fca127d8332c80b6cfac8.camel@gmail.com \
    --to=noname.nuno@gmail.com \
    --cc=Jonathan.Cameron@Huawei.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paul@crapouillou.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®