public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Creating a per-task kernel space for kmap, user pagetables, et al
@ 2002-03-20 19:09 Martin J. Bligh
  2002-03-20 19:36 ` Rik van Riel
                   ` (3 more replies)
  0 siblings, 4 replies; 22+ messages in thread
From: Martin J. Bligh @ 2002-03-20 19:09 UTC (permalink / raw)
  To: Andrea Arcangeli, Hugh Dickins, Rik van Riel, Dave McCracken; +Cc: linux-kernel

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.




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

end of thread, other threads:[~2002-03-22  1:22 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-03-20 19:09 Creating a per-task kernel space for kmap, user pagetables, et al Martin J. Bligh
2002-03-20 19:36 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox