From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C552A18C18 for ; Mon, 15 May 2023 19:09:18 +0000 (UTC) Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-1ac65ab7432so747245ad.0 for ; Mon, 15 May 2023 12:09:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1684177758; x=1686769758; 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=NScEF4DUT2RK1kg1ycQM1CBgCg/fSirJtyzV/whK0J0=; b=OC0n6O9mt8GEKWsOuiJlnAMyqeZY0/5tkzV4mYOVlaKSWY/9pW0fmBpr1lTRRaY+kx zmTHiiXRSd5rL/KZBC/d5bJY7dwa3Z9nYpiykc5TkluI4pfv2JZQbHN5W1q02vevK64P mUYLgKP2lJ9ANa5mCrBgiTBq473BLqTADQfY89IHqfhYx1RlFkAHR5G4ytTwaX95J4BP 5oZSFQa0Vpgrx7t7MkcF5DH0/GKNVwYK1ScMJPbrOsgpit1nwJR6/5ZG3Ll6ESaOYBgX e5XFltTBPFiU0N2Af/eN5yTe5I2EQlthcMUKOqOfxpmkzBw2dIBtcBm3taDJYVD6xs0j nvqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684177758; x=1686769758; 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=NScEF4DUT2RK1kg1ycQM1CBgCg/fSirJtyzV/whK0J0=; b=ihKwc/Wthmy5bR6XI/mykuSn+f5yO2wsONV6h2rAuMvS7UHvD9mtzhLImV6qIIeBNQ rFqxqt1ljoSjAwTaz8YNtBCB9N9z+V5wzhJkfPVzGiUBd6do8gSCVclQnvlZEirTplJf H1wEvDnovDelUmsZGrYJy8/mzczPXsnOVx7KJxv7/HZVKzX5z3xLZ3dm4SClcMnNYoe1 w+siStWjc0M4qFjztoCL+BJSISeqrwLQOECPZWlsIp0tLhJrRBZd8BqmUBt+Y4bTIVK6 g573Gj+vj60uOh4UmQBvo9rsPa7WychmYPVBAFGL+MZU3BOXM2znMzK4Q6UYgSG4ekeE c7DQ== X-Gm-Message-State: AC+VfDx35V4t81h8J0wdCjddGbYQP8gfC2XBYdOZjnURiwsm70nApOHF MtPTSg6xLO9STOu0ZF+xSgNDIA== X-Google-Smtp-Source: ACHHUZ6ZwVUoftc1tRpuaAlUdt1ybXqL+4C27qcMcoX/qt34Q62hQcY9bonn36MRLP7Pkq4ToUtlhQ== X-Received: by 2002:a17:902:ea02:b0:1a9:bb1d:64e with SMTP id s2-20020a170902ea0200b001a9bb1d064emr8433plg.15.1684177757962; Mon, 15 May 2023 12:09:17 -0700 (PDT) Received: from google.com ([2620:15c:2d:3:b860:7e3e:331f:4d8b]) by smtp.gmail.com with ESMTPSA id m5-20020a170902768500b001a682a195basm13906296pll.28.2023.05.15.12.09.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 May 2023 12:09:17 -0700 (PDT) Date: Mon, 15 May 2023 12:09:12 -0700 From: Isaac Manjarres To: Catalin Marinas Cc: Linus Torvalds , Arnd Bergmann , Christoph Hellwig , Greg Kroah-Hartman , Will Deacon , Marc Zyngier , Andrew Morton , Herbert Xu , Ard Biesheuvel , Saravana Kannan , Alasdair Kergon , Daniel Vetter , Joerg Roedel , Mark Brown , Mike Snitzer , "Rafael J. Wysocki" , Robin Murphy , linux-mm@kvack.org, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Petr Tesarik Subject: Re: [PATCH v3 00/13] mm, dma, arm64: Reduce ARCH_KMALLOC_MINALIGN to 8 Message-ID: References: <20221106220143.2129263-1-catalin.marinas@arm.com> Precedence: bulk X-Mailing-List: iommu@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Wed, Apr 19, 2023 at 05:06:04PM +0100, Catalin Marinas wrote: > I rebased it locally but the last stumbling block is sorting out the > iommu bouncing. I was hoping Robin Murphy can lend a hand but he's been > busy with other bits. I'll repost the series at 6.4-rc1. Hey Catalin, just following up on this. I think it might be worthwhile to split this series into two series: Series 1: Decouple ARCH_KMALLOC_MINALIGN from ARCH_DMA_MINALIGN, and use the cacheline size to determine the minimum kmalloc alignment. Series 2: Lower the minimum kmalloc alignment to 8 bytes by adding support for using SWIOTLB to bounce unaligned kmalloc buffers for DMA transactions. Dividing the patches as such has the advantage of lowering the minimum kmalloc alignment to 64 bytes on many ARM64 systems while the work for lowering the minimum alignment to 8 bytes proceeds. This provides a noticeable decrease in the slab memory footprint (e.g. I observed a 15 MB decrease in slab usage on a device I was using). What are your thoughts on this? --Isaac 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 EAA07C77B7D for ; Mon, 15 May 2023 19:09:51 +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=KbfYwGvh1zd01y5Of0WViFYrFRp7dJL6ugMU7wi145s=; b=kexDS20IOfTPnh H873VzNoNALmFnauFC1QVpXJnZkYejvU+lbsD1NnYAjRneb8ZMK2e9JP9ujNasS+J2easz57Oc/6i fU7BsNco8EaIOoSmDurUD6sk+0UUk/cKOnRsScY1fTAgIybRwaU3tJJOdXbPatV1RGNrxnainxKJQ Dfhzuc5KDCCH0gPHdk6uqcQ4AmE5NIUeUH+8pn8IGJL5OoTUKi75f78qwwsqH5/iCorIJR1IQV8I6 v/PXdpglAhLCKnOY3PPB1aynWh9tMAI0KkwaI9J0mml6DI1GSF0A5MGa0dsmWvR7HjCOlE98dcckg GyVokW0fie3q8Olo1HCg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pydZZ-003Ean-2H; Mon, 15 May 2023 19:09:29 +0000 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pydZX-003EYa-00 for linux-arm-kernel@lists.infradead.org; Mon, 15 May 2023 19:09:28 +0000 Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1aae90f5ebcso720675ad.1 for ; Mon, 15 May 2023 12:09:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1684177758; x=1686769758; 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=NScEF4DUT2RK1kg1ycQM1CBgCg/fSirJtyzV/whK0J0=; b=OC0n6O9mt8GEKWsOuiJlnAMyqeZY0/5tkzV4mYOVlaKSWY/9pW0fmBpr1lTRRaY+kx zmTHiiXRSd5rL/KZBC/d5bJY7dwa3Z9nYpiykc5TkluI4pfv2JZQbHN5W1q02vevK64P mUYLgKP2lJ9ANa5mCrBgiTBq473BLqTADQfY89IHqfhYx1RlFkAHR5G4ytTwaX95J4BP 5oZSFQa0Vpgrx7t7MkcF5DH0/GKNVwYK1ScMJPbrOsgpit1nwJR6/5ZG3Ll6ESaOYBgX e5XFltTBPFiU0N2Af/eN5yTe5I2EQlthcMUKOqOfxpmkzBw2dIBtcBm3taDJYVD6xs0j nvqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684177758; x=1686769758; 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=NScEF4DUT2RK1kg1ycQM1CBgCg/fSirJtyzV/whK0J0=; b=bs/2dpIOWd3q5rLFihKymxTL3xehvrvbc0rV0xKfJwH+wdNa9+Mhs+YD4VS+FT/Cgz l+Pa/Qqxubt84UYNawnJj4nBULFYZX+fMo7n0vWnCstR0atDS9RJVaqFnOCTAVOlME0m lDNl9TCHm/3ZhP06LOU6Zh+gdSUOQU/ow4SOrVzA8Yf5G1RR1mNSqUWqqy4cpNFjWw9p hpCRKxAtlZWGu1r7bNPiZ8EFLXi3s1rVw/GgJKwRtJYWO/kxktyAtqqpH4GoaDR61KHa E2v5VX1h+eIIsy1g5iTSjJrObfG6dU2Yzpc7IF3DQIU0Jy0k4QefU8102XDqkfCcHQR0 82Og== X-Gm-Message-State: AC+VfDxWSGAv8WvfmtecuFuy80eDuaqUJQ+lyJlIolEFsz/mtLoigNt1 jtvBGR5OvE8yvXgcvEWZMUW02g== X-Google-Smtp-Source: ACHHUZ6ZwVUoftc1tRpuaAlUdt1ybXqL+4C27qcMcoX/qt34Q62hQcY9bonn36MRLP7Pkq4ToUtlhQ== X-Received: by 2002:a17:902:ea02:b0:1a9:bb1d:64e with SMTP id s2-20020a170902ea0200b001a9bb1d064emr8433plg.15.1684177757962; Mon, 15 May 2023 12:09:17 -0700 (PDT) Received: from google.com ([2620:15c:2d:3:b860:7e3e:331f:4d8b]) by smtp.gmail.com with ESMTPSA id m5-20020a170902768500b001a682a195basm13906296pll.28.2023.05.15.12.09.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 May 2023 12:09:17 -0700 (PDT) Date: Mon, 15 May 2023 12:09:12 -0700 From: Isaac Manjarres To: Catalin Marinas Cc: Linus Torvalds , Arnd Bergmann , Christoph Hellwig , Greg Kroah-Hartman , Will Deacon , Marc Zyngier , Andrew Morton , Herbert Xu , Ard Biesheuvel , Saravana Kannan , Alasdair Kergon , Daniel Vetter , Joerg Roedel , Mark Brown , Mike Snitzer , "Rafael J. Wysocki" , Robin Murphy , linux-mm@kvack.org, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Petr Tesarik Subject: Re: [PATCH v3 00/13] mm, dma, arm64: Reduce ARCH_KMALLOC_MINALIGN to 8 Message-ID: References: <20221106220143.2129263-1-catalin.marinas@arm.com> 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-20230515_120927_038005_F4A95E7C X-CRM114-Status: GOOD ( 15.16 ) 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 Wed, Apr 19, 2023 at 05:06:04PM +0100, Catalin Marinas wrote: > I rebased it locally but the last stumbling block is sorting out the > iommu bouncing. I was hoping Robin Murphy can lend a hand but he's been > busy with other bits. I'll repost the series at 6.4-rc1. Hey Catalin, just following up on this. I think it might be worthwhile to split this series into two series: Series 1: Decouple ARCH_KMALLOC_MINALIGN from ARCH_DMA_MINALIGN, and use the cacheline size to determine the minimum kmalloc alignment. Series 2: Lower the minimum kmalloc alignment to 8 bytes by adding support for using SWIOTLB to bounce unaligned kmalloc buffers for DMA transactions. Dividing the patches as such has the advantage of lowering the minimum kmalloc alignment to 64 bytes on many ARM64 systems while the work for lowering the minimum alignment to 8 bytes proceeds. This provides a noticeable decrease in the slab memory footprint (e.g. I observed a 15 MB decrease in slab usage on a device I was using). What are your thoughts on this? --Isaac _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel