linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: David Daney <ddaney@caviumnetworks.com>
Cc: linux-mips@linux-mips.org
Subject: Re: [PATCH] Staging: Octeon Ethernet: Fix memory allocation.
Date: Wed, 27 Jan 2010 22:33:51 +0100	[thread overview]
Message-ID: <20100127213351.GA15380@linux-mips.org> (raw)
In-Reply-To: <1264627373-31780-1-git-send-email-ddaney@caviumnetworks.com>

On Wed, Jan 27, 2010 at 01:22:53PM -0800, David Daney wrote:

> After aligning the blocks returned by kmalloc, we need to save the
> original pointer so they can be correctly freed.
> 
> There are no guarantees about the alignment of SKB data, so we need to
> handle worst case alignment.
> 
> Since right shifts over subtraction have no distributive property, we
> need to fix the back pointer calculation.
> 
> Signed-off-by: David Daney <ddaney@caviumnetworks.com>
> ---
> 
> The original in the linux-queue tree is broken as it assumes the
> kmalloc returns aligned blocks.  This is not the case when slab
> debugging is enabled.

Queue updated - but shouldn't the magic numbers 128 rsp 256 all over this
patch be replaced by L1_CACHE_SHIFT rsp 2 * L1_CACHE_SHIFT?

  Ralf

  reply	other threads:[~2010-01-27 21:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-27 21:22 [PATCH] Staging: Octeon Ethernet: Fix memory allocation David Daney
2010-01-27 21:33 ` Ralf Baechle [this message]
2010-01-27 22:11   ` David Daney

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=20100127213351.GA15380@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=ddaney@caviumnetworks.com \
    --cc=linux-mips@linux-mips.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).