* Coherent memory allocator
@ 2010-07-29 10:50 Andrew Murray
2010-07-29 11:16 ` Conrad Parker
0 siblings, 1 reply; 2+ messages in thread
From: Andrew Murray @ 2010-07-29 10:50 UTC (permalink / raw)
To: linux-sh
Hello,
Whilst trying to reduce boot time on an SH kernel I noticed the
coherent memory allocator (dma_generic_alloc_coherent) in
arch/sh/mm/consistent.c always memset's the memory it allocates to 0 -
regardless of the user's intention (i.e use of __GFP_ZERO flag as
argument).
I would expect this function to not memset it's memory and instead
allow the user to specify if they want the memory zeroed through the
gfp flags. This would ensure memory is only zeroed when required - and
when it is required the __get_free_pages implementation uses the more
efficient clear_page implementation.
However removing the memset may break drivers than rely on zeroed
memory even though they don't request it.
Is my reasoning valid? Shall I submit a patch?
Thanks,
Andrew Murray
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Coherent memory allocator
2010-07-29 10:50 Coherent memory allocator Andrew Murray
@ 2010-07-29 11:16 ` Conrad Parker
0 siblings, 0 replies; 2+ messages in thread
From: Conrad Parker @ 2010-07-29 11:16 UTC (permalink / raw)
To: linux-sh
On 29 July 2010 19:50, Andrew Murray <amurray@mpcdata.com> wrote:
> Hello,
>
> Whilst trying to reduce boot time on an SH kernel I noticed the
> coherent memory allocator (dma_generic_alloc_coherent) in
> arch/sh/mm/consistent.c always memset's the memory it allocates to 0 -
> regardless of the user's intention (i.e use of __GFP_ZERO flag as
> argument).
>
> I would expect this function to not memset it's memory and instead
> allow the user to specify if they want the memory zeroed through the
> gfp flags. This would ensure memory is only zeroed when required - and
> when it is required the __get_free_pages implementation uses the more
> efficient clear_page implementation.
>
> However removing the memset may break drivers than rely on zeroed
> memory even though they don't request it.
>
> Is my reasoning valid? Shall I submit a patch?
I have no idea if your reasoning is valid, but in general if you send
a patch to the list then it makes it easier for anyone who might be
affected to test if their environment breaks ... no need to ask for
permission to send a patch :)
Conrad.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-07-29 11:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-29 10:50 Coherent memory allocator Andrew Murray
2010-07-29 11:16 ` Conrad Parker
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).