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=-8.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 12EFFC432BE for ; Wed, 25 Aug 2021 12:18:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EF7D36115A for ; Wed, 25 Aug 2021 12:18:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240736AbhHYMS4 (ORCPT ); Wed, 25 Aug 2021 08:18:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240602AbhHYMSz (ORCPT ); Wed, 25 Aug 2021 08:18:55 -0400 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95F9EC0613C1 for ; Wed, 25 Aug 2021 05:18:09 -0700 (PDT) Received: by mail-ed1-x533.google.com with SMTP id z10so1791121edb.6 for ; Wed, 25 Aug 2021 05:18:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tFbYUBxT5F02ETxWPNYnDT/IzVXwtvTQ/hB2M/j5I40=; b=S1Gv6G7NlFrvneSYqnBSOeyE66l/w2OvgLtQGyc2ete205Cc/K9titvobBEHOkV7Jd LF+IGAbQBYCZgtY/Oc+VQjeSILHfyY0qY86cKKFbFI9eKSjibGyEMQbH+ejgmKSjcgC5 7Ky78pwYl3ckT1x+pt8+vBGkO34Qu9FkKuJyYOZHJxs8JFezX8A9akOzr4r+RFN6WG3I Ku/K/lCbctjWFcI5f456bKKJQs0YE9FPfHmoAitDy6E/v21XOApT6h0Cwzr8rwCnMRdX GH00tomNPmmrq5p2YIaWuULxkUShxdgVCD8W5xkwuXFKP/V/+9cDwXz5fK1Dz7KM8amN GWuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tFbYUBxT5F02ETxWPNYnDT/IzVXwtvTQ/hB2M/j5I40=; b=AFCksTZse8KT00VWYdRmo68BkXdpdj0O+LJsde/khzAqC6VyAaZ1bJMSrAgQAVHSTX YfqPW2v2vrlQLfvrB72zB9awAPdc+fdD0ijGDmfWJ4bcWwUaaTWJKp7AWHC/j5uFWFoT Woy8sRbwu56SBFWGYjZSZ74kFaIYQKwcRoAwdnOsWoGxBqJu+BqsIrJss+HftdeqciEy FyqKoO9LLbi4MFdBy3Ogruuh2Fauh9seN4/DTaDoOs4ZkNS8Za2+TQSOCRS5yFYyk0zd cQgO5Ut2FIm4SbwEZ1nC56VklghASf7/jpA/X3uABZMHkI61apJ0PVJpDkFYu2Z8DWee /Rww== X-Gm-Message-State: AOAM530+XUp4IDHMtszMJ2Gtx2Oneeo/rPheh3+lpkhE5ywRvrSFej/H LC71MVX4h2d5we4ts6c6TAtV41T8xlpsdXiUxZDA X-Google-Smtp-Source: ABdhPJxiDpOcq8C+5T5VQdj2MSQ986LjNwq+2D/7Hfzk3BtSiet2580JVQtXlr3OiUAX1rd9+hgAp9kuHH1qjNotBK4= X-Received: by 2002:a05:6402:705:: with SMTP id w5mr15141991edx.344.1629893888145; Wed, 25 Aug 2021 05:18:08 -0700 (PDT) MIME-Version: 1.0 References: <20210818120642.165-1-xieyongji@bytedance.com> <20210818120642.165-2-xieyongji@bytedance.com> <20210824140758-mutt-send-email-mst@kernel.org> <20210825095540.GA24546@willie-the-truck> <5f4eadda-5500-9bac-4368-48cfca6d0a4d@huawei.com> In-Reply-To: <5f4eadda-5500-9bac-4368-48cfca6d0a4d@huawei.com> From: Yongji Xie Date: Wed, 25 Aug 2021 20:17:57 +0800 Message-ID: Subject: Re: [PATCH v11 01/12] iova: Export alloc_iova_fast() and free_iova_fast() To: John Garry Cc: Will Deacon , "Michael S. Tsirkin" , kvm , Jason Wang , virtualization , Christian Brauner , Jonathan Corbet , Matthew Wilcox , Christoph Hellwig , Dan Carpenter , Stefano Garzarella , Liu Xiaodong , linux-fsdevel@vger.kernel.org, Al Viro , Stefan Hajnoczi , songmuchun@bytedance.com, Jens Axboe , He Zhe , Greg KH , Randy Dunlap , linux-kernel , iommu@lists.linux-foundation.org, bcrl@kvack.org, netdev@vger.kernel.org, Joe Perches , Robin Murphy , =?UTF-8?Q?Mika_Penttil=C3=A4?= Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Wed, Aug 25, 2021 at 6:35 PM John Garry wrote: > > On 25/08/2021 10:55, Will Deacon wrote: > > On Tue, Aug 24, 2021 at 02:08:33PM -0400, Michael S. Tsirkin wrote: > >> On Wed, Aug 18, 2021 at 08:06:31PM +0800, Xie Yongji wrote: > >>> Export alloc_iova_fast() and free_iova_fast() so that > >>> some modules can make use of the per-CPU cache to get > >>> rid of rbtree spinlock in alloc_iova() and free_iova() > >>> during IOVA allocation. > >>> > >>> Signed-off-by: Xie Yongji > >> > >> > >> This needs ack from iommu maintainers. Guys? > > > > Looks fine to me: > > > > Acked-by: Will Deacon > > > > Will > > _______________________________________________ > > iommu mailing list > > iommu@lists.linux-foundation.org > > https://lists.linuxfoundation.org/mailman/listinfo/iommu > > . > > > > JFYI, There was a preliminary discussion to move the iova rcache code > (which the iova fast alloc and free functions are based on) out of the > iova code and maybe into dma-iommu (being the only user). There was > other motivation. > Would it be better to move the code into ./lib as a general library? > https://lore.kernel.org/linux-iommu/83de3911-145d-77c8-17c1-981e4ff825d3@arm.com/ > > Having more users complicates that... > Do we have some plan for this work? From our test [1], iova_alloc_fast() is much better than iova_alloc(). So I'd like to use it as much as possible [1] https://lore.kernel.org/kvm/CACycT3steXFeg7NRbWpo2J59dpYcumzcvM2zcPJAVe40-EvvEg@mail.gmail.com/ Thanks, Yongji