Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp3668477pxb; Tue, 7 Sep 2021 05:08:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1/zfrvVdemXqPoINchL+ZFlm0iEzGe9nDISn0TbfvzDjYUa1v7cxWR28kO/HhGkOwjhPW X-Received: by 2002:a92:6b0a:: with SMTP id g10mr2317988ilc.27.1631016522930; Tue, 07 Sep 2021 05:08:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1631016522; cv=pass; d=google.com; s=arc-20160816; b=dFQM3OGFV7m1IoaMkY9wVBbqc8DNjb1QVhOnq3Sy8VzGRb6QjepgM6brmURwbciKwV k+ZWhHFc91Mzd+yEgvibiUukZ61L20YfkWXi7KMNBTNq1sqYJJRKd6t/la6IgyYaQMbD 8QmNMRgOyj2CBJTGrNnTmwxV1RSK8XBwUYzofF1HGEoDTbYHXo+NOiotdX5yERoPysGi 3RonEqEg8Okv2x9VpngOuoothmg+g0+9pkl1K5XV1PWzLOoKi4aW+UDtv7jC5vL89dnI GV5sau1QzSXpiCYmyeO+LxZ/zkCwtaUAkuUdt/uvqgrRvRAjQU9baEE+mTtKVowDBKUA l+iA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:in-reply-to:user-agent:date:message-id:references :cc:to:from:subject:dkim-signature; bh=YMBMI5yUqKk+WNG37WLHu6TzQ77qqIKUpYH+tOuAlHI=; b=VBFxxnhdPZxC+Dhk2hCeOKXC70i6FGCj9Re1fq+w9YUsBZ94CJuWnwL76+pDmdt8yL 6UaSnazPAyJeav3TwgAgZfOTYURJr9aNzCOarXVoK7L4V/0VFjm56SLXYa10XyruaNw0 SI+AKev4yRhhJCDA9x43GP4+pH/J2byeBDLvgO/SeRp7A8a/vOt0AjBbmtmubIQVdwtj 8ahmsH1t+6VAlCzApgZj+qV1aGUtgSsAiHvY9yKxfle9K48tc+OUMxSLCr4VTo2GswXX O74130HmZ3DfWwMf1yoQD7zgSzPN9EO1wwYVK/WCh5rrISuliO3t7VeHjFTTzPbtUwEv 4aEA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=mimecast20200619 header.b=LnltSzSp; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i13si9488710ilk.122.2021.09.07.05.08.31; Tue, 07 Sep 2021 05:08:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=mimecast20200619 header.b=LnltSzSp; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245278AbhIGMHt (ORCPT + 99 others); Tue, 7 Sep 2021 08:07:49 -0400 Received: from de-smtp-delivery-102.mimecast.com ([194.104.109.102]:55866 "EHLO de-smtp-delivery-102.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343847AbhIGMHs (ORCPT ); Tue, 7 Sep 2021 08:07:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1631016401; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YMBMI5yUqKk+WNG37WLHu6TzQ77qqIKUpYH+tOuAlHI=; b=LnltSzSpfkqB1ibig/iG80wXL18RO73FeO25lVZsLxex56VSyOmH4QOhOCVtUDNH6ScK+W SQyvcRT21WXI+N4QkR1CfJsqAa9Gfeo/mpZpB93u/WcGvxLrAe1/WVw07zH01AlTGkc7Ma MeCTxdk/dHUFpg6kdaO30u2aQPj2dIY= Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01lp2059.outbound.protection.outlook.com [104.47.0.59]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-25-Gwi4fgkDP9eCN2J82GTPhw-1; Tue, 07 Sep 2021 14:06:40 +0200 X-MC-Unique: Gwi4fgkDP9eCN2J82GTPhw-1 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== 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-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 Authentication-Results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com; Received: from VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) by VI1PR0401MB2335.eurprd04.prod.outlook.com (2603:10a6:800:2e::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.19; Tue, 7 Sep 2021 12:06:39 +0000 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b]) by VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b%7]) with mapi id 15.20.4500.014; Tue, 7 Sep 2021 12:06:38 +0000 Subject: [PATCH 06/12] swiotlb-xen: limit init retries From: Jan Beulich To: Juergen Gross , Boris Ostrovsky Cc: Stefano Stabellini , lkml , "xen-devel@lists.xenproject.org" References: <588b3e6d-2682-160c-468e-44ca4867a570@suse.com> Message-ID: <984fa426-2b7b-4b77-5ce8-766619575b7f@suse.com> Date: Tue, 7 Sep 2021 14:06:37 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 In-Reply-To: <588b3e6d-2682-160c-468e-44ca4867a570@suse.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: PR1PR01CA0018.eurprd01.prod.exchangelabs.com (2603:10a6:102::31) To VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [10.156.60.236] (37.24.206.209) by PR1PR01CA0018.eurprd01.prod.exchangelabs.com (2603:10a6:102::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Tue, 7 Sep 2021 12:06:38 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e87e0e46-93b6-442d-684d-08d971f7f265 X-MS-TrafficTypeDiagnostic: VI1PR0401MB2335: X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6p+jxvZNvlchQnDd2qOjDZwFxL66V8vytE1+ZIOz6IgenMe4qgcjUe2VdKNwxqWWpLmxNEO5itjH8OxfIp8DFLXER0IjypKgRhABvRwDn8jh42qUTzm1R+jdDvtBezSvx07I8YMpvzR3kXvZ5VLOu0QfEGNa21xb9gd8Y6brn7Kz1P5EKPdnj2xtXXvF35oHvaWdQV1iy2G94lY8JfW+PIGvRddoJqYS8LHMu+W50VF+IGO+CFdt4bkua/aDTBtnCYoiVrptQR6f8nBqnEP/xgL4ZyXPe2gQ6YaGvb+jhb5ha5eSH+3M9ctVX2ppJ+9twQGNwtEwSPFpWkl/1PDLmcT+ndTFg9Rp4osmZXpd0pF3SQbdp83JFPNST9s8Ik4Tr6xh+YktesFbg6qZNqrec9yBPDqT8PqTByhVzvko9xDAAEhzGtoW+uItXp1fiI6QKxMAaTC9x8C1WhA2DvRew+fNCR04p845+JOSXgpZDB+NmM4aBaKMuHH5lf1vLCkQom3BVDZNn/A3CoXiRLxIjEOQD1ctXk35BEBu2PeIpUxKp5fGXvJe2iw+zLl9DI360OHCsOI8EuubFxDe5bESM9RLe+1EC6xYEgROXhIW64IIcm0VxcfcoJq05iFOt7JSRAyS0GVoWxz+zyaAYe3M/wVcfkmhi6bMYMhxHOofggi0Ej/aKfwNi8cl1eunZJWXFAW4JXx/YSAd+7sxKdz6Kw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5600.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(39860400002)(376002)(366004)(136003)(396003)(346002)(2616005)(8676002)(5660300002)(38100700002)(54906003)(110136005)(83380400001)(956004)(66476007)(66556008)(66946007)(4744005)(26005)(316002)(6486002)(31686004)(8936002)(16576012)(36756003)(4326008)(2906002)(478600001)(186003)(86362001)(31696002)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SVR3TXNZeUpyTWZVWGIzdUhYM1E2aUNtTUFSeHdLVy9WMEd5REdBcVM0bkRp?= =?utf-8?B?dW4wc2crNU1xTUFhOVIvcHgwdnJwMWVJSk1sTUJFTW5mY2NMUmZlUWxrYWh2?= =?utf-8?B?SHZtZzFqQndVcjRVWFlLOWY2MGtMUHRFTG05cGF5QTNlekR4U1drT3JycUtL?= =?utf-8?B?WW5ZMXEzekkrK09PNkRaWUZrdTFEb2NVaXR4emhlanV5TFBGYTUzWStuUnFv?= =?utf-8?B?RzgycExKUmgyZ01pZ1N1dW41VDlEQkN6UFlncUFXR3R5U1lkbEw1TThMRmc5?= =?utf-8?B?cGZRMEE3YzdjOGRyQ1VoMWxTQXR1VGtKckJ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ptSjRWTFlsQ2JDRzdWNkZqZ2UvVllnZEtxbUY2?= =?utf-8?B?UTR1ZGs1RnlwL0FPeUJjeXA4L2ZMN0hoeTc4VFFjcDZ2clIvRHgvUHd1WmdS?= =?utf-8?B?Q1pIMStKRldZRFk0NHM0VHhta2R1R3hrNG1NUHlJbjhYRm9HaGFGczV3OE1T?= =?utf-8?B?UmhLQW1RN2wxeTdFV0VSZmJVNytBZFVTZjlNeVlSYktQWXNvbkFsVENtNzl4?= =?utf-8?B?cXB5NnVaRmJ0aU9lQlJtRUdoQlRYcTlualQ0YmpFVi9KSHhteU10Z040TVo4?= =?utf-8?B?d21PT3duWmp0cUtRUzZvQk95RG1jYmZ3VzZqcUExSjJzNjV4dFY4Qk94K0tt?= =?utf-8?B?T2FoQUQ5c3JjVTh1SWkrcWR2MWdjcFd6NUU5VUdWRW1xZWhjT1N2VFJWWGVN?= =?utf-8?B?MUJlVUxYaURCbUZJajV6SW5tTStLVE1BQ051aDBlSS96Yy9WeXVNN1BBZktq?= =?utf-8?B?Vm1zMEhJbnZqbVd3dCtxZjgyMlkxM2RQTmo1NmtucWJXSzYwUU9iNmQxOFd2?= =?utf-8?Q?ADFcBANdJhD8VY3lNsPOeRWZU7k3yVq0sCVDFF6?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: e87e0e46-93b6-442d-684d-08d971f7f265 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5600.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2021 12:06:38.8548 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Ph2AurSgsXAZiupuP2pvXbNulkvCbwBmtN+9q0Zh1ffPH8Wymh+4lbKcDL4jZkQDrkFawmyk3YKAt4Eu+kBM1g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2335 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 --- 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;