From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
To: Arun Sharma <asharma@fb.com>
Cc: linux-mm@kvack.org, Davide Libenzi <davidel@xmailserver.org>,
Johannes Weiner <hannes@cmpxchg.org>,
Balbir Singh <balbir@linux.vnet.ibm.com>
Subject: Re: MAP_NOZERO revisited
Date: Thu, 5 Jan 2012 16:23:11 +0900 [thread overview]
Message-ID: <20120105162311.09dac4b7.kamezawa.hiroyu@jp.fujitsu.com> (raw)
In-Reply-To: <4F04F0B9.5040401@fb.com>
On Wed, 4 Jan 2012 16:37:13 -0800
Arun Sharma <asharma@fb.com> wrote:
>
> A few years ago, Davide posted patches to address clear_page() showing
> up high in the kernel profiles.
>
> http://thread.gmane.org/gmane.linux.kernel/548928
>
> With malloc implementations that try to conserve the RSS by madvising
> away unused pages that are dirty (i.e. faulted in), we pay a high cost
> in clear_page() if that page is needed later by the same process.
>
> Now that we have memcgs with their own LRU lists, I was thinking of a
> MAP_NOZERO implementation that tries to avoid zero'ing the page if it's
> coming from the same memcg.
>
> This will probably need an extra PCG_* flag maintaining state about
> whether the page was moved between memcgs since last use.
>
When pages are freed, it goes back to global page allocator.
memcg has no page allocator hooks for alloc/free.
We, memcg guys, tries to reduce size of page_cgroup remove page_cgroup->flags.
And finally want to integrate it to struct 'page'.
So, I don't like your idea very much.
please find another way.
> Security implications: this is not as good as the UID based checks in
> Davide's implementation, so should probably be an opt-in instead of
> being enabled by default.
>
I think you need an another page allocator as hugetlb.c does and need to
maintain 'page pool'.
Thanks,
-Kame
--
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:[~2012-01-05 7:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-05 0:37 Arun Sharma
2012-01-05 7:23 ` KAMEZAWA Hiroyuki [this message]
2012-01-11 18:50 ` MAP_UNINITIALIZED (Was Re: MAP_NOZERO revisited) Arun Sharma
2012-01-12 5:10 ` Balbir Singh
2012-01-12 18:16 ` Arun Sharma
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=20120105162311.09dac4b7.kamezawa.hiroyu@jp.fujitsu.com \
--to=kamezawa.hiroyu@jp.fujitsu.com \
--cc=asharma@fb.com \
--cc=balbir@linux.vnet.ibm.com \
--cc=davidel@xmailserver.org \
--cc=hannes@cmpxchg.org \
--cc=linux-mm@kvack.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