Commit cabb7f89 authored by Jan Beulich's avatar Jan Beulich Committed by Juergen Gross

swiotlb-xen: limit init retries

Due to the use of max(1024, ...) there's no point retrying (and issuing
bogus log messages) when the number of slabs is already no larger than
this minimum value.
Signed-off-by: default avatarJan Beulich <jbeulich@suse.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>

Link: https://lore.kernel.org/r/984fa426-2b7b-4b77-5ce8-766619575b7f@suse.comSigned-off-by: default avatarJuergen Gross <jgross@suse.com>
parent 79ca5f77
......@@ -207,7 +207,7 @@ int __ref xen_swiotlb_init(void)
swiotlb_set_max_segment(PAGE_SIZE);
return 0;
error:
if (repeat--) {
if (nslabs > 1024 && repeat--) {
/* Min is 2MB */
nslabs = max(1024UL, ALIGN(nslabs >> 1, IO_TLB_SEGSIZE));
bytes = nslabs << IO_TLB_SHIFT;
......@@ -243,7 +243,7 @@ void __init xen_swiotlb_init_early(void)
rc = xen_swiotlb_fixup(start, nslabs);
if (rc) {
memblock_free(__pa(start), PAGE_ALIGN(bytes));
if (repeat--) {
if (nslabs > 1024 && repeat--) {
/* Min is 2MB */
nslabs = max(1024UL, ALIGN(nslabs >> 1, IO_TLB_SEGSIZE));
bytes = nslabs << IO_TLB_SHIFT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment