Skip to content

Commit cabb7f8

Browse files
jbeulichjgross1
authored andcommitted
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: Jan Beulich <jbeulich@suse.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/984fa426-2b7b-4b77-5ce8-766619575b7f@suse.com Signed-off-by: Juergen Gross <jgross@suse.com>
1 parent 79ca5f7 commit cabb7f8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/xen/swiotlb-xen.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ int __ref xen_swiotlb_init(void)
207207
swiotlb_set_max_segment(PAGE_SIZE);
208208
return 0;
209209
error:
210-
if (repeat--) {
210+
if (nslabs > 1024 && repeat--) {
211211
/* Min is 2MB */
212212
nslabs = max(1024UL, ALIGN(nslabs >> 1, IO_TLB_SEGSIZE));
213213
bytes = nslabs << IO_TLB_SHIFT;
@@ -243,7 +243,7 @@ void __init xen_swiotlb_init_early(void)
243243
rc = xen_swiotlb_fixup(start, nslabs);
244244
if (rc) {
245245
memblock_free(__pa(start), PAGE_ALIGN(bytes));
246-
if (repeat--) {
246+
if (nslabs > 1024 && repeat--) {
247247
/* Min is 2MB */
248248
nslabs = max(1024UL, ALIGN(nslabs >> 1, IO_TLB_SEGSIZE));
249249
bytes = nslabs << IO_TLB_SHIFT;

0 commit comments

Comments
 (0)