From: "Martin J. Bligh" <Martin.Bligh@us.ibm.com>
To: Andrea Arcangeli <andrea@suse.de>,
Hugh Dickins <hugh@veritas.com>,
Rik van Riel <riel@conectiva.com.br>,
Dave McCracken <dmccr@us.ibm.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Creating a per-task kernel space for kmap, user pagetables, et al
Date: Wed, 20 Mar 2002 11:09:05 -0800 [thread overview]
Message-ID: <127930000.1016651345@flay> (raw)
Please forgive the following for deliberate simplifiations and accidental misunderstandings.
If you flame gently, *maybe* we can pull something useful out of the ashen remains ;-)
This is an evolution of my original plan to do per-cpu persisent kmap pools a
couple of months ago - thanks to Rik for pointing out this was not going to work.
OK, so currently we divide the virtual address space into user space (u-space) and kernel
space (k-space) at the PAGE_OFFSET boundary, with two fundamental differences that I'm
interested in for the sake of this argument.
1. u-space has different protections from k-space (ie user can't read/write it directly)
2. u-space is per task. k-space is common across all tasks.
Imagine we create a hybrid "u-k-space" with the protections of k-space, but the locality
of u-space .... either by making part of the current k-space per task or by making part of
the current u-space protected like k-space ... not sure which would be easier.
This u-k-space would be a good area for at least two things (and probably others):
1. A good place to put the process pagetables. We only use up the amount of virtual
address space (vaddr space) for one task's pagetables - if we map them into ZONE_NORMAL
(as current mainline) we use up vaddr space for *all* task's pagetables - if we map them
through kmap (atomic or persistent), we pay dearly in tlbflushes.
2. A good place to make a per-task kmap area. This would be on a pool system similar to
the current persistent kmap. We would potentially do only a local cpu tlb_flush_all when
this table ran out (though if we're clever, we can use the context switches tlb_flush to
do this for us). This would make copy_to_user stuff that's currently done under kmap
cheaper.
This, unfortunately, isn't a total solution - we may sometimes need to modify the task's
pagetables from outside the process context, eg. swapout (thanks to dmc for pointing
this out to me ;-)). For this, we'd just use the existing kmap mechanism to create another
mapping to use temporarily, and we're no worse off than before. But on the whole I think
it wins us enough to be worthwhile.
Opinions?
Martin.
next reply other threads:[~2002-03-20 19:10 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-03-20 19:09 Martin J. Bligh [this message]
2002-03-20 19:36 ` Creating a per-task kernel space for kmap, user pagetables, et al Rik van Riel
2002-03-20 20:26 ` Andrea Arcangeli
2002-03-20 19:45 ` Christoph Hellwig
2002-03-20 23:39 ` Alan Cox
2002-03-21 4:21 ` Itai Nahshon
2002-03-21 13:34 ` Alan Cox
2002-03-21 14:34 ` Martin J. Bligh
2002-03-21 15:38 ` Itai Nahshon
2002-03-20 19:56 ` Hugh Dickins
2002-03-20 20:23 ` Andrea Arcangeli
2002-03-20 20:35 ` Christoph Hellwig
2002-03-20 21:17 ` Hugh Dickins
2002-03-20 21:38 ` Andrea Arcangeli
2002-03-20 21:34 ` Andrea Arcangeli
2002-03-20 21:46 ` Christoph Hellwig
2002-03-20 22:00 ` Andrea Arcangeli
2002-03-21 19:54 ` Greg KH
2002-03-21 23:29 ` Andrea Arcangeli
2002-03-21 23:49 ` William Lee Irwin III
2002-03-22 1:20 ` Andrea Arcangeli
2002-03-20 22:10 ` Martin J. Bligh
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=127930000.1016651345@flay \
--to=martin.bligh@us.ibm.com \
--cc=andrea@suse.de \
--cc=dmccr@us.ibm.com \
--cc=hugh@veritas.com \
--cc=linux-kernel@vger.kernel.org \
--cc=riel@conectiva.com.br \
/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