mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "yunfeng zhang" <zyf.zeroos@gmail.com>
To: "David Lang" <dlang@digitalinsight.com>
Cc: linux-kernel@vger.kernel.org, valdis.kletnieks@vt.edu,
	penberg@cs.helsinki.fi
Subject: Re: Improvement on memory subsystem
Date: Tue, 25 Jul 2006 16:33:42 +0800	[thread overview]
Message-ID: <4df04b840607250133h750d7ef6ifa864bc5c5670dcf@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.63.0607240752050.8221@qynat.qvtvafvgr.pbz>

No COW in Private VMA
In current Linux 2.6.16, Linux applies copy-on-write technical when application
issues CLONE_MM parameter to do_fork, as the result, it makes private VMA of a
process share its private pages with other process. It increases memory
subsystem complexity.

In fact, OS should be application-oriented, not standard-oriented. In most
cases, supporting POSIX thread model, vfork and evecve is enough to application.
In other words, we should focus on optimizing our system for the frequent cases,
that is, do copy-on-call when someone really calls fork with CLONE_MM.

No COW in private VMA makes a simple one-to-one relationship among its pte, its
private page and its swap_entry of a private VMA, we will benefit from the model

A new PTE type is introduced here before we go
	struct UnmappedPTE {
		present : 1; // = 0.
		...;
		pageNum : 20;
	};

1) To swap daemon, we can give a fairer opportunity to every private page. As
I've suggested swap daemon should swap out pages based on VMA instead of memory
page array. So we do the steps listed below to every pte of a private VMA
	a) Convert the pte to UnmappedPTE type, that doesn't free the private page
	at all, UnmappedPTE::pageNum holds a trace of its private page.
	b) Allocate a swap entry for the private page of the pte and page-out it,
	remember do the job on current pte and its following ptes together, I've
	explained the virtue.
	c) OK, it's still untouched, reclaim the private page, convert the pte to
	SwappedPTE type.
The flow is better than the implementation of current Linux, I think.
2) We can economize a litter memory. Current swap space includes two parts, one
is swap_info_struct, its responsibility is tracing physical swap area by short
swap_info_struct::swap_map array. Now, it should be a bit array; Another is an
address_space structure, which is used by process to test whether its swap pages
have been read in memory. Now, it should be discarded, every swap page once is
read in, it's linked with its pte by UnmappedPTE.

Note, No COW in PrivateVMA is a bigger improvement.

  reply	other threads:[~2006-07-25  8:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-18 10:03 yunfeng zhang
2006-07-18 12:18 ` Valdis.Kletnieks
2006-07-19  3:44   ` yunfeng zhang
2006-07-19  9:18   ` Ian Stirling
2006-07-19 14:56     ` Valdis.Kletnieks
2006-07-18 16:25 ` Pekka Enberg
2006-07-19  3:21   ` yunfeng zhang
2006-07-19  8:30     ` Pekka Enberg
2006-07-19 10:13       ` yunfeng zhang
2006-07-19 10:35         ` Pekka Enberg
2006-07-24  9:01 ` yunfeng zhang
2006-07-24 14:55   ` David Lang
2006-07-25  8:33     ` yunfeng zhang [this message]
2006-08-23 10:39 ` yunfeng zhang

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=4df04b840607250133h750d7ef6ifa864bc5c5670dcf@mail.gmail.com \
    --to=zyf.zeroos@gmail.com \
    --cc=dlang@digitalinsight.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=penberg@cs.helsinki.fi \
    --cc=valdis.kletnieks@vt.edu \
    /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

all inboxes | Powered by JetHome®