From: "Håvard Skinnemoen" <hskinnemoen@gmail.com>
To: "Christoph Lameter" <clameter@sgi.com>
Cc: "Haavard Skinnemoen" <hskinnemoen@atmel.com>,
"Linux Kernel" <linux-kernel@vger.kernel.org>
Subject: Re: kernel BUG at mm/slub.c:3689!
Date: Mon, 11 Jun 2007 20:22:07 +0200 [thread overview]
Message-ID: <1defaf580706111122n78ab46c3sda05cbd4ace97319@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0706111041160.17264@schroedinger.engr.sgi.com>
On 6/11/07, Christoph Lameter <clameter@sgi.com> wrote:
> Ok. Drop the patch and use this one instead. This one avoids the use
> of smaller slabs that cause the conflict. The first slab will be sized 32
> bytes instead of 8.
Thanks, I'll test it tomorrow.
> Note that I do not get why you would be aligning the objects to 32 bytes.
> Increasing the smallest cache size wastes a lot of memory. And it is
> usually advantageous if multiple related objects are in the same cacheline
> unless you have heavy SMP contention.
It's not about performance at all, it's about DMA buffers allocated
using kmalloc() getting corrupted. Imagine this:
1. A SPI protocol driver allocates a buffer using kmalloc()
2. SPI master driver receives a request and flushes all cachelines
touched by the buffer (using dma_map_single()) before handing it to
the DMA controller.
3. While the transfer is in progress, something else comes along and
reads something from a different buffer which happens to share a
cacheline with the buffer currently being used for DMA.
4. When the transfer is complete, the protocol driver will see stale
data because a part of the buffer was fetched by the dcache before the
received data was stored in RAM by the DMA controller.
Maybe there are other solutions to this problem, but the old SLAB
allocator did guarantee 32-byte alignment as long as SLAB debugging
was turned off, so setting ARCH_KMALLOC_MINALIGN seemed like the
easiest way to get back to the old, known-working behaviour.
It could be that I've underestimated the AVR32 AP cache though; I
think it can do partial writeback of cachelines, so it could be a
solution to writeback+invalidate the parts of the buffer that may have
shared cachelines from dma_unmap_*() and dma_sync_*_for_cpu(). It will
probably hit a few false positives since it might not always see the
whole buffer, but perhaps it's worth it.
Haavard
next prev parent reply other threads:[~2007-06-11 18:22 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-11 14:19 Haavard Skinnemoen
2007-06-11 15:38 ` Paul Mundt
2007-06-11 15:58 ` Håvard Skinnemoen
2007-06-11 16:19 ` Christoph Lameter
2007-06-11 16:43 ` Håvard Skinnemoen
2007-06-11 16:49 ` Christoph Lameter
2007-06-11 17:11 ` Håvard Skinnemoen
2007-06-11 17:52 ` Christoph Lameter
2007-06-11 18:22 ` Håvard Skinnemoen [this message]
2007-06-11 18:32 ` Christoph Lameter
2007-06-11 19:04 ` Håvard Skinnemoen
2007-06-11 19:11 ` Christoph Lameter
2007-06-11 19:35 ` Håvard Skinnemoen
2007-06-11 19:40 ` Christoph Lameter
2007-06-11 19:53 ` Håvard Skinnemoen
2007-06-12 3:16 ` Christoph Lameter
2007-06-12 8:55 ` Haavard Skinnemoen
2007-06-12 10:16 ` Haavard Skinnemoen
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=1defaf580706111122n78ab46c3sda05cbd4ace97319@mail.gmail.com \
--to=hskinnemoen@gmail.com \
--cc=clameter@sgi.com \
--cc=hskinnemoen@atmel.com \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®