Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3228909pxf; Mon, 22 Mar 2021 00:48:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/DDw1PnlVjVMDngMNMEOsUmhzADSypteYBAx1L7WIJa0tsqIQ52ri7K7fezzSjmUZiLQC X-Received: by 2002:a17:906:4410:: with SMTP id x16mr17971962ejo.446.1616399290557; Mon, 22 Mar 2021 00:48:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616399290; cv=none; d=google.com; s=arc-20160816; b=CuJQdUDQm9+OKKQ5BHCnuUgX2/pEUibThydwlhUU0xskTBlOqBTUfk+KugcxMy1w+r Zp1sdAT2lRn73YTOLETiZbdBPMCd7cs7OxgBggLK+4il5V/3u7e2E/EFULH00aeCSLhH bBm2VacvGnBtuXxQ4ZXvEk75SG4l+M0TnNG2XDoGfGA5aXnXeyDTeE+SKmIe1lSaTYB2 +MhQ7sRdlStnRIEKC7m4D9lAj4Pa2+rn+qxwnlVPxXagczWoPH17XS8zhcpdiNo77onj oNM46rhl/HTmbPtUj2MAF7/+jPF2rk39PhpzEaafs+d/xsQDfHMtYRynNxhY174LIdEI wVaQ== 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=PpG8q1l1+AavkZ6uoUiJ/k8dcBxaPDYFCabGfa8sLF8=; b=FlnwjKgiOuJ6TBFLC9mAyio3IVA3fgT6u/LRav270ECq2302ubVZjmZXnXJIUjHXPT klMTbU6hzQjAbU7dx5RRIeQwxg2VDQfvuGmLCQCM5cPT3DeBCj+fY9NQY4bUjVjGNQhb jJciJnltfQAJviwczuIBm60Rg4PA7Fue9AMDDnnVhnTc3x7yVNDh67kdjlZB/cQEVKdE +Rl/71JSglV5TAZLZHYpb9n7z4nJK4GbY3DkZTst9k8fCqUSqXIj9TP4N/YQy41mQyl4 BRPBafVJ6P2bx+mh13QJT6tY/5zUYgBx8DQrq6lxbTUXW1TTJgV74R5i+QkRTHeJbz+C eUIA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id le4si11508201ejc.684.2021.03.22.00.47.45; Mon, 22 Mar 2021 00:48:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229614AbhCVHqr (ORCPT + 99 others); Mon, 22 Mar 2021 03:46:47 -0400 Received: from verein.lst.de ([213.95.11.211]:53905 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229893AbhCVHqa (ORCPT ); Mon, 22 Mar 2021 03:46:30 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id DFD0767373; Mon, 22 Mar 2021 08:46:27 +0100 (CET) Date: Mon, 22 Mar 2021 08:46:27 +0100 From: Christoph Hellwig To: Florian Fainelli Cc: linux-kernel@vger.kernel.org, Konrad Rzeszutek Wilk , Christoph Hellwig , Marek Szyprowski , Robin Murphy , "open list:SWIOTLB SUBSYSTEM" Subject: Re: [PATCH v2] swiotlb: Make SWIOTLB_NO_FORCE perform no allocation Message-ID: <20210322074627.GA4252@lst.de> References: <20210319040055.183433-1-f.fainelli@gmail.com> <20210321033740.312500-1-f.fainelli@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210321033740.312500-1-f.fainelli@gmail.com> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Mar 20, 2021 at 08:37:40PM -0700, Florian Fainelli wrote: > - if (!strcmp(str, "force")) { > + if (!strcmp(str, "force")) > swiotlb_force = SWIOTLB_FORCE; > - } else if (!strcmp(str, "noforce")) { > + else if (!strcmp(str, "noforce")) > swiotlb_force = SWIOTLB_NO_FORCE; > - default_nslabs = 1; > - } > > return 0; > } > @@ -211,6 +209,9 @@ swiotlb_init(int verbose) > size_t bytes = PAGE_ALIGN(default_nslabs << IO_TLB_SHIFT); > void *tlb; > > + if (swiotlb_force == SWIOTLB_NO_FORCE) > + return; We'll also need this in the other callers of swiotlb_init_with_tbl and swiotlb_late_init_with_tbl. I actually had a plan to mostly kill them, but that can better way until more support for multiple io_tlb structures is merged.