Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5862892pxb; Mon, 14 Feb 2022 09:16:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJxkoHZy4GArnZ5dwewFIt2wa+SMVmbYfWblnb7bUy3hwOCaOXX8qWyifiTMqV/nutr7hrrf X-Received: by 2002:a17:907:3e83:: with SMTP id hs3mr511031ejc.16.1644858975825; Mon, 14 Feb 2022 09:16:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644858975; cv=none; d=google.com; s=arc-20160816; b=el/M411EzCiq/s2Lk9pf2a3JVYbanpzcBcvEQs17um4PcvRbFAREJngkgU+obkoam8 SdaK3m4C76SF0VFLKf0qOBMGJ2MU1Mrh17Y11OVbpKgxrul/n9rWotFYNoMTKHRZ/hQ8 Twk8YfuI9mqTbaVxx8HjKhLhDu+r5RAsHYnBeKYS4JJFKbuMI67LDc3yKIUuZ4lM3KJF LNtN5ibheaQBdLbF65HWjFVr9pH9i7PzJTtKWRRdvVxH1yoQAaSR2jEWlQPjW3CCMP5g FksmIDhZBWXzvgCqUa3MGMFyz51yUcEhmTGKhe8xoxkEHhQhHL1IrfeApHPCqTCLyjUk KP2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=JFp0dM6i5lCjbFqI6T7sKCv0Ja+jgZ4pHtNjHFgqnyg=; b=v+EGEoPLLC3teqpcOs2bNI3gwwszx1Pbo/0Mm5q0GXqfKalFUw6dnly3WVopQ9z3vo zMK8UMq4z9QIFtwXu3J5YGWvNwig+QsDH5GESsMbSpzriWNuE3uJ5GdBDUiY+mUxleXu D1d7BHJCYrmFY4/W/giSLwt7q2Jk4PnFo8YgJzzeQ7Sj0DuOMpN/tIay/7n+hm2zZHU0 WEVvUU3aUv6DElgBBrxoJ677uqY7tSuPUntQpXTgz23nH9u7Jiyo+CSrRpS4pK9rvEaY xWPZVNNMWP9VXzfEbSGzZadqfWEoXjOS3LK/DlJtLj+sPUoxj35xTq4Wo9cI7YmrfFbz J7uQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qw8si13036449ejc.511.2022.02.14.09.15.51; Mon, 14 Feb 2022 09:16:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355280AbiBNOpX (ORCPT + 99 others); Mon, 14 Feb 2022 09:45:23 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:49562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229517AbiBNOpW (ORCPT ); Mon, 14 Feb 2022 09:45:22 -0500 Received: from theia.8bytes.org (8bytes.org [IPv6:2a01:238:4383:600:38bc:a715:4b6d:a889]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6904F4AE3A for ; Mon, 14 Feb 2022 06:45:14 -0800 (PST) Received: by theia.8bytes.org (Postfix, from userid 1000) id A0171374; Mon, 14 Feb 2022 15:45:12 +0100 (CET) Date: Mon, 14 Feb 2022 15:45:11 +0100 From: Joerg Roedel To: John Garry Cc: will@kernel.org, mst@redhat.com, jasowang@redhat.com, robin.murphy@arm.com, xieyongji@bytedance.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, linuxarm@huawei.com Subject: Re: [PATCH v2] iommu/iova: Separate out rcache init Message-ID: References: <1643882360-241739-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1643882360-241739-1-git-send-email-john.garry@huawei.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 03, 2022 at 05:59:20PM +0800, John Garry wrote: > Currently the rcache structures are allocated for all IOVA domains, even if > they do not use "fast" alloc+free interface. This is wasteful of memory. > > In addition, fails in init_iova_rcaches() are not handled safely, which is > less than ideal. > > Make "fast" users call a separate rcache init explicitly, which includes > error checking. > > Signed-off-by: John Garry Applied, thanks.