Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp836181pxf; Thu, 18 Mar 2021 12:45:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzU9feh3q0SfdcpsShww7ZuIT7SYMm0zhK0xfqb1QUgmZaOFtHouKaXLoIc5vIgiPqzTCIa X-Received: by 2002:a17:906:c102:: with SMTP id do2mr210750ejc.305.1616096714696; Thu, 18 Mar 2021 12:45:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616096714; cv=none; d=google.com; s=arc-20160816; b=a/XPe8OqXbiik3wGbJC3NjISbERhGwHEmwepoFuI0aEocC5mCq6aAUUwgHSowmt5m3 qZtfm5wy+fVSknInK7YOVlcUhHkbkXITSbvavaO6LucqxsMVvW4/J/83sfpBGTYrQOC4 WCFQ8Uy7RxM7qvW2khgUr3EHtOb1EIETUyIgPBMpcsHFooUzxTCfTK2MDhaW8+pFU+zc gvfLLINTRfZovKk6eoXuHnUj/8ehZmnnKKefWNOcVR7Lk/oEvzs/mAMsgDRDDO/4hAZE 2oKOVZkM/IYz4p/QP88nNmIZkoUsfd4vEM3E9E/YC/WozD0P0pfxZbhXjazx8ks3zXWh eC6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=CXffwwYrcucz6PkLWpGV6NoHESkAqtw1CcNDZMWpdBQ=; b=cFIF84H/CWyuD4k8xoO4MDIYaiorqIy2NvGy0f2KIJ1dvc6EfatTHQv4BrdXnauBI2 TaJhPmheSrH9b2F10JXyfD2Cmgtay04ebklxe3A6Dcf0lFi1Z4+J7wE8xiuX7Pqgeru4 VJVUKDEq4EVJOsl8KuyYCkgUspRihGIkW87MnIUwIOXvYVVgv760EidYLtxIn2IQmlNL 2uX9ASXJ4wlB9rk8jH/cd7pQSE4NG0Kt4IXLOKJ/sZSzYsnSbym71gI9I97j2NKJx1CG AqGF+z5rTDpqw3zoR7xyOc/Bdw2GQdG9/6CwgIbujv/4q5utqk7WoPvrq+FF5xMuXFCU RHXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jNduKqJS; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u19si2297669edo.583.2021.03.18.12.44.52; Thu, 18 Mar 2021 12:45:14 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jNduKqJS; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232922AbhCRTnY (ORCPT + 99 others); Thu, 18 Mar 2021 15:43:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232992AbhCRTnX (ORCPT ); Thu, 18 Mar 2021 15:43:23 -0400 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1E9AC06174A; Thu, 18 Mar 2021 12:43:22 -0700 (PDT) Received: by mail-pj1-x102b.google.com with SMTP id ot17-20020a17090b3b51b0290109c9ac3c34so3268632pjb.4; Thu, 18 Mar 2021 12:43:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=CXffwwYrcucz6PkLWpGV6NoHESkAqtw1CcNDZMWpdBQ=; b=jNduKqJSMUt5WOZPCi3HQPsGOMYzo1qxNn0d+yLtF8QzHmxYn0MVxo7w12d1iPqQVu lvV1OiEOTwUp2o4S66sZfnfNbFJAXalm65NDQLl5JFIpsz2/PxhHDEO5fUST3hzhU+mH QV0redUgqcnqebnNyc9hcJiAsUnwxbefH1YOrrPEcbzenRZZoFdQFvXYulMAb3FTk1CU C1PYz88MNF/+3hNqyhITzujGZhpofOKCKiQ+9SWg6Xvzo2IDCHreg4+/JEpmFrTgIJUH /PZOX1aPLFEPHOqy7a1rTPBzFhbKjm7PPxroYyHK2xEU66pnZGpHDpuWZn6ouI3cCnh9 mwUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=CXffwwYrcucz6PkLWpGV6NoHESkAqtw1CcNDZMWpdBQ=; b=TPia4v9vAdOKjzcIaY0NcYCyXJmTCHGiRLOn0hmLcz/vESwn09eqmcI7jtkAIPaAxK LYQetoT4BqD4YP+l92XG12FXhkYhz2x5SsuXKZc7bv3PXWahQVE5xPD/aLrzpzsrPp4e YQA4SHVyanc6znh9alWD7hh1y/EiINf9s1mgRP6ZA5aPo3A2ENM8j2DYuKBYB9cN8vn+ ND2ZddftfdDP4PcW1GpwWNGeqtmh80IGWhUbSPGLF9puZuBCRmnJ14JtvrjqugrqmcSf 1DZWw46So0CsPgJOY1YbpymqKjodrliQKvcu7S73aeexpdbISudZVs/f3v1elgnPBhww qKAw== X-Gm-Message-State: AOAM5329VOnjjdH+C0hu/mOMTMAi6+eV2Dq5QOF8RTEfS6dDUNpGSOwc 6s20uZkzKGCEZlqCvjHEM0I= X-Received: by 2002:a17:90a:d507:: with SMTP id t7mr6128138pju.54.1616096602323; Thu, 18 Mar 2021 12:43:22 -0700 (PDT) Received: from [10.230.29.202] ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id e190sm3109763pfe.3.2021.03.18.12.43.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 18 Mar 2021 12:43:21 -0700 (PDT) Subject: Re: [PATCH] swiotlb: Add swiotlb=off to disable SWIOTLB To: Robin Murphy , linux-kernel@vger.kernel.org, Christoph Hellwig Cc: opendmb@gmail.com, Jonathan Corbet , Konrad Rzeszutek Wilk , Marek Szyprowski , "Paul E. McKenney" , Randy Dunlap , Andrew Morton , Thomas Gleixner , Mauro Carvalho Chehab , Viresh Kumar , Mike Kravetz , Peter Zijlstra , "open list:DOCUMENTATION" , "open list:SWIOTLB SUBSYSTEM" References: <20210318191816.4185226-1-f.fainelli@gmail.com> From: Florian Fainelli Message-ID: Date: Thu, 18 Mar 2021 12:43:09 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/18/2021 12:34 PM, Robin Murphy wrote: > On 2021-03-18 19:22, Florian Fainelli wrote: >> >> >> On 3/18/2021 12:18 PM, Florian Fainelli wrote: >>> It may be useful to disable the SWIOTLB completely for testing or when a >>> platform is known not to have any DRAM addressing limitations what so >>> ever. > > Isn't that what "swiotlb=noforce" is for? If you're confident that we've > really ironed out *all* the awkward corners that used to blow up if > various internal bits were left uninitialised, then it would make sense > to just tweak the implementation of what we already have. swiotlb=noforce does prevent dma_direct_map_page() from resorting to the swiotlb, however what I am also after is reclaiming these 64MB of default SWIOTLB bounce buffering memory because my systems run with large amounts of reserved memory into ZONE_MOVABLE and everything in ZONE_NORMAL is precious at that point. > > I wouldn't necessarily disagree with adding "off" as an additional alias > for "noforce", though, since it does come across as a bit wacky for > general use. > >>> Signed-off-by: Florian Fainelli >> >> Christoph, in addition to this change, how would you feel if we >> qualified the swiotlb_init() in arch/arm/mm/init.c with a: >> >> >> if (memblock_end_of_DRAM() >= SZ_4G) >>     swiotlb_init(1) > > Modulo "swiotlb=force", of course ;) Indeed, we would need to handle that case as well. Does it sound reasonable to do that to you as well? -- Florian