Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 68569BA2E for ; Wed, 22 Mar 2023 20:04:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679515457; x=1711051457; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5U1pqEnYI3Q80e7Obrp6GUJ1jNRTk8Hz1ySQDnWY03M=; b=H1Ma15Ha1ymaykzWxEsyBu38BS74zijbIPp7Xanj9I1SRaDBGkpf4neB ffRIobGiAsLPr6YVPiOQWL63JWTOHVe76jRs+3RWq36LWrVe/7E5oZiru Cj58Mv9YO+tL2+eNj1EYhCK2gqsMmZ554G+ICbznfid0ivj5RfLsxlrJX 9FT2tZZRCXdkrjEKyXGjYMgqbQnBsB0OcPOXasiRPqRJyCwwnvzhBPxCC mibHsTK3DJJm9hV2z1yrPuy5i98sX+t1zUsSPKZPjs5S8GAzWZDbuwJM/ jrrzULVp6aoTrqcB9q59nfY4fbYtH8wTwl8z8K6oSyKjC/+9gLkV4ZhMH g==; X-IronPort-AV: E=McAfee;i="6600,9927,10657"; a="339356841" X-IronPort-AV: E=Sophos;i="5.98,282,1673942400"; d="scan'208";a="339356841" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Mar 2023 13:04:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10657"; a="682039344" X-IronPort-AV: E=Sophos;i="5.98,282,1673942400"; d="scan'208";a="682039344" Received: from srinivas-otcpl-7600.jf.intel.com (HELO jacob-builder.jf.intel.com) ([10.54.39.106]) by orsmga002.jf.intel.com with ESMTP; 22 Mar 2023 13:04:05 -0700 From: Jacob Pan To: LKML , iommu@lists.linux.dev, Jason Gunthorpe , "Lu Baolu" , Joerg Roedel , Jean-Philippe Brucker , "Robin Murphy" , Dave Hansen , Thomas Gleixner , X86 Kernel , bp@alien8.de, "H. Peter Anvin" , Peter Zijlstra , corbet@lwn.net, vkoul@kernel.org, dmaengine@vger.kernel.org, linux-doc@vger.kernel.org Cc: "Will Deacon" , David Woodhouse , Raj Ashok , "Tian, Kevin" , Yi Liu , "Yu, Fenghua" , Dave Jiang , Kirill Shutemov , Tony Luck , Jacob Pan Subject: [PATCH v8 5/7] iommu/sva: Use GFP_KERNEL for pasid allocation Date: Wed, 22 Mar 2023 13:08:01 -0700 Message-Id: <20230322200803.869130-6-jacob.jun.pan@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230322200803.869130-1-jacob.jun.pan@linux.intel.com> References: <20230322200803.869130-1-jacob.jun.pan@linux.intel.com> Precedence: bulk X-Mailing-List: iommu@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We’re not using spinlock-protected IOASID allocation anymore, there’s no need for GFP_ATOMIC. Reviewed-by: Kevin Tian Reviewed-by: Lu Baolu Reviewed-by: Jason Gunthorpe Signed-off-by: Jacob Pan --- drivers/iommu/iommu-sva.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/iommu-sva.c b/drivers/iommu/iommu-sva.c index 48e8a15ddc9b..c434b95dc8eb 100644 --- a/drivers/iommu/iommu-sva.c +++ b/drivers/iommu/iommu-sva.c @@ -28,8 +28,8 @@ static int iommu_sva_alloc_pasid(struct mm_struct *mm, ioasid_t min, ioasid_t ma goto out; } - ret = ida_alloc_range(&iommu_global_pasid_ida, min, max, GFP_ATOMIC); - if (ret < 0) + ret = ida_alloc_range(&iommu_global_pasid_ida, min, max, GFP_KERNEL); + if (ret < min) goto out; mm->pasid = ret; ret = 0; -- 2.25.1