Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp447967rwl; Thu, 6 Apr 2023 23:12:05 -0700 (PDT) X-Google-Smtp-Source: AKy350YkEarTrs0shKuIzUeekWfxT1T1kDt7DHZGt0ckCX4KksoqpdVs/QyfQMxOkv2yWL/fOsDg X-Received: by 2002:a05:6a20:729d:b0:d9:1fa9:c59a with SMTP id o29-20020a056a20729d00b000d91fa9c59amr5743224pzk.8.1680847924867; Thu, 06 Apr 2023 23:12:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680847924; cv=none; d=google.com; s=arc-20160816; b=vWxiLXdtM1zV8pV+RPmkwPUK+7HHHDPPRnhMnNM9Q9A1Tc05RKwbDm8X6PpRVItNsS laPUhKVuM8YbokNkSWqD/33gJzGcUWoejX5Vku+LIu1TwHwWkcyrEocvcVzgHXmW31Os rXvxiOcG0hHxSACxhC9dQ2g9u/SuXS3T4hMgbgxgLPI/sJIUyg+l+9BGyW70fMtnZ6HC WNbmzlXKAmafhN1DcgaP8thmSq7ReufnuDAMS0DsxB963zml3Ud7MgREk7iGU2LkiOUU 9JLt+gpni8ROsOc8oPSIn8H2WuUk8P2blQsSZ+TekZOLA1Owmb+/ANm76Q7oo7kF1SuJ FHnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=jezzJJlKfgrnoODTf0/HCArnBw7oaO6gXhGWZmQfj4E=; b=ETJ2fEBLenH9Is6pY7N0bgWHCKmcsbVhnSPlT/kIL3axfKn2IGdy4vWFskIvVsKOjW rfcK4fLqkBrqAR5t+xkFWhf69Fq+FukMXD62ObgYCWyEMd5QOtXspLfTcPCN9V0SMeuZ Z2XNF0yx3IZyrxbLbngMEAwkXDMZowhWYI0CinMd4joSxZU78bGue7kLgGkJpQKs+eZN 62Ky252l/lAn36eczI3zBnjRmGOQlzMHshKzjF+KJlQOQGVsAqwEFphDsKCUMcQir0nv 7yY/8h1wid1kHqUOabX/hdFOsL8wq+Y2QsrNo6n30ytocXLLgAazT/pyOzJGksQEkc/s vV+w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a17-20020a631a11000000b0051394ca5bbdsi2831668pga.257.2023.04.06.23.11.53; Thu, 06 Apr 2023 23:12:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232635AbjDGGBC (ORCPT + 99 others); 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) X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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.