From: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-nvme@lists.infradead.org, corbet@lwn.net,
rmk+kernel@arm.linux.org.uk, keith.busch@intel.com, axboe@fb.com,
benh@kernel.crashing.org, mpe@ellerman.id.au,
k.kozlowski@samsung.com
Subject: Re: [PATCH v4 0/3] dma-mapping, powerpc, nvme: introduce the DMA_ATTR_NO_WARN attribute
Date: Thu, 4 Aug 2016 21:17:27 -0300 [thread overview]
Message-ID: <57A3DB17.3060603@linux.vnet.ibm.com> (raw)
In-Reply-To: <20160804150145.fb5690e9a873121db1dfa0b1@linux-foundation.org>
Andrew,
On 08/04/2016 07:01 PM, Andrew Morton wrote:
> It would help to have seen an example of the error message - please
> always quote such things when fixing bugs.
Indeed; okay.
The error messages are several blocks like this one:
ppc_iommu_map_sg: 11784 callbacks suppressed
nvme 0001:01:00.0: iommu_alloc failed, tbl c00001965c5ca400 vaddr
c000018faa7b0000 npages 16
nvme 0001:01:00.0: iommu_alloc failed, tbl c00001965c5ca400 vaddr
c000018faa9b0000 npages 16
<repeat>
> I assume the warnings are coming via nvme_map_data()'s call to
> blk_rq_map_sg()? [snip]
If I understand the point in the question correctly -- actually not,
the warnings are coming via:
nvme_map_data()
-> dma_map_sg[_attrs]()
-> dma_map_ops.map_sg()
(dma_map_ops = dma_iommu_ops @ arch/powerpc/kernel/iommu.c)
-> dma_iommu_map_sg()
-> ppc_iommu_map_sg() /* as seen above */
And from what I could observe, the blk_rq_map_sg() path doesn't end
up in there.
> [snip] An alternative (and more idiomatic) fix would be to
> change the blk_rq_map_sg() interface to permit passing down some
> foo_NOWARN flag and propagating that down the stack into
> ppc_iommu_map_sg(). Was this approach evaluated? I suspect it might
> be messy.
I see; I haven't evaluated that, but agree with you it might be messy.
As far as I can see, in order to pass something to blk_rq_map_sg() and
have it eventually make into ppc_iommu_map_sg(), that something should
be present in the scatterlist -- which seems to be what's common/passed
to both blk_rq_map_sg() (the interface point proposed) and dma_map_sg()
(which is the function which reaches ppc_iommu_map_sg() down the chain).
It seems a bit hidden, and (if I got the suggestion right), it doesn't
seem to be in the scope of scatterlist to contain such a flag.
One point of the patches is make the attribute visible/explicit; I see
it can be inconvenient sometimes, but it allows for a clear / evident
difference between dma_map_sg() calls which are (not) OK with failures.
(for example, the 2 calls in nvme_map_data() - they can return either
BLK_MQ_RQ_QUEUE_BUSY or BLK_MQ_RQ_QUEUE_ERROR - so the former is OK.)
Does that make sense?
Thanks for the review.
--
Mauricio Faria de Oliveira
IBM Linux Technology Center
next prev parent reply other threads:[~2016-08-05 0:18 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-01 22:59 [PATCH v4 0/3] dma-mapping, powerpc, nvme: introduce the DMA_ATTR_NO_WARN attribute Mauricio Faria de Oliveira
2016-08-01 22:59 ` [PATCH 1/3] dma-mapping: " Mauricio Faria de Oliveira
2016-08-01 22:59 ` [PATCH 2/3] powerpc: implement " Mauricio Faria de Oliveira
2016-08-01 22:59 ` [PATCH 3/3] nvme: use " Mauricio Faria de Oliveira
2016-08-04 22:01 ` [PATCH v4 0/3] dma-mapping, powerpc, nvme: introduce " Andrew Morton
2016-08-05 0:17 ` Mauricio Faria de Oliveira [this message]
2016-08-05 1:05 ` Andrew Morton
2016-08-05 12:34 ` Mauricio Faria de Oliveira
2016-08-05 17:01 ` Andrew Morton
2016-08-08 13:38 ` Mauricio Faria de Oliveira
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=57A3DB17.3060603@linux.vnet.ibm.com \
--to=mauricfo@linux.vnet.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=axboe@fb.com \
--cc=benh@kernel.crashing.org \
--cc=corbet@lwn.net \
--cc=k.kozlowski@samsung.com \
--cc=keith.busch@intel.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=mpe@ellerman.id.au \
--cc=rmk+kernel@arm.linux.org.uk \
/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;
as well as URLs for NNTP newsgroup(s).