linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [RFC][PATCH 0/4] ZERO PAGE again v2
@ 2009-07-07  7:51 KAMEZAWA Hiroyuki
  2009-07-07  7:52 ` [RFC][PATCH 1/4] introduce pte_zero() KAMEZAWA Hiroyuki
                   ` (4 more replies)
  0 siblings, 5 replies; 34+ messages in thread
From: KAMEZAWA Hiroyuki @ 2009-07-07  7:51 UTC (permalink / raw)
  To: linux-mm@kvack.org
  Cc: npiggin, hugh.dickins@tiscali.co.uk, avi,
	akpm@linux-foundation.org, torvalds

Hi, this is ZERO_PAGE mapping revival patch v2.

ZERO PAGE was removed in 2.6.24 (=> http://lkml.org/lkml/2007/10/9/112)
and I had no objections.

In these days, at user support jobs, I noticed a few of customers
are making use of ZERO_PAGE intentionally...brutal mmap and scan, etc. 
(For example, scanning big sparse table and save the contents.)

They are using RHEL4-5(before 2.6.18) then they don't notice that ZERO_PAGE
is gone, yet.
yes, I can say  "ZERO PAGE is gone" to them in next generation distro.

Recently, a question comes to lkml (http://lkml.org/lkml/2009/6/4/383

Maybe there are some users of ZERO_PAGE other than my customers.
So, can't we use ZERO_PAGE again ?

IIUC, the problem of ZERO_PAGE was
  - reference count cache ping-pong
  - complicated handling.
  - the behavior page-fault-twice can make applications slow.

This patch is a trial to de-refcounted ZERO_PAGE.

This includes 4 patches.
[1/4] introduce pte_zero() at el.
[2/4] use ZERO_PAGE for READ fault in anonymous mapping.
[3/4] corner cases, get_user_pages()
[4/4] introduce get_user_pages_nozero().

I feel these patches needs to be clearer but includes almost all
messes we have to handle at using ZERO_PAGE again.

What I feel now is
 a. technically, we can do because we did.
 b. Considering maintenance, code's beauty etc.. ZERO_PAGE adds messes.
 c. Very big benefits for some (a few?) users but no benefits to usual programs.
 
 There are trade-off between b. and c.
 
Any comments are welcome.
-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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 34+ messages in thread
* Re: [RFC][PATCH 0/4] ZERO PAGE again v2
@ 2009-07-07 15:50 KAMEZAWA Hiroyuki
  0 siblings, 0 replies; 34+ messages in thread
From: KAMEZAWA Hiroyuki @ 2009-07-07 15:50 UTC (permalink / raw)
  To: Nick Piggin
  Cc: KAMEZAWA Hiroyuki, linux-mm@kvack.org, hugh.dickins@tiscali.co.uk,
	avi, akpm@linux-foundation.org, torvalds

Nick Piggin wrote:
> On Tue, Jul 07, 2009 at 06:06:29PM +0900, KAMEZAWA Hiroyuki wrote:
>> 3. Considering save&restore application's data table, ZERO_PAGE is
>> useful.
>>    maybe.
>
> I just wouldn't like to re-add significant complexity back to
> the vm without good and concrete examples. OK I agree that
> just saying "rewrite your code" is not so good, but are there
> real significant problems? Is it inside just a particuar linear
> algebra library or something  that might be able to be updated?
>
As far as I can tell

I know 2 cases from my limited experience for user support.

1. A middlware maps /dev/zero with PRIVATE mapping and use copy-on-write
   intentionally. I think this is because their Solaris? apps required
   /dev/zero to use ZERO_PAGE or anon.
   I don't know much about solaris but
   "mapping /dev/zero eats up tons of memory" sounds strange for me.

2. A HPC middleware seems to make use of ZERO_PAGE to do checkpoint/restart
   of his job. (Maybe they can rewrite programs as you say.)

Maybe there are others. (I'm not afraid of famous OSS applications/library.
There will be enough technical support for such apps.)

To be honest, I'd like to support /dev/zero, at least.
"mmap(/dev/zero, PROT_READ) caues OOM" sounds like a crazy behavior as OS.

Is it ok to write fault handler for /dev/zero and use zero page even if
this request is rejected ?

It was a choice to advertise "ZERO PAGE is not available any more, plz
check and rewrite you applications" to all my customers. But I'm being
pessimistic about this issue. (So, trying this patch)
Users will not understand what is the change and I'll see some of OOM
report caused by this change.

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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2009-07-13  7:03 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-07  7:51 [RFC][PATCH 0/4] ZERO PAGE again v2 KAMEZAWA Hiroyuki
2009-07-07  7:52 ` [RFC][PATCH 1/4] introduce pte_zero() KAMEZAWA Hiroyuki
2009-07-07  7:54 ` [RFC][PATCH 2/4] use ZERO_PAGE for READ fault in regular anonymous mapping KAMEZAWA Hiroyuki
2009-07-07  7:59 ` [RFC][PATCH 3/4] get_user_pages READ fault handling special cases KAMEZAWA Hiroyuki
2009-07-07 16:50   ` Linus Torvalds
2009-07-08  0:03     ` KAMEZAWA Hiroyuki
2009-07-08  1:38       ` KAMEZAWA Hiroyuki
2009-07-08  2:27         ` Linus Torvalds
2009-07-07  8:01 ` [RFC][PATCH 4/4] add get user pages nozero KAMEZAWA Hiroyuki
2009-07-07  8:47 ` [RFC][PATCH 0/4] ZERO PAGE again v2 Nick Piggin
2009-07-07  9:05   ` Avi Kivity
2009-07-07  9:18     ` KAMEZAWA Hiroyuki
2009-07-07  9:26       ` Avi Kivity
2009-07-07  9:06   ` KAMEZAWA Hiroyuki
2009-07-07 14:00     ` Nick Piggin
2009-07-07 16:59       ` Linus Torvalds
2009-07-08  6:21         ` Nick Piggin
2009-07-08 16:07           ` Linus Torvalds
2009-07-09  7:47             ` Nick Piggin
2009-07-09 17:54               ` Linus Torvalds
2009-07-10  2:09                 ` Nick Piggin
2009-07-10  3:38                   ` Linus Torvalds
2009-07-10  3:51                     ` Nick Piggin
2009-07-08 17:32     ` Andrea Arcangeli
2009-07-09  1:12       ` KAMEZAWA Hiroyuki
2009-07-10 11:18       ` Hugh Dickins
2009-07-10 13:42         ` Andrea Arcangeli
2009-07-10 14:12           ` KAMEZAWA Hiroyuki
2009-07-10 15:16             ` Andrea Arcangeli
2009-07-10 15:32               ` KAMEZAWA Hiroyuki
2009-07-10 17:09           ` Hugh Dickins
2009-07-13  6:46         ` Nick Piggin
2009-07-13  7:24           ` Nick Piggin
  -- strict thread matches above, loose matches on Subject: below --
2009-07-07 15:50 KAMEZAWA Hiroyuki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).