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 CB98E2F7F06; Tue, 19 May 2026 06:57:01 +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=1779173823; cv=none; b=bFrjlxhf2xOXIxgLvcKRoZ3gAjdVgPh0kig5ZSqCDsXG3E7LR1jdrxLNjuKTQuwKpLFRTtVhF8r0DgqwY00PfalZTGbqYeEp3o1344E+obRH9kceP+NAJNplbszFrWV1oCN+EXPo04rqlmEX46QoVii15Ioye27bdhOPi1LX4Jk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779173823; c=relaxed/simple; bh=DrWqQzOlBT7PBXEQ74exqA8NUZJPGXS5sd2MPD5AnkE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hKrEQG56hFfwbHiwzyMNPcGRr6V5ATm8vzv/VGgQXOap2/finuRwria42SolTUr1ah87I/PmjA4qFHYeMQF14pxtuUwKwlcX/SKUoW81mZBcLYvN0Np5MRfmfoN/h771YfEWlBDdt/okG0XuEHe9tEsg1d9f63n3hYcs6wu5+OQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (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=pass (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 F393168AFE; Tue, 19 May 2026 08:56:53 +0200 (CEST) Date: Tue, 19 May 2026 08:56:53 +0200 From: Christoph Hellwig To: Pavel Begunkov Cc: Christoph Hellwig , Jens Axboe , Keith Busch , Sagi Grimberg , Alexander Viro , Christian Brauner , Andrew Morton , Sumit Semwal , Christian =?iso-8859-1?Q?K=F6nig?= , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-fsdevel@vger.kernel.org, io-uring@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, Nitesh Shetty , Kanchan Joshi , Anuj Gupta , Tushar Gohad , William Power , Phil Cayton , Jason Gunthorpe Subject: Re: [PATCH v3 05/10] lib: add dmabuf token infrastructure Message-ID: <20260519065653.GB8173@lst.de> References: <20260513082431.GA6461@lst.de> <20260518125326.GA5754@lst.de> Precedence: bulk X-Mailing-List: linux-block@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 Mon, May 18, 2026 at 03:23:53PM +0100, Pavel Begunkov wrote: > To be fair, it's not that dma-buf specific. This lib/ code only > does some resv locking, fence waiting and queuing fences, But all the dma resv/fence stuff is pretty tied into the dma-buf ecosystem. I don't think it would really apply to something not doing DMA at all. > otherwise > all the attaching is done by the driver behind callbacks. Switching > it to some memfd could be pretty simple. But The main thing it'd > need to share is iterator handling like forwarding in the block > layer, and it should be fine as it's already passed as a completely > opaque object with no knowledge about pages / dma / etc. for the > middle layers. But none of that really sits in the current lib/ code anyway? >> lib/ is most certainly the wrong place for something that absolutely >> is not library functionality but directly interacts with a few >> subsystems. > > It only interacts with dma-buf, and even for dma-buf attachments > are created by the driver. Block, nvme, io_uring are users, either > using the helpers or implementing callbacks. > > Ok. Let's assume for the argument's sake it's not dma-buf > specific, if not lib/, where would you put it? I was also > assuming that dma-buf being under drivers/ is rather a relic > of the past rather than the desired location, hmm? drivers/dma-buf is a pretty natural place for it, I could not thing where else you'd place dma-buffers. I'm not sure how hmm has anything to do with it. > > > -- > Pavel Begunkov ---end quoted text---