linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Mundt <lethal@linux-sh.org>
To: linux-sh@vger.kernel.org
Subject: Re: [PATCH] sh: Remove memset from coherent memory allocator (for comments)
Date: Wed, 04 Aug 2010 07:37:20 +0000	[thread overview]
Message-ID: <20100804073719.GB15098@linux-sh.org> (raw)
In-Reply-To: <AANLkTi=0=kR49SHE8mistKJ0hPpjwUk=xXSMw=K_i9Ne@mail.gmail.com>

On Thu, Jul 29, 2010 at 03:03:20PM +0100, Andrew Murray wrote:
> > -----Original Message-----
> > From: Matt Fleming [mailto:matt@console-pimps.org]
> > Your mail client has word wrapped this patch. Check out
> > Documentation/email-clients.txt to see if there are any tips for your
> > client.
> >
> > This patch seems OK in principal but I think there's a safer way to get
> > the results you want. With your patch, you've changed the semantics of
> > dma_generic_alloc_coherent().  Previously it was guaranteed to return a
> > chunk of zero'd memory, now you're relying on the caller passing
> > __GFP_ZERO to indicate whether they want zero'd memory or not. Which
> > means that if there's a bit of code that expects zero'd memory but
> > doesn't pass __GFP_ZERO, it'll now be broken.
> >
> > (You could argue that this hypothetical caller of dma_alloc_coherent()
> > is already broken if it doesn't pass __GFP_ZERO but my point is that it
> > could be a lot of work to track down all the callers and figure out
> > exactly what guarantees they expect).
> >
> > The safest approach is to follow what x86 does in its
> > dma_generic_alloc_coherent() implementation; it adds the __GFP_ZERO
> > flag
> > unconditionally before allocating pages.
> 
> I share your concern (and also make the broken caller argument). New
> patch...
> 
> From: Andrew Murray <amurray@mpc-data.co.uk>
> 
> This patch reduces the time taken to allocate coherent dma memory.
> 
> Signed-off-by: Andrew Murray <amurray@mpc-data.co.uk>

Looks ok to me. What sort of numbers are we looking at, precisely? It's
been awhile since I profiled our page clearing code, and it would be nice
to see how that compares against a flat memset() on variable page sizes.

  parent reply	other threads:[~2010-08-04  7:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-29 11:50 [PATCH] sh: Remove memset from coherent memory allocator (for Andrew Murray
2010-07-29 13:13 ` [PATCH] sh: Remove memset from coherent memory allocator (for comments) Matt Fleming
2010-07-29 14:03 ` [PATCH] sh: Remove memset from coherent memory allocator (for Andrew Murray
2010-07-29 19:36 ` Guennadi Liakhovetski
2010-07-29 19:52 ` [PATCH] sh: Remove memset from coherent memory allocator (for comments) Matt Fleming
2010-08-04  7:37 ` Paul Mundt [this message]
2010-08-04  7:53 ` [PATCH] sh: Remove memset from coherent memory allocator (for Andrew Murray

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=20100804073719.GB15098@linux-sh.org \
    --to=lethal@linux-sh.org \
    --cc=linux-sh@vger.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;
as well as URLs for NNTP newsgroup(s).