From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (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 9B06F4D5BF for ; Fri, 28 Jun 2024 06:01:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.95.11.211 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719554508; cv=none; b=l/HYZzOq3oCkaRDWSO67A0pb+kIECGlqWcwdd2PZgFdhJvAj0EM2jt9yKK2bma1Nt3RTPuJOgf9RedAUOsDFJADjV5DSqv7Eib6M7nAQLms46Tguzx2WsBvNXHya5/5C0eL+Twlcsa8kOujtlgS1K59ktAuIJFzYaOCxxow7MR0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719554508; c=relaxed/simple; bh=zPf2b/JxbwDgnTb/kPy+Mmxdvp8oPoHuQGwsEJopq4U=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gdhimTAncOHnJFrA8hx9E080HdiEcnEMmTkWFaLMoembtikIPtQmvLlWEbHTbdPl6XKp4tFC4Yw3UzJ9QCUzsqr1vslYCthklI2XM3IKJXPrHlVeiH3n6Vhi8kX2LqFFnsO3sBYpzx9EQEVim0zIHcvfChbGbZBsIipwxQR07pU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=pass smtp.mailfrom=lst.de; arc=none smtp.client-ip=213.95.11.211 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lst.de Received: by verein.lst.de (Postfix, from userid 2407) id C992B68D09; Fri, 28 Jun 2024 08:01:30 +0200 (CEST) Date: Fri, 28 Jun 2024 08:01:29 +0200 From: "hch@lst.de" To: Michael Kelley Cc: "hch@lst.de" , Petr =?utf-8?B?VGVzYcWZw61r?= , "robin.murphy@arm.com" , "joro@8bytes.org" , "will@kernel.org" , "jgross@suse.com" , "sstabellini@kernel.org" , "oleksandr_tyshchenko@epam.com" , "m.szyprowski@samsung.com" , "iommu@lists.linux.dev" , "linux-kernel@vger.kernel.org" , "xen-devel@lists.xenproject.org" Subject: Re: [RFC 1/1] swiotlb: Reduce calls to swiotlb_find_pool() Message-ID: <20240628060129.GA26206@lst.de> References: <20240607031421.182589-1-mhklinux@outlook.com> <20240627060251.GA15590@lst.de> <20240627085216.556744c1@meshulam.tesarici.cz> <20240627152513.GA23497@lst.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) On Thu, Jun 27, 2024 at 04:02:59PM +0000, Michael Kelley wrote: > > > Conceptually, it's still being used as a boolean function based on > > > whether the return value is NULL. Renaming it to swiotlb_get_pool() > > > more accurately describes the return value, but obscures the > > > intent of determining if it is a swiotlb buffer. I'll think about it. > > > Suggestions are welcome. > > > > Just keep is_swiotlb_buffer as a trivial inline helper that returns > > bool. > > I don't understand what you are suggesting. Could you elaborate a bit? > is_swiotlb_buffer() can't be trivial when CONFIG_SWIOTLB_DYNAMIC > is set. Call the main function that finds and retuns the pool swiotlb_find_pool, and then have a is_swiotlb_buffer wrapper that just returns bool.