From: Hugh Dickins <hughd@google.com>
To: mail@rsmogura.net
Cc: Andrea Arcangeli <aarcange@redhat.com>,
Radislaw Smogura <mail@rsmogura.eu>,
Andi Kleen <andi@firstfloor.org>,
linux-mm@kvack.org
Subject: Re: Hugepages for shm page cache (defrag)
Date: Fri, 15 Jul 2011 12:50:00 -0700 (PDT) [thread overview]
Message-ID: <alpine.LSU.2.00.1107151238390.7803@sister.anvils> (raw)
In-Reply-To: <60ac3a8f762dcc7a6e8767753ad55736@rsmogura.net>
On Thu, 14 Jul 2011, mail@rsmogura.net wrote:
> I working to remove errors from patch, and I integrated it with current THP
> infrastructure a little bit,
Great, thank you.
> but I want ask if following I do following -
> it's about get_page, put_page, get_page_unless_zero, put_page_test_zero.
>
> I want following logic I think it may be better (in x86):
> 1) Each THP page will start with 512 refcount (self + 511 tails)
> 2) Each get/put will increment usage count only on this page, same test
> variants will do (currently those do not make this, so split is broken)
> 3) On compounds put page will call put_page_test_zero, if true, it will do
> compound lock, ask again if it has 0, if yes it will decrease refcount of
> head, if it will fall to zero compound will be freed (double check lock).
> 4) Compound lock is this what caller will need to establish if it needs to
> operate on transparent huge page in whole.
>
> Motivation:
> I operate on page cache, many assumptions about concurrent call of
> put/get_page are and plain using those causes memory leaks, faults, dangling
> pointers, etc when I'm going to split compound page.
>
> Is this acceptable?
Sounds plausible, but I really don't know.
I do remember that refcounting compounds by head or by tail always raises
questions (and access via get_user_pages() is an easily-overlooked path
that needs to be kept in mind). But where THP stands today, and how it
needs to be changed for this, I have no idea - whereas Andrea, perhaps,
will recognize some of your points above and have a more useful response.
It's clear that you have much more of a grip on these details than I
have at present, so just be guided by the principle of not slowing
down the common paths.
Hugh
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2011-07-15 19:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-06 19:31 Radosław Smogura
2011-07-07 5:28 ` Andi Kleen
2011-07-07 12:02 ` mail
2011-07-08 0:07 ` Hugh Dickins
2011-07-14 20:15 ` mail
2011-07-15 19:50 ` Hugh Dickins [this message]
2011-07-30 16:15 ` [PATCH] Changes how ref-count of compound pages are managed Radosław Smogura
2011-08-07 17:03 ` Hugepages for shm page cache (defrag) Radosław Smogura
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=alpine.LSU.2.00.1107151238390.7803@sister.anvils \
--to=hughd@google.com \
--cc=aarcange@redhat.com \
--cc=andi@firstfloor.org \
--cc=linux-mm@kvack.org \
--cc=mail@rsmogura.eu \
--cc=mail@rsmogura.net \
/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