From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 68E68C4338F for ; Tue, 3 Aug 2021 07:41:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 54EE46023F for ; Tue, 3 Aug 2021 07:41:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234333AbhHCHmB (ORCPT ); Tue, 3 Aug 2021 03:42:01 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:28542 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234269AbhHCHl5 (ORCPT ); Tue, 3 Aug 2021 03:41:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1627976506; 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=sEW12L7lEJwVitr0islGtcOwaqb3auoW/6llqcQs9Bo=; b=FfH74tOm/n80+lYqV0aOjgw/VpCgeyp3m6yISnb7I4WUvRIMCIsSPnIddEMXdHqrgL4kSF VAmuFp6uoMPhkpnBnqLR9psIutX4x/MEs5isC2COsALVVUvZQvl4i7Zr/w9gXYreHI/mC9 J6BFAqh9CY+e5NAuFeC3WHBGs98NlhE= Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-272-lcSJp7i3Pombyt3D-F7O_w-1; Tue, 03 Aug 2021 03:41:45 -0400 X-MC-Unique: lcSJp7i3Pombyt3D-F7O_w-1 Received: by mail-pj1-f69.google.com with SMTP id j22-20020a17090a7e96b0290175fc969950so2165651pjl.4 for ; Tue, 03 Aug 2021 00:41:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=sEW12L7lEJwVitr0islGtcOwaqb3auoW/6llqcQs9Bo=; b=WhNqiJ55m+qeukER7tJ4bf4V8Ab+lEMPCDUaLRsPn0K7emfsWDqkSxJnrUk/Jy2fUR 8KybD31z73LYaL6TyRZ3p9yMQ8KgURcGJwZCC3Ilc6qF+LTxfzajHPvTiQOKVhoOrE3v /RoNtHHyrrnv/DxZN8H+kVCRu2i96RZ1dCYty9aUpS9QUohC9FoRdtH2vIlOuQjbfrfO tguRiDFtgMGt5twzmINuGD1pGSAgqJOuNOn3uPOlGPMGoBFU4cbD8hvbplKl3SCSP7sW 5qetxG00uPbQ+Pjli/qD+wmueFJomYSxgSJiUTaLhUPM4Fw5Okw+cW0wRQRXZJkhB2+r eHaQ== X-Gm-Message-State: AOAM533bzUaveO2J9Vzp6VkMcWhb53XnZbEf+hZ/wZ9WUplLclBWDZl8 UtqS9EiU55uYapEClj3lbvOURS1u0KCoOuJ3TcgughXTwnMMVfXIwH+td/DL46EAxPojCahzlrt Pr2PZpeoyMUxeloDkZigsJ0AS2IcJWww8lBfuutEwepls+5NwUlfBgpCXanhHQS4Lh37KISykf8 Iu X-Received: by 2002:a65:6658:: with SMTP id z24mr924203pgv.266.1627976503903; Tue, 03 Aug 2021 00:41:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTQ9FIMwD850kYRySFMOvwSa2Mh3zZSaM4w5MdRtHBvqDzhjK3JTqHR+x1mQoJbyhltJ0O8Q== X-Received: by 2002:a65:6658:: with SMTP id z24mr924161pgv.266.1627976503586; Tue, 03 Aug 2021 00:41:43 -0700 (PDT) Received: from wangxiaodeMacBook-Air.local ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id r15sm13016701pjl.29.2021.08.03.00.41.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 Aug 2021 00:41:42 -0700 (PDT) Subject: Re: [PATCH v10 01/17] iova: Export alloc_iova_fast() and free_iova_fast() To: Xie Yongji , mst@redhat.com, stefanha@redhat.com, sgarzare@redhat.com, parav@nvidia.com, hch@infradead.org, christian.brauner@canonical.com, rdunlap@infradead.org, willy@infradead.org, viro@zeniv.linux.org.uk, axboe@kernel.dk, bcrl@kvack.org, corbet@lwn.net, mika.penttila@nextfour.com, dan.carpenter@oracle.com, joro@8bytes.org, gregkh@linuxfoundation.org, zhe.he@windriver.com, xiaodong.liu@intel.com, joe@perches.com Cc: songmuchun@bytedance.com, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, kvm@vger.kernel.org, linux-fsdevel@vger.kernel.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org References: <20210729073503.187-1-xieyongji@bytedance.com> <20210729073503.187-2-xieyongji@bytedance.com> From: Jason Wang Message-ID: <43d88942-1cd3-c840-6fec-4155fd544d80@redhat.com> Date: Tue, 3 Aug 2021 15:41:33 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <20210729073503.187-2-xieyongji@bytedance.com> Content-Type: text/plain; charset=gbk; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ÔÚ 2021/7/29 ÏÂÎç3:34, Xie Yongji дµÀ: > Export alloc_iova_fast() and free_iova_fast() so that > some modules can use it to improve iova allocation efficiency. It's better to explain why alloc_iova() is not sufficient here. Thanks > > Signed-off-by: Xie Yongji > --- > drivers/iommu/iova.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/iommu/iova.c b/drivers/iommu/iova.c > index b6cf5f16123b..3941ed6bb99b 100644 > --- a/drivers/iommu/iova.c > +++ b/drivers/iommu/iova.c > @@ -521,6 +521,7 @@ alloc_iova_fast(struct iova_domain *iovad, unsigned long size, > > return new_iova->pfn_lo; > } > +EXPORT_SYMBOL_GPL(alloc_iova_fast); > > /** > * free_iova_fast - free iova pfn range into rcache > @@ -538,6 +539,7 @@ free_iova_fast(struct iova_domain *iovad, unsigned long pfn, unsigned long size) > > free_iova(iovad, pfn); > } > +EXPORT_SYMBOL_GPL(free_iova_fast); > > #define fq_ring_for_each(i, fq) \ > for ((i) = (fq)->head; (i) != (fq)->tail; (i) = ((i) + 1) % IOVA_FQ_SIZE)