mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Alexey Brodkin <alexey.brodkin@synopsys.com>,
	Marc Gonzalez <marc.w.gonzalez@free.fr>
Cc: Rafael Wysocki <rjw@rjwysocki.net>,
	LKML <linux-kernel@vger.kernel.org>,
	Robin Murphy <robin.murphy@arm.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Alexey Brodkin <alexey.brodkin@synopsys.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Will Deacon <will@kernel.org>,
	Russell King <rmk+kernel@armlinux.org.uk>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Tejun Heo <tj@kernel.org>, Mark Brown <broonie@kernel.org>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>
Subject: Re: [RFC PATCH v1] devres: align devres.data strictly only for devm_kmalloc()
Date: Tue, 17 Dec 2019 16:45:35 +0100	[thread overview]
Message-ID: <20191217154535.GA3718632@kroah.com> (raw)
In-Reply-To: <74ae22cd-08c1-d846-3e1d-cbc38db87442@free.fr>

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 <robin.murphy@arm.com>
> Signed-off-by: Marc Gonzalez <marc.w.gonzalez@free.fr>
> ---
> 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

  reply	other threads:[~2019-12-17 15:45 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-17 15:30 Marc Gonzalez
2019-12-17 15:45 ` Greg Kroah-Hartman [this message]
2019-12-17 16:17 ` Marc Gonzalez
2019-12-18 14:20 ` Alexey Brodkin
2019-12-18 15:40   ` Marc Gonzalez
2019-12-20 10:19 ` Marc Gonzalez
2019-12-20 10:22   ` Greg Kroah-Hartman
2019-12-20 10:22     ` Greg Kroah-Hartman
2019-12-20 12:05       ` Marc Gonzalez
2019-12-20 17:19         ` Peter Zijlstra
2019-12-20 14:06   ` Peter Zijlstra
2019-12-20 14:16     ` Greg Kroah-Hartman
2019-12-20 15:01     ` Robin Murphy
2019-12-20 17:13       ` Peter Zijlstra
2019-12-20 22:02         ` Robin Murphy
2020-01-06 10:05           ` Peter Zijlstra
2019-12-20 19:32       ` Alexey Brodkin
2019-12-20 20:23         ` Peter Zijlstra
2019-12-20 21:02           ` Alexey Brodkin
2019-12-20 21:47             ` Dmitry Torokhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191217154535.GA3718632@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=alexey.brodkin@synopsys.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=broonie@kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.w.gonzalez@free.fr \
    --cc=peterz@infradead.org \
    --cc=rjw@rjwysocki.net \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=robin.murphy@arm.com \
    --cc=tj@kernel.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome