From: Ezequiel Garcia <elezegarcia@gmail.com>
To: Christoph Lameter <cl@linux.com>
Cc: linux-mm@kvack.org, Pekka Enberg <penberg@kernel.org>,
Glauber Costa <glommer@parallels.com>
Subject: Re: [RFC/PATCH 2/2] mm, slob: Save real allocated size in page->private
Date: Tue, 14 Aug 2012 12:06:59 -0300 [thread overview]
Message-ID: <CALF0-+VNfZ07jAiyKBGzrRGOz5QDy1ybGRmXL9JyXGTJAyHkBA@mail.gmail.com> (raw)
In-Reply-To: <0000013925a326f6-c47d16cb-5c67-4a28-ab5c-e0c3c9fbf610-000000@email.amazonses.com>
Hi Christoph,
Thanks for your comments.
On Tue, Aug 14, 2012 at 11:56 AM, Christoph Lameter <cl@linux.com> wrote:
> On Tue, 14 Aug 2012, Ezequiel Garcia wrote:
>
>> As documented in slob.c header, page->private field is used to return
>> accurately the allocated size, through ksize().
>> Therefore, if one allocates a contiguous set of pages the available size
>> is PAGE_SIZE << order, instead of the requested size.
>
> I would prefer if you would remove this strange feature from slob. The
> ksize for a !PageSlab() "slab" page is always PAGE_SIZE << compound_order(page).
> There is no need to use page->private here. It is a bad practice to not
> mark a page as a slab page but then use fields for special purposes.
>
Mmm, I see. Sounds sensible.
Fortunately I don't have to squeeze my brain thinking,
since I have a nice example of this in slub's ksize().
if (unlikely(!PageSlab(page))) {
WARN_ON(!PageCompound(page));
return PAGE_SIZE << compound_order(page);
}
I'll resend this patch alone with implementing something like
it and removing page->private usage.
Thanks again!
Ezequiel.
--
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-14 15:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-14 14:38 [PATCH 1/2] mm, slob: Prevent false positive trace upon allocation failure Ezequiel Garcia
2012-08-14 14:38 ` [RFC/PATCH 2/2] mm, slob: Save real allocated size in page->private Ezequiel Garcia
2012-08-14 14:56 ` Christoph Lameter
2012-08-14 15:06 ` Ezequiel Garcia [this message]
2012-08-14 14:52 ` [PATCH 1/2] mm, slob: Prevent false positive trace upon allocation failure Christoph Lameter
2012-08-15 12:34 ` Ezequiel Garcia
2012-08-15 12:43 ` Pekka Enberg
2012-09-04 7:32 ` Pekka Enberg
2012-09-04 9:39 ` Ezequiel Garcia
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=CALF0-+VNfZ07jAiyKBGzrRGOz5QDy1ybGRmXL9JyXGTJAyHkBA@mail.gmail.com \
--to=elezegarcia@gmail.com \
--cc=cl@linux.com \
--cc=glommer@parallels.com \
--cc=linux-mm@kvack.org \
--cc=penberg@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