From: Glauber Costa <glommer@parallels.com>
To: Christoph Lameter <cl@linux.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>,
linux-mm@kvack.org, Pekka Enberg <penberg@kernel.org>,
David Rientjes <rientjes@google.com>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: Any reason to use put_page in slub.c?
Date: Thu, 2 Aug 2012 11:55:14 +0400 [thread overview]
Message-ID: <501A3262.6090407@parallels.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1208011307450.4606@router.home>
On 08/01/2012 10:10 PM, Christoph Lameter wrote:
> On Wed, 1 Aug 2012, Glauber Costa wrote:
>
>> I've audited all users of get_page() in the drivers/ directory for
>> patterns like this. In general, they kmalloc something like a table of
>> entries, and then get_page() the entries. The entries are either user
>> pages, pages allocated by the page allocator, or physical addresses
>> through their pfn (in 2 cases from the vga ones...)
>>
>> I took a look about some other instances where virt_to_page occurs
>> together with kmalloc as well, and they all seem to fall in the same
>> category.
>
> The case that was notorious in the past was a scsi control structure
> allocated from slab that was then written to the device via DMA. And it
> was not on x86 but some esoteric platform (powerpc?),
>
> A reference to the discussion of this issue in 2007:
>
> http://lkml.indiana.edu/hypermail/linux/kernel/0706.3/0424.html
>
Thanks.
So again, I've scanned across that thread, and found some very useful
excerpts from it, that can only argue in favor of my patch =)
"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."
"So someone played loose ball with the slab, was successful and that
makes it right now?"
Looking at the code again, I see that page_mapping(), that ends up being
called to do the translation in those pathological cases now features a
VM_BUG_ON(), put in place by yourself. This dates back from 2007, giving
me enough reason to believe that whatever issue still existed back then
is already sorted out - or nobody really cares.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2012-08-02 7:58 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-27 12:19 Any reason to use put_page in slub.c? Glauber Costa
2012-07-27 15:55 ` Christoph Lameter
2012-07-30 7:53 ` Glauber Costa
2012-07-30 19:23 ` Christoph Lameter
2012-07-31 8:25 ` Glauber Costa
2012-07-31 14:09 ` Christoph Lameter
2012-07-31 14:09 ` Glauber Costa
2012-07-31 14:17 ` Christoph Lameter
2012-07-31 14:18 ` Glauber Costa
2012-07-31 14:31 ` Christoph Lameter
2012-07-31 14:52 ` James Bottomley
2012-08-01 12:42 ` Glauber Costa
2012-08-01 18:10 ` Christoph Lameter
2012-08-02 7:55 ` Glauber Costa [this message]
2012-08-02 8:07 ` James Bottomley
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=501A3262.6090407@parallels.com \
--to=glommer@parallels.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=akpm@linux-foundation.org \
--cc=cl@linux.com \
--cc=linux-mm@kvack.org \
--cc=penberg@kernel.org \
--cc=rientjes@google.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.