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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A7944C2D0CD for ; Tue, 17 Dec 2019 15:45:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7C6F12467B for ; Tue, 17 Dec 2019 15:45:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576597539; bh=d7eBLm0I/s6DFoeNSrPqJMhc9kKOaXOaEqRZCmy2Vmo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=dEn4MGS/rhkhU6oqWaYcxoTYQuIa5T7B84xlZpDU8d958zdCpBf4j8lPP56FiavzW cYCVkUIaXIfVvaDWuf/zuTwh2ZuW4mF1n6EZDslDNFKgNESGPoYHsXb/m1VurUUEtJ +ZvwVMBNbOt4vJjQLiqAGyUChr1qA0q164eM358k= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727901AbfLQPpi (ORCPT ); Tue, 17 Dec 2019 10:45:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:35562 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727161AbfLQPpi (ORCPT ); Tue, 17 Dec 2019 10:45:38 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F21DA2465E; Tue, 17 Dec 2019 15:45:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576597537; bh=d7eBLm0I/s6DFoeNSrPqJMhc9kKOaXOaEqRZCmy2Vmo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=X4CsLVd0lOXz/T69EzqjaRx4hpxWylyCBLDEOxoWCqpBcgv0AQoJgp/WzvAF0Uv2C 1oy4/yMfmBWnFF0OYpXtlKw52w3N3F8G42BsTSkH4bxP52b59/nA/4nX81hzQ/gr5b a8Dc+Hlb2npc3p/dnY0NONQD2QCl9sMekBmCVMps= Date: Tue, 17 Dec 2019 16:45:35 +0100 From: Greg Kroah-Hartman To: Alexey Brodkin , Marc Gonzalez Cc: Rafael Wysocki , LKML , Robin Murphy , Dmitry Torokhov , Alexey Brodkin , Peter Zijlstra , Will Deacon , Russell King , Bjorn Andersson , Tejun Heo , Mark Brown , Linux ARM Subject: Re: [RFC PATCH v1] devres: align devres.data strictly only for devm_kmalloc() Message-ID: <20191217154535.GA3718632@kroah.com> References: <74ae22cd-08c1-d846-3e1d-cbc38db87442@free.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <74ae22cd-08c1-d846-3e1d-cbc38db87442@free.fr> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 17, 2019 at 04:30:54PM +0100, Marc Gonzalez wrote: > Commit a66d972465d15 ("devres: Align data[] to ARCH_KMALLOC_MINALIGN") > increased the alignment of devres.data unconditionally. > > Some platforms have very strict alignment requirements for DMA-safe > addresses, e.g. 128 bytes on arm64. There, struct devres amounts to: > 3 pointers + pad_to_128 + data + pad_to_256 > i.e. ~220 bytes of padding. > > Let's enforce the alignment only for devm_kmalloc(). > > Suggested-by: Robin Murphy > Signed-off-by: Marc Gonzalez > --- > I had not been aware that dynamic allocation granularity on arm64 was > 128 bytes. This means there's a lot of waste on small allocations. > I suppose there's no easy solution, though. > --- > drivers/base/devres.c | 23 +++++++++++++---------- > 1 file changed, 13 insertions(+), 10 deletions(-) You need to get Alexey to agree with this, he's the one that hit this on ARC :) thanks, greg k-h 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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 018CEC43603 for ; Tue, 17 Dec 2019 15:45:45 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id CA0C324679 for ; Tue, 17 Dec 2019 15:45:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="B4fVf125"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="X4CsLVd0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CA0C324679 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject: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=3NKzKherzi0PdBehEU7Fq1KrEf6jftHwucM3XsVj+xE=; b=B4fVf12576U58s 23OKjSVVyNbHgE6Sx/ZUaZl1f0bUCdpFa5JodP9sEtZUZQ6Y1Yyb9Lx43JUVsgMHPRPOR2hleGcZJ eRquDKsFn2YyyK38kfTnOGXV+Vd83+wZ/iyGwR/lenAMM+/qnzx4G1LahMCpe0Pq0+bDPDeEUl0dS +Vw4ZADlPkMZkLJmewWsTWyflq5f27hUlTNrR7nNZ6pLmMSYm/VskERZHcb2e94HBQXtLsXbttIob 6vZjkV+g3pfCCW+enZwep9/ixUNF/Akvv6LusP/CvaThCkDKJ7pS+vNwJdVY5RTGHeUrDDmKYBdcF eG/KZ10Q0eMG6sI/67MA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ihF2b-00052P-0s; Tue, 17 Dec 2019 15:45:41 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ihF2Y-00051p-42 for linux-arm-kernel@lists.infradead.org; Tue, 17 Dec 2019 15:45:39 +0000 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F21DA2465E; Tue, 17 Dec 2019 15:45:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576597537; bh=d7eBLm0I/s6DFoeNSrPqJMhc9kKOaXOaEqRZCmy2Vmo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=X4CsLVd0lOXz/T69EzqjaRx4hpxWylyCBLDEOxoWCqpBcgv0AQoJgp/WzvAF0Uv2C 1oy4/yMfmBWnFF0OYpXtlKw52w3N3F8G42BsTSkH4bxP52b59/nA/4nX81hzQ/gr5b a8Dc+Hlb2npc3p/dnY0NONQD2QCl9sMekBmCVMps= Date: Tue, 17 Dec 2019 16:45:35 +0100 From: Greg Kroah-Hartman To: Alexey Brodkin , Marc Gonzalez Subject: Re: [RFC PATCH v1] devres: align devres.data strictly only for devm_kmalloc() Message-ID: <20191217154535.GA3718632@kroah.com> References: <74ae22cd-08c1-d846-3e1d-cbc38db87442@free.fr> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <74ae22cd-08c1-d846-3e1d-cbc38db87442@free.fr> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191217_074538_180629_73648621 X-CRM114-Status: GOOD ( 11.65 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dmitry Torokhov , Peter Zijlstra , Will Deacon , Alexey Brodkin , Rafael Wysocki , LKML , Bjorn Andersson , Russell King , Mark Brown , Tejun Heo , Robin Murphy , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Dec 17, 2019 at 04:30:54PM +0100, Marc Gonzalez wrote: > Commit a66d972465d15 ("devres: Align data[] to ARCH_KMALLOC_MINALIGN") > increased the alignment of devres.data unconditionally. > > Some platforms have very strict alignment requirements for DMA-safe > addresses, e.g. 128 bytes on arm64. There, struct devres amounts to: > 3 pointers + pad_to_128 + data + pad_to_256 > i.e. ~220 bytes of padding. > > Let's enforce the alignment only for devm_kmalloc(). > > Suggested-by: Robin Murphy > Signed-off-by: Marc Gonzalez > --- > I had not been aware that dynamic allocation granularity on arm64 was > 128 bytes. This means there's a lot of waste on small allocations. > I suppose there's no easy solution, though. > --- > drivers/base/devres.c | 23 +++++++++++++---------- > 1 file changed, 13 insertions(+), 10 deletions(-) You need to get Alexey to agree with this, he's the one that hit this on ARC :) thanks, greg k-h _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel