From: Hugh Dickins <hugh@veritas.com>
To: Christoph Lameter <clameter@sgi.com>
Cc: Russell King <rmk+lkml@arm.linux.org.uk>,
Linus Torvalds <torvalds@linux-foundation.org>,
Nicolas Ferre <nicolas.ferre@rfo.atmel.com>,
ARM Linux Mailing List <linux-arm-kernel@lists.arm.linux.org.uk>,
Linux Kernel list <linux-kernel@vger.kernel.org>,
Marc Pignat <marc.pignat@hevs.ch>,
Andrew Victor <andrew@sanpeople.com>,
Pierre Ossman <drzeus@drzeus.cx>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: Oops in a driver while using SLUB as a SLAB allocator
Date: Mon, 25 Jun 2007 19:43:43 +0100 (BST) [thread overview]
Message-ID: <Pine.LNX.4.64.0706251933540.13382@blonde.wat.veritas.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0706251108180.8907@schroedinger.engr.sgi.com>
On Mon, 25 Jun 2007, Christoph Lameter wrote:
> On Mon, 25 Jun 2007, Hugh Dickins wrote:
> >
> > I didn't claim that flush_dcache_page(virt_to_page(virt)) is not expected
> > to work. I claim that flush_dcache_page is expected to be a noop rather
> > than an oops on a kmalloced page.
>
> There are no kmalloced pages. There is only kmalloced memory. You allocate
> pages from the page allocator. Its a layering violation to expect a page
> struct operation on a slab object to work.
Oh, thanks so much for resolving my confusion on that.
>
> It is not okay to use a page cache function on a slab object. The slab
> object does not fulfill the alignment requirements of a page cache page
> nor does it have a compatible page struct content as a page cache page.
> This can only cause trouble.
>
> The problem is that the code is allocating some slab memory and then
> determines the page struct pointer and then hands it back to the DMA
> layer?
>
> > > Ok. I think your patch is fine as a quick fix for 2.6.22. I am a bit
> > > uneasy with that given that its in such a broadly used function while its
> > > only use is to enable flush_dcache_page to work. But we need the general
> > > issue taken care of after 2.6.22.
> >
> > What general issue?
>
> How to flush slab objects in a reliable way.
>
> > Please see Documentation/cachetlb.txt: flush_dcache_page is about
> > pagecache pages mapped into userspace. We don't use kmalloc for those,
> > but we do sometimes need to flush_dcache_page in places which commonly
> > deal with pagecache pages, but sometimes handle kmalloc'ed buffers too.
> > Luckily we don't have to deal with buffers in which the first page is
> > kmalloced and the next comes from pagecache.
>
> This gets crazier and crazier. flush_dcache_page is for pages not for
> allocated buffers via kmalloc. So this has nothing to do with any need
> to flush slab objects?
>
> Sometimes we do this and then we do that? So someone played loose
> ball with the slab, was successful and that makes it right now?
>
> We need the VM_BUG_ON in include/linux/mm.h to stop this nonsense.
>
> The "sometimes we have kmalloced buffers" locations need to be fixed.
I've said enough, I'd better leave it to others to deter you or not
from fiddling around pointlessly here.
But Andrew, please cancel my Acked-by to mm's
add-vm_bug_on-in-case-someone-uses-page_mapping-on-a-slab-page.patch
Thanks,
Hugh
next prev parent reply other threads:[~2007-06-25 18:44 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-21 9:30 Nicolas Ferre
2007-06-21 14:54 ` Marc Pignat
2007-06-21 14:57 ` Marc Pignat
2007-06-21 15:54 ` Nicolas Ferre
2007-06-22 6:28 ` [PATCH] mmc-atmel : fix kunmap wrong usage Marc Pignat
2007-06-22 12:00 ` Hugh Dickins
2007-06-22 13:34 ` Nicolas Ferre
2007-06-22 13:46 ` Hugh Dickins
2007-06-22 14:21 ` Marc Pignat
2007-06-22 14:58 ` Marc Pignat
2007-06-22 19:00 ` Jens Axboe
2007-06-22 9:09 ` Oops in a driver while using SLUB as a SLAB allocator Nicolas Ferre
2007-06-21 22:27 ` Hugh Dickins
2007-06-22 1:01 ` Christoph Lameter
2007-06-22 4:26 ` Hugh Dickins
2007-06-22 5:13 ` Christoph Lameter
2007-06-22 7:00 ` Russell King
2007-06-22 1:36 ` Christoph Lameter
2007-06-22 4:40 ` Hugh Dickins
2007-06-22 5:10 ` Christoph Lameter
2007-06-22 5:37 ` Hugh Dickins
2007-06-22 16:40 ` Linus Torvalds
2007-06-22 17:26 ` Christoph Lameter
2007-06-22 17:41 ` Christoph Lameter
2007-06-22 18:39 ` Hugh Dickins
2007-06-22 18:51 ` Christoph Lameter
2007-06-22 19:01 ` Hugh Dickins
2007-06-22 19:11 ` Christoph Lameter
2007-06-22 20:21 ` Hugh Dickins
2007-06-22 22:54 ` Christoph Lameter
2007-06-22 20:15 ` Christoph Lameter
2007-06-23 10:40 ` Oleg Verych
2007-06-24 8:38 ` Russell King
2007-06-24 10:24 ` Hugh Dickins
2007-06-24 10:51 ` Russell King
2007-06-25 0:25 ` Hugh Dickins
2007-06-25 13:55 ` Nicolas Ferre
2007-06-25 14:07 ` Christoph Lameter
2007-06-25 16:42 ` Hugh Dickins
2007-06-25 17:00 ` Christoph Lameter
2007-06-25 17:23 ` Hugh Dickins
2007-06-25 18:23 ` Christoph Lameter
2007-06-25 18:43 ` Hugh Dickins [this message]
2007-06-25 18:50 ` Christoph Lameter
2007-06-25 19:04 ` Hugh Dickins
2007-06-26 18:09 ` Christoph Lameter
2007-06-22 20:18 ` Russell King
2007-06-22 1:41 ` Christoph Lameter
2007-06-22 4:46 ` Hugh Dickins
2007-06-22 5:31 ` Christoph Lameter
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=Pine.LNX.4.64.0706251933540.13382@blonde.wat.veritas.com \
--to=hugh@veritas.com \
--cc=akpm@linux-foundation.org \
--cc=andrew@sanpeople.com \
--cc=clameter@sgi.com \
--cc=drzeus@drzeus.cx \
--cc=linux-arm-kernel@lists.arm.linux.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=marc.pignat@hevs.ch \
--cc=nicolas.ferre@rfo.atmel.com \
--cc=rmk+lkml@arm.linux.org.uk \
--cc=torvalds@linux-foundation.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®