[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 06/12] swiotlb-xen: limit init retries
- To: Juergen Gross <jgross@xxxxxxxx>, Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Tue, 7 Sep 2021 14:06:37 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=YMBMI5yUqKk+WNG37WLHu6TzQ77qqIKUpYH+tOuAlHI=; b=Da6k5Ye+k2Vi9VLypqWRuZSkQeyMNC+cSSE39zUAiLRkduFYRJ3Bx5HXYpzuxn6z/Tk7Gnf/UK4K2r9WKArxDnvYrRrqoMfgPGrPsTvDoRcchKHZCaphgXPD0w+fXVBrx/fgw2JQDHbp0MW5OY87SxLN5sFoiroofFTW7R1E0Vm8KrvWpfbyzjmRXGi2smY9IEx1eE3dDobPr75vbuDhKPLLDN3K1ehhTyeytv/IWfTFIcsnu0TKeDRWia52VdW7I5R8beUl4Tyc/+AucGSR3VPHqVio0yMVJEqMEnzSv7HD2CFLKfI+LCi9w5374GCATCSnxc71nuf/1v0RU2ifdA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R5vf+Dc/6u6YP3qATr/SVEHIz9bTHZ3VENpfiCtFFWXEH8JhbC3SvAzFgo2AsPHCnSqewi4aCG0TsaossKwDSp4vcwkPZiED6I60CRCdCnz8xe2+9fTkd9FGszqFOno38UG7/3kg5Po47bKu0MzzbDJk1nO+HTBbCYybDfPb8xwOdq1jsX+b2MBCgsMHvCDZH+izbK5C0wBzUshPCtqTlbONfFdfFslSVP++oOywbU8wga++rYbtRgHbVeKFNsR6S+tRH+FBsStCjK2glfGyPOUp7tlJd3ncF3jzDn6pvv5M8lKHYukNiMnPUaDZjg67Bb1+HaGB+4hUjNPW8DM0ww==
- Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
- Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, lkml <linux-kernel@xxxxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Tue, 07 Sep 2021 12:06:49 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
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@xxxxxxxx>
--- a/drivers/xen/swiotlb-xen.c
+++ b/drivers/xen/swiotlb-xen.c
@@ -207,7 +207,7 @@ retry:
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 @@ retry:
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;
|