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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 005D9C433FE for ; Wed, 12 Oct 2022 17:48:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+FDECs0mEKL/WIWP0Dp6avMYOGRwELG1SF/GoGKlNWQ=; b=1Y8pAOhV4Kd8lo Mdnm++iEt1vtnN3SGhj26XvoWKtY/ZJiNg0mnquHSaMQ0hpBwuZ+qZIRKmzqUa5UO3Tm9vpmpV7BV 0b5liIxRWFd6WaXU+NQOPnYBF9le/zzCV61lXD53lna7mLo+ZeFUof2VrHde9lt79X6WBkK3z3KHO 5qbKS5Bq2kSK+Qh8JZhT9WrcV7K3lZRDwNnaxt0eJVK/Gj37Ne/0+yIlwqTtXsyNZW4kQiSMi3LZs aVYHmDPfkbKZYIpMDYlO367Yep+vzeVUmDeRG+Zp72mvs3iG/HtUkUf0VwoLloDiJxOweA4IVOGVs QgdzBxIaxDINd1LeLUeg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oifpL-008tmv-JU; Wed, 12 Oct 2022 17:47:31 +0000 Received: from mail-qv1-xf2a.google.com ([2607:f8b0:4864:20::f2a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oifpI-008tkE-8v for linux-arm-kernel@lists.infradead.org; Wed, 12 Oct 2022 17:47:29 +0000 Received: by mail-qv1-xf2a.google.com with SMTP id h10so11347970qvq.7 for ; Wed, 12 Oct 2022 10:47:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=iadacU8HjMHZCZhJygxiIG7/MygN7METMFxWBA2IfjE=; b=Yf1mCOSuC0WDz6zTEAp5QbI0HxH6ymxd5/zia+3afDO9yUKDLS+JDYybBqIpyHg2Dm LWkFjYvZlU+lltgGLwmCmY0sjldmPQKxu+JgxLtghVhKKE9d2EGEo+4yL94ZOAonjxeV kbj59D/U9GRzVI/buQnBYqv35sfmPZojLKOw5xjRiaI4ZELfvb/wGHiFtRagCRnx8ZcY 1Q2dHtoW+D8FBefYRYVjTKHhY/gfwrZKot2sJULgk+EIeE0Ckuti06zdPv2Ov1Wei8vx t5+V2RKfZU6QUWknZ5QRlC7CW9PWtEWhquV1zMTl8C3mmCuTW7lX/uMUWODsxD2bXs1u Kc7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=iadacU8HjMHZCZhJygxiIG7/MygN7METMFxWBA2IfjE=; b=zNbYXlRAfjY8JwF4pk1rVwFe6u3EQK7yV+xQiL0PITc10fTTdjOr+iVLU+LEZjj6vB 2wVWgbAeDitNH5EVJ5b4UnpWt2OjcSpz1mSKMJFOsBc1Jt4VN6T54j/3NQDwyLg2KfPu 8+GCIUMok1r3uUYx4Z7TUq6Zf7TYPYqzJqejaK+gVr3AbcjdZAbWyMRmG/e0q2K946IK A+u6QyFQ/BSVeY8lUYgeyNb3AcMxP4EkzJolBkOwytITeXcDBs17O8hztwo33u+jFbmM T15lk/fE5yJtLTwLYjwyftJQJYkVqfah9If3vkUAYHiXqZnFMb6s1RH207tAS/iyepAX NOWQ== X-Gm-Message-State: ACrzQf1O7sufgGdOE827pe8D+WJlqMhuTj2Ik5N2OlmCqgjpPqqBL0GY yTVJTyirv4PnpBoqeb6Zw/tY69hobdYGpYy1 X-Google-Smtp-Source: AMsMyM7vJ/PR4P14DLQBaJpzHCGqSoud7gaIwx0eOUsQHSMeqXrfDtMP4isskWzcfYApPERl8yACrg== X-Received: by 2002:a17:902:dad1:b0:183:243c:d0d0 with SMTP id q17-20020a170902dad100b00183243cd0d0mr13409687plx.157.1665596751184; Wed, 12 Oct 2022 10:45:51 -0700 (PDT) Received: from google.com ([2620:15c:2d:3:5351:89a8:5e92:8bed]) by smtp.gmail.com with ESMTPSA id t8-20020a170902e84800b00185002f0c6csm197132plg.134.2022.10.12.10.45.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Oct 2022 10:45:50 -0700 (PDT) Date: Wed, 12 Oct 2022 10:45:45 -0700 From: Isaac Manjarres To: Catalin Marinas Cc: Herbert Xu , Ard Biesheuvel , Will Deacon , Marc Zyngier , Arnd Bergmann , Greg Kroah-Hartman , Andrew Morton , Linus Torvalds , Linux Memory Management List , Linux ARM , Linux Kernel Mailing List , "David S. Miller" , Saravana Kannan , kernel-team@android.com Subject: Re: [PATCH 07/10] crypto: Use ARCH_DMA_MINALIGN instead of ARCH_KMALLOC_MINALIGN Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221012_104728_379982_48920F72 X-CRM114-Status: GOOD ( 18.03 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Sep 30, 2022 at 07:32:50PM +0100, Catalin Marinas wrote: > I started refreshing the series but I got stuck on having to do bouncing > for small buffers even if when they go through the iommu (and I don't > have the set up to test it yet). For devices that go through the IOMMU, are you planning on adding similar logic as you did in the direct-DMA path to bounce the buffer prior to calling into whatever DMA ops are registered for the device? Also, there are devices with ARM64 CPUs that disable SWIOTLB usage because none of the peripherals that they engage in DMA with need bounce buffering, and also to reclaim the default 64 MB of memory that SWIOTLB uses. With this approach, SWIOTLB usage will become mandatory if those devices need to perform non-coherent DMA transactions that may not necessarily be DMA aligned (e.g. small buffers), correct? If so, would there be concerns that the memory savings we get back from reducing the memory footprint of kmalloc might be defeated by how much memory is needed for bounce buffering? I understand that we can use the "swiotlb=num_slabs" command line parameter to minimize the amount of memory allocated for bounce buffering. If this is the only way to minimize this impact, how much memory would you recommend to allocate for bounce buffering on a system that will only use bounce buffers for non-DMA-aligned buffers? Thanks, Isaac _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel