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 5E32D1547C5; Tue, 27 Aug 2024 07:14:39 +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=1724742881; cv=none; b=OFcAQp/IMnG0kiRrmhVcxn25nGQ6r9DRuHq+mHkZYHNSvScXKMNjoLQ60QBTF14mV6vx+gsWVTGVqxNgAgFuXaPevZyfrfNiisOlwIDK06GInahLtgv3yPEvI8uN0ItMlf6iY3l6LPl7XJBFvufosvymreZnm4l0I7MVcgmwCo4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724742881; c=relaxed/simple; bh=nhjxhmNHLo5IoXdK9az/5+6rhAZctBlOH954/my4wZo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ovUSGxB/zYGmO4DVY/+uEpVxoTrJKfz+MX4TjKxkLN2dw4utI7alDJKJ/Osg1/ws/rE99Sf1JYRUwEAkCOiQaOheb5HmcQEBhgRmFIC5I7f8EMYtbo7OGScmFDzSSAfWNstvldmiDYosTnJnY4UTyl/zk5N8jp/TxcP6VKL/kwU= 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 6526A227AAA; Tue, 27 Aug 2024 09:14:28 +0200 (CEST) Date: Tue, 27 Aug 2024 09:14:28 +0200 From: Christoph Hellwig To: Michael Kelley Cc: Christoph Hellwig , "kbusch@kernel.org" , "axboe@kernel.dk" , "sagi@grimberg.me" , "James.Bottomley@HansenPartnership.com" , "martin.petersen@oracle.com" , "kys@microsoft.com" , "haiyangz@microsoft.com" , "wei.liu@kernel.org" , "decui@microsoft.com" , "robin.murphy@arm.com" , "m.szyprowski@samsung.com" , "petr@tesarici.cz" , "iommu@lists.linux.dev" , "linux-kernel@vger.kernel.org" , "linux-nvme@lists.infradead.org" , "linux-scsi@vger.kernel.org" , "linux-hyperv@vger.kernel.org" , "linux-coco@lists.linux.dev" Subject: Re: [RFC 0/7] Introduce swiotlb throttling Message-ID: <20240827071428.GA12797@lst.de> References: <20240822183718.1234-1-mhklinux@outlook.com> <20240824081618.GB8527@lst.de> Precedence: bulk X-Mailing-List: linux-coco@lists.linux.dev 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 Mon, Aug 26, 2024 at 03:27:30PM +0000, Michael Kelley wrote: > OK, this makes sense to me. The DMA_ATTR_* symbols are currently > defined as just values that are not part of an enum or any other higher > level abstraction, and the "attrs" parameter to the dma_* functions is > just "unsigned long". Are you thinking that the separate namespace is > based only on the symbolic name (i.e., DMA_MAP_* vs DMA_ATTR_*), > with the values being disjoint? That seems straightforward to me. Yes. Although initially I'd just keep ATTR for the allocation and then maybe do a scripted run to convert it. > Changing the "attrs" parameter to an enum is a much bigger change .... I don't think an enum makes much sense as we have bits defined. A __bitwise type would be nice, but not required. > For a transition period we can have both DMA_ATTR_SKIP_CPU_SYNC > and DMA_MAP_SKIP_CPU_SYNC, and then work to change all > occurrences of the former to the latter. > > I'll have to look more closely at WEAK_ORDERING and NO_WARN. > > There are also a couple of places where DMA_ATTR_NO_KERNEL_MAPPING > is used for dma_map_* calls, but those are clearly bogus since that > attribute is never tested in the map path. Yeah, these kinds of bogus things is what I'd like to kill.. > > Note that this also in general involves changes to the block drivers > > to set that flag, which is a bit annoying, but I guess there is not > > easy way around it without paying the price for the BLK_MQ_F_BLOCKING > > overhead everywhere. > > Agreed. I assumed there was some cost to BLK_MQ_F_BLOCKING since > the default is !BLK_MQ_F_BLOCKING, but I don't really know what > that is. Do you have a short summary, just for my education? I think the biggest issue is that synchronize_srcu is pretty damn expensive, but there's also a whole bunch of places that unconditionally defer to the workqueue.