Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp635933ybb; Wed, 1 Apr 2020 07:02:09 -0700 (PDT) X-Google-Smtp-Source: APiQypIywVNVMOiOLWIQxWXaddFNp+X/KM8soi7yWmPB7BD0jxo6aNrtkwcYEsD0xqneNWbiWjiY X-Received: by 2002:aca:f254:: with SMTP id q81mr2893644oih.12.1585749729057; Wed, 01 Apr 2020 07:02:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585749729; cv=none; d=google.com; s=arc-20160816; b=WBwYKhSPnBBds5dMdJODgBC5y0JOr7CsuWfkQ3bo60OxBFmmdmfCkZ++Qzl94YzmTF wim/7R/DvN8PXnh9pUfCYS+mRXjdBtYiOReENiIlCt9S9EhdYZiTDOSSlsGc2M+T7Dtv BOnMMx9dGRZWWOso9tsBJj4KZXDxFjgAywQmaqSE5cap5WMYjM5U0VBJStLoUxH5zHuG T6iI1n/MYFDRnQ6syFRPsby/L/hu3rCsrDVs85N2aJL9Vlgg3vlBa1AFO2ALhzc2/ICS e7HiOgccKkkmgmnnO2+oPPxv6+Ctsv/k4wZRkAexu8Of6XfnQm5crxWlp0G+3YEHYuty gJEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=d3ubFjm4VVzuezD9K57VpIO57fRHdUfHFre4oE4/E04=; b=fZjn3BetI5Xd2GjAjZXrIs/4cGa7dYogaVrcYL7SxBjyMnbFmoB6YuIIUPz5D2oce6 cXpquwfKKGROnHoI/bvnBmnZMeeKpFGiZerwZ+gXRKuTRCHkeBF4KDL8iwAIOvDN20vh oGurd24jRMMExaPo5YbhW6cV4eG6FwACvutCYg6OeUFLtoz5simEwtfjg4F3W4Nn86ds kntEmw8IhF9Vjc+qnFZ6yHNbFYiwQrvReVvxJ9TC/Mwxh1dd/8UyKOOkKQrk7/x+uA5o r1DnjoSwmTjLUTZzEBiVBykyioFGeCEo2O26Szh0EWj3krtcF4cFYoiZjENOj4mjscOI xTnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LXbULbcG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r3si908133otc.58.2020.04.01.07.01.43; Wed, 01 Apr 2020 07:02:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LXbULbcG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732832AbgDAN7A (ORCPT + 99 others); Wed, 1 Apr 2020 09:59:00 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:38632 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732783AbgDAN7A (ORCPT ); Wed, 1 Apr 2020 09:59:00 -0400 Received: by mail-wr1-f68.google.com with SMTP id c7so159383wrx.5 for ; Wed, 01 Apr 2020 06:58:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=d3ubFjm4VVzuezD9K57VpIO57fRHdUfHFre4oE4/E04=; b=LXbULbcGmfMrHy9dOLNhW1kZDtfZBIl5/lz1iQa7oPRNngMcEJOD5l9icOrmOO3Djy EQqlHxTtbMGEE8mA6x2XBw2ECgbR9y6ZS1rqlC2xQfsHBjipC9cadM0uKuyexhvN0x93 k80wEGBoqIiMrvi008KAnbEGbOywRBQBtrc6WJuf+RJTwHbrfp2xJ3ES2Blh9aaeV7MF sn5MWYTVT5jYkU50jZkgvTOzplUoQyJAZAAIRnuqgZIrY7YroC14n05NDSNQzdewB6oe m4jvH2JQRvBUQFqQV2RVjStv4Za6RmY7silH4dWxTZawFm1cPOKC6+mQDGBZAe7TTLko lODw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=d3ubFjm4VVzuezD9K57VpIO57fRHdUfHFre4oE4/E04=; b=c/W6wraVe9LndsXKRHRKNRPZEd/p++J3zZ1Vkr5/3lHtdbuDMvsnhk3twfGe74KDBp 6KjA+rz+C/0N8jmTjK0RvZ9DdSgJRV00t7bVt/Jjp+auxf/3iJtOKV+l1EQVFzVHajHE OH02AYs6gOSUfP9kGjD5Rjw6ho3htyRN6Bt/LkIx8C6w6Z61CKuZDp2l3gN9qrH80FQg kiCVQahw1Mcan5PcRqWbNhRQlmD2oxpdM3E4h9xSj5rG0nsWKN44Vw6ZzsWgjJvFWsUu yAEiBBSHUhdWcb2I206dDH3T+QIfsYVr/Z0AbqqIVIF15lqdF68sULB0nG2qczScePDG cE6g== X-Gm-Message-State: ANhLgQ0YlWLEnyAJCjtPSyV709iMswvgxxJpnQyQRbd3jJd4RitTtgcJ KZT2Xv8oRBoAwGNHo4xVjjV6WQ== X-Received: by 2002:adf:ee8b:: with SMTP id b11mr6915157wro.404.1585749536778; Wed, 01 Apr 2020 06:58:56 -0700 (PDT) Received: from myrica ([2001:171b:226b:54a0:6097:1406:6470:33b5]) by smtp.gmail.com with ESMTPSA id a186sm2734787wmh.33.2020.04.01.06.58.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Apr 2020 06:58:56 -0700 (PDT) Date: Wed, 1 Apr 2020 15:58:48 +0200 From: Jean-Philippe Brucker To: Jacob Pan Cc: Joerg Roedel , Alex Williamson , Lu Baolu , iommu@lists.linux-foundation.org, LKML , David Woodhouse , Jean-Philippe Brucker , Yi Liu , "Tian, Kevin" , Raj Ashok , Christoph Hellwig , Jonathan Cameron , Eric Auger Subject: Re: [PATCH 07/10] iommu/ioasid: Use mutex instead of spinlock Message-ID: <20200401135848.GH882512@myrica> References: <1585158931-1825-1-git-send-email-jacob.jun.pan@linux.intel.com> <1585158931-1825-8-git-send-email-jacob.jun.pan@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1585158931-1825-8-git-send-email-jacob.jun.pan@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 25, 2020 at 10:55:28AM -0700, Jacob Pan wrote: > Each IOASID or set could have multiple users with its own HW context > to maintain. Often times access to the HW context requires thread context. > For example, consumers of IOASIDs can register notification blocks to > sync up its states. Having an atomic notifier is not feasible for these > update operations. > > This patch converts allocator lock from spinlock to mutex in preparation > for IOASID notifier. Unfortunately this doesn't work for SVA, which needs to call ioasid_free() from the RCU callback of mmu_notifier_put(), which cannot sleep. We're relying on MMU notifers this way to ensure that there is a single IOASID per mm. Thanks, Jean