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 13946C76196 for ; Fri, 7 Apr 2023 06:01:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231508AbjDGGBC (ORCPT ); Fri, 7 Apr 2023 02:01:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231210AbjDGGBB (ORCPT ); Fri, 7 Apr 2023 02:01:01 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A475D40E0; Thu, 6 Apr 2023 23:01:00 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id A9BE168C4E; Fri, 7 Apr 2023 08:00:49 +0200 (CEST) Date: Fri, 7 Apr 2023 08:00:47 +0200 From: Christoph Hellwig To: Petr Tesarik Cc: Jonathan Corbet , Christoph Hellwig , Marek Szyprowski , Robin Murphy , Borislav Petkov , "Paul E. McKenney" , Andrew Morton , Randy Dunlap , Damien Le Moal , Kim Phillips , "Steven Rostedt (Google)" , "open list:DOCUMENTATION" , open list , "open list:DMA MAPPING HELPERS" , Roberto Sassu , petr@tesarici.cz Subject: Re: [RFC v1 0/4] Allow dynamic allocation of software IO TLB bounce buffers Message-ID: <20230407060047.GE6803@lst.de> References: <630334b5-05d0-0152-7c2c-79174703f0ed@huaweicloud.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <630334b5-05d0-0152-7c2c-79174703f0ed@huaweicloud.com> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org On Mon, Mar 27, 2023 at 01:06:34PM +0200, Petr Tesarik wrote: > B. Allocate a very big SWIOTLB, but allow to use it for normal > allocations (similar to the CMA approach). The advantage is that there > is only one table, pushing performance impact down to almost zero. The > main challenge is migrating pages to/from the SWIOTLB. Existing CMA code > cannot be reused, because CMA cannot be used from atomic contexts, > unlike SWIOTLB. That actually sounds very interesting, although I'd go futher and figure out if we: a) could get away to only allow the CMA allocation for sleeping contexts, if we have enough sleeping context to matter b) check with the CMA maintainers if it is feasible and acceptable to them to extent CMA for irq allocations. That being said, I think cases like dma-buf sharing really need to be addressed at a higher level instead of basically double allocating these long-term memory allocations. I'd also really love to hear some feedback from the various confidential computing implementors, as that seems to be ther big driving force for swiotlb currently.