From: Robin Murphy <robin.murphy@arm.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Yu Zhao <yuzhao@google.com>,
dongli.zhang@oracle.com, ak@linux.intel.com,
akpm@linux-foundation.org, alexander.sverdlin@nokia.com,
andi.kleen@intel.com, bp@alien8.de, bp@suse.de,
cminyard@mvista.com, corbet@lwn.net,
damien.lemoal@opensource.wdc.com, dave.hansen@linux.intel.com,
iommu@lists.linux-foundation.org, joe.jin@oracle.com,
joe@perches.com, keescook@chromium.org,
kirill.shutemov@intel.com, kys@microsoft.com,
linux-doc@vger.kernel.org, linux-hyperv@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org,
ltykernel@gmail.com, michael.h.kelley@microsoft.com,
mingo@redhat.com, m.szyprowski@samsung.com,
parri.andrea@gmail.com, paulmck@kernel.org, pmladek@suse.com,
rdunlap@infradead.org, tglx@linutronix.de,
thomas.lendacky@amd.com, Tianyu.Lan@microsoft.com,
tsbogend@alpha.franken.de, vkuznets@redhat.com,
wei.liu@kernel.org, x86@kernel.org
Subject: Re: [PATCH v1 4/4] swiotlb: panic if nslabs is too small
Date: Mon, 22 Aug 2022 13:32:32 +0100 [thread overview]
Message-ID: <d5016c1e-55d9-4224-278a-50377d4c6454@arm.com> (raw)
In-Reply-To: <YwNn92WP3rP4ylZu@infradead.org>
On 2022-08-22 12:26, Christoph Hellwig wrote:
> On Mon, Aug 22, 2022 at 10:49:09AM +0100, Robin Murphy wrote:
>> Hmm, it's possible this might be quietly fixed by 20347fca71a3, but either
>> way I'm not sure why we would need to panic *before* we've even tried to
>> allocate anything, when we could simply return with no harm done? If we've
>> ended up calculating (or being told) a buffer size which is too small to be
>> usable, that should be no different to disabling SWIOTLB entirely.
>
> Hmm. I think this might be a philosophical question, but I think
> failing the boot with a clear error report for a configuration that is
> supposed to work but can't is way better than just panicing later on.
Depends which context of "supposed to work" you mean there. The most
logical reason to end up with a tiny SWIOTLB size is because you don't
expect to need SWIOTLB, therefore if there's now a functional minimum
size limit, failing gracefully such that the system keeps working as
before is correct in that context. Even if we assume the expectation
goes the other way, then it should be on SWIOTLB to adjust the initial
allocation size to whatever minimum it now needs, which as I say it
looks like 20347fca71a3 might do anyway. Creating new breakage by
panicking instead of making a decision one way or the other was never
the right answer.
>> Historically, passing "swiotlb=1" on the command line has been used to save
>> memory when the user knows SWIOTLB isn't needed. That should definitely not
>> be allowed to start panicking.
>
> I've never seen swiotlb=1 advertized as a way to disable swiotlb.
> That's always been swiotlb=noforce, which cleanly disables it.
No, it's probably not been advertised as such, but it's what clearly
fell out of the available options before "noforce" was added (which was
considerably more recently than "always"), and the fact is that people
*are* still using it even today (presumably copy-pasted through Android
BSPs since before 4.10).
Thanks,
Robin.
next prev parent reply other threads:[~2022-08-22 12:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20220611082514.37112-5-dongli.zhang@oracle.com>
2022-08-20 1:20 ` [PATCH v1 4/4] swiotlb: panic if nslabs is too small Yu Zhao
2022-08-22 9:49 ` Robin Murphy
2022-08-22 11:26 ` Christoph Hellwig
2022-08-22 12:32 ` Robin Murphy [this message]
2022-08-22 22:27 ` Dongli Zhang
2022-08-22 23:10 ` Yu Zhao
2022-08-22 23:47 ` Dongli Zhang
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=d5016c1e-55d9-4224-278a-50377d4c6454@arm.com \
--to=robin.murphy@arm.com \
--cc=Tianyu.Lan@microsoft.com \
--cc=ak@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=alexander.sverdlin@nokia.com \
--cc=andi.kleen@intel.com \
--cc=bp@alien8.de \
--cc=bp@suse.de \
--cc=cminyard@mvista.com \
--cc=corbet@lwn.net \
--cc=damien.lemoal@opensource.wdc.com \
--cc=dave.hansen@linux.intel.com \
--cc=dongli.zhang@oracle.com \
--cc=hch@infradead.org \
--cc=iommu@lists.linux-foundation.org \
--cc=joe.jin@oracle.com \
--cc=joe@perches.com \
--cc=keescook@chromium.org \
--cc=kirill.shutemov@intel.com \
--cc=kys@microsoft.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=ltykernel@gmail.com \
--cc=m.szyprowski@samsung.com \
--cc=michael.h.kelley@microsoft.com \
--cc=mingo@redhat.com \
--cc=parri.andrea@gmail.com \
--cc=paulmck@kernel.org \
--cc=pmladek@suse.com \
--cc=rdunlap@infradead.org \
--cc=tglx@linutronix.de \
--cc=thomas.lendacky@amd.com \
--cc=tsbogend@alpha.franken.de \
--cc=vkuznets@redhat.com \
--cc=wei.liu@kernel.org \
--cc=x86@kernel.org \
--cc=yuzhao@google.com \
/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