Received: by 2002:ac0:c50a:0:0:0:0:0 with SMTP id y10csp1172079imi; Fri, 1 Jul 2022 04:44:25 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uwytGHwDgBAKy+C0PYuj1jYlCflcvJKvhU4MthYL+ViHIhVQ1wu6oeK2nemPCOP23HCtWQ X-Received: by 2002:a05:6a00:9a2:b0:505:974f:9fd6 with SMTP id u34-20020a056a0009a200b00505974f9fd6mr21048121pfg.12.1656675865212; Fri, 01 Jul 2022 04:44:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656675865; cv=none; d=google.com; s=arc-20160816; b=FO9vzkOxqoRG9QFa9ZeKYOvmwMETI2u1LKtDgRhawVy8EjXupnyCpS+/95yZYhhyZy bJswB91oBNf76m4DM65E8TPVGNCvf/dCjbELqY7F9QyHaeAi6isphKf0bovQjC+LDmFj YNI8NzMikbEEmu0hDLmdQ0HlFQBp6NE/ZVKxJ/7AwKwz4rfIbNSgWoVAFvZkjBbKGHUW 90qP3TmVNvoi01cyiwdbUwekMW17z/UbupFBtcEYVEn/Tw0zmBG8Bnh77dr80p4kokV2 39OqjwEBpJsiaU4TtFfnJDWZsO5MHA0wB3QgTanL+MKksoHo9WmX6AHGC1WYKMuHcxpm LRBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=uF/LW6i3L/gPdgFeO4qb3jid183OPAoSjhcn2rNEMVI=; b=xeRnQCNcnZ5Hr1JFykhdiNmaEkkh0uJE5w9UbMYfqi2kFmTmkgP0pp8hJiKh2q+tsA INuRJYDCJOQiUvOvMnoPZW8zQhVEDhWuojX7X1fN9vl5kNHhUYfD6ReYTmQyB5mV3Kfn l9Ds64i600PTE/IMKmJ0WmV1zPxJrSf522kVvD7cOckQJ4l+cSH/SKPA2zFFVg4Dbnak xi0+ZpMxM3TErVyVFbUMh21Ty5Rd7adOgXwthy2HXMEDEBTJXmfItqltMlVg7lB22XSi E+aaZklkjD+bSM+9W4NzalgB8xxbCNrji2fcEdntsiIVuUQfe0joC3utGHWMUvHpWFfn Bvlw== 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m2-20020a637102000000b0040d54868742si2702535pgc.24.2022.07.01.04.44.13; Fri, 01 Jul 2022 04:44:25 -0700 (PDT) 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231535AbiGALdV (ORCPT + 99 others); Fri, 1 Jul 2022 07:33:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229999AbiGALdU (ORCPT ); Fri, 1 Jul 2022 07:33:20 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA5E22B250 for ; Fri, 1 Jul 2022 04:33:18 -0700 (PDT) Received: from fraeml707-chm.china.huawei.com (unknown [172.18.147.207]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4LZCdf3yhHz6H71B; Fri, 1 Jul 2022 19:29:10 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml707-chm.china.huawei.com (10.206.15.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 1 Jul 2022 13:33:16 +0200 Received: from [10.126.173.51] (10.126.173.51) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 1 Jul 2022 12:33:15 +0100 Message-ID: <51af869a-83d4-631a-2d91-edb8b066bf4d@huawei.com> Date: Fri, 1 Jul 2022 12:33:17 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH] iommu/iova: change IOVA_MAG_SIZE to 127 to save memory To: Feng Tang CC: Robin Murphy , Joerg Roedel , "Will Deacon" , , , Andrew Morton , "Christoph Lameter" , Vlastimil Babka , , , Paul Menzel References: <20220630073304.26945-1-feng.tang@intel.com> <13db50bb-57c7-0d54-3857-84b8a4591d9e@arm.com> <7c29d01d-d90c-58d3-a6e0-0b6c404173ac@huawei.com> <117b31b5-8d06-0af4-7f1c-231d86becf1d@arm.com> <2920df89-9975-5785-f79b-257d3052dfaf@huawei.com> <20220701035622.GB14806@shbuild999.sh.intel.com> From: John Garry In-Reply-To: <20220701035622.GB14806@shbuild999.sh.intel.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.126.173.51] X-ClientProxiedBy: lhreml712-chm.china.huawei.com (10.201.108.63) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,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 01/07/2022 04:56, Feng Tang wrote: >>> inclination. >>> >> ok, what you are saying sounds reasonable. I just remember that when we >> analyzed the longterm aging issue that we concluded that the FQ size and its >> relation to the magazine size was a factor and this change makes me a little >> worried about new issues. Better the devil you know and all that... >> >> Anyway, if I get some time I might do some testing to see if this change has >> any influence. >> >> Another thought is if we need even store the size in the iova_magazine? mags >> in the depot are always full. As such, we only need worry about mags loaded >> in the cpu rcache and their sizes, so maybe we could have something like >> this: >> >> struct iova_magazine { >> - unsigned long size; >> unsigned long pfns[IOVA_MAG_SIZE]; >> }; >> >> @@ -631,6 +630,8 @@ struct iova_cpu_rcache { >> spinlock_t lock; >> struct iova_magazine *loaded; >> struct iova_magazine *prev; >> + int loaded_size; >> + int prev_size; >> }; >> >> I haven't tried to implement it though.. > I have very few knowledge of iova, so you can chose what's the better > solution. I just wanted to raise the problem and will be happy to see > it solved:) I quickly tested your patch for performance and saw no noticeable difference, which is no surprise. But I'll defer to Robin if he thinks that your patch is a better solution - I would guess that he does. For me personally I would prefer that this value was not changed, as I mentioned before. thanks, John