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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C895C433F5 for ; Wed, 1 Jun 2022 10:38:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352114AbiFAKiz (ORCPT ); Wed, 1 Jun 2022 06:38:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347833AbiFAKiu (ORCPT ); Wed, 1 Jun 2022 06:38:50 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0493B7CDE5 for ; Wed, 1 Jun 2022 03:38:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654079929; x=1685615929; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=mtwSjzvzSsj5uNAepvv6xKBLP1QaTB74LPqp4GVeXMY=; b=bAazwDlJkPeVWRv/vU2J95vqCcuhiv050I09U1BUruODAUhYi6ig7qXb ZfTldbcTDbLrr51OUZu3Ra/B3matimcfdwwA6EJ25f1oDvZg0Cu7FE5ko 15Jma6ZlBpOzj6f37wvJ+15wk+VSRAZfYwtB4ttNkTLyTORbUZmXxGaV2 wPVsIEFrEaN5MPH2XLuNoIIK+XR/mho2iIV/ItOy+HxtAUlI77bA4T9lu hwtbFyKvz/WIG5j0mNN3vvfNXg4ikVeb06dZg/zHLx5Bc28tr4IZHBxN0 kSoYNwVHs5qDcLdqg4B80Lu/+d22RGGEnECoQqWiRBP/co8soyGcK4jP0 Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10364"; a="300896418" X-IronPort-AV: E=Sophos;i="5.91,268,1647327600"; d="scan'208";a="300896418" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jun 2022 03:38:49 -0700 X-IronPort-AV: E=Sophos;i="5.91,268,1647327600"; d="scan'208";a="707001500" Received: from hej1-mobl.ccr.corp.intel.com (HELO [10.255.28.123]) ([10.255.28.123]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jun 2022 03:38:46 -0700 Message-ID: <369bf961-d5e5-998f-542d-f90bc4c6cb28@linux.intel.com> Date: Wed, 1 Jun 2022 18:38:44 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Cc: baolu.lu@linux.intel.com, Will Deacon , Robin Murphy , "Liu, Yi L" , "Pan, Jacob jun" , "iommu@lists.linux-foundation.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 06/12] iommu/vt-d: Acquiring lock in domain ID allocation helpers Content-Language: en-US To: "Tian, Kevin" , Joerg Roedel , "Raj, Ashok" , Christoph Hellwig , Jason Gunthorpe References: <20220527063019.3112905-1-baolu.lu@linux.intel.com> <20220527063019.3112905-7-baolu.lu@linux.intel.com> From: Baolu Lu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Kevin, Thank you for the comments. On 2022/6/1 17:09, Tian, Kevin wrote: >> From: Lu Baolu >> Sent: Friday, May 27, 2022 2:30 PM >> >> The iommu->lock is used to protect the per-IOMMU domain ID resource. >> Move the spinlock acquisition/release into the helpers where domain >> IDs are allocated and freed. The device_domain_lock is irrelevant to >> domain ID resources, remove its assertion as well. > while moving the lock you also replace spin_lock_irqsave() with spin_lock(). > It'd be cleaner to just do movement here and then replace all _irqsave() > in patch 8. Yeah, that will be clearer. Best regards, baolu