9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] kernel - kmapinval?
@ 2004-11-27 20:23 Tim Newsham
  2004-11-28  1:10 ` Russ Cox
  0 siblings, 1 reply; 6+ messages in thread
From: Tim Newsham @ 2004-11-27 20:23 UTC (permalink / raw)
  To: 9fans

Hi,

  What is kmapinval() used for in the kernel?  It appears to be
called only in hzclock() and defined as a no-op in all architectures,
giving little clue as to what its function should be.

Tim N.


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

* Re: [9fans] kernel - kmapinval?
  2004-11-27 20:23 [9fans] kernel - kmapinval? Tim Newsham
@ 2004-11-28  1:10 ` Russ Cox
  2004-11-28 16:52   ` jmk
  0 siblings, 1 reply; 6+ messages in thread
From: Russ Cox @ 2004-11-28  1:10 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Kmapinval is used on non-x86 multiprocessor architectures,
like the unreleasable port to the SGI machines.  The big picture
is that kmap() maps some physical memory so that the kernel
can fiddle with it, kunmap() marks it as unmapped in the
kernel's own data structures, and kmapinval() actually flushes
the entries from the processor or from the software TLB so
that those virtual addresses can be reused for other mappings.
Running kmapinval() lazily at the clock interrupt instead of 
on demand avoids the complexities of interprocessor interrupts
and TLB shootdowns.

It is unfortunate that no released architecture source 
demonstrates this technique.  Should the PC kernels ever get
rewritten to handle larger memories, they'd be a good example.
The carrera sources in 3e have an mmu.c that is about the
same as what was used on the challenge and demonstrates 
the technique, even though the carrera was only ever a 
uniprocessor.

Russ



On Sat, 27 Nov 2004 10:23:09 -1000 (HST), Tim Newsham <newsham@lava.net> wrote:
> Hi,
> 
>   What is kmapinval() used for in the kernel?  It appears to be
> called only in hzclock() and defined as a no-op in all architectures,
> giving little clue as to what its function should be.
> 
> Tim N.
>


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

* Re: [9fans] kernel - kmapinval?
  2004-11-28  1:10 ` Russ Cox
@ 2004-11-28 16:52   ` jmk
  2004-11-28 17:30     ` William Josephson
  2004-11-29  4:58     ` Scott Schwartz
  0 siblings, 2 replies; 6+ messages in thread
From: jmk @ 2004-11-28 16:52 UTC (permalink / raw)
  To: russcox, 9fans

On Sat Nov 27 20:10:27 EST 2004, russcox@gmail.com wrote:
> ...
> It is unfortunate that no released architecture source 
> demonstrates this technique.  Should the PC kernels ever get
> rewritten to handle larger memories, they'd be a good example.
> ...

It's likely this will be done in the not too distant future.

On a related note, has anyone used the cpu performance counters
on the x86 with Plan 9?

--jim


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

* Re: [9fans] kernel - kmapinval?
  2004-11-28 16:52   ` jmk
@ 2004-11-28 17:30     ` William Josephson
  2004-11-29  4:58     ` Scott Schwartz
  1 sibling, 0 replies; 6+ messages in thread
From: William Josephson @ 2004-11-28 17:30 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Sun, Nov 28, 2004 at 11:52:27AM -0500, jmk@plan9.bell-labs.com wrote:
> On a related note, has anyone used the cpu performance counters
> on the x86 with Plan 9?

Only in the kernel.


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

* Re: [9fans] kernel - kmapinval?
  2004-11-28 16:52   ` jmk
  2004-11-28 17:30     ` William Josephson
@ 2004-11-29  4:58     ` Scott Schwartz
  2004-11-29 15:04       ` Ronald G. Minnich
  1 sibling, 1 reply; 6+ messages in thread
From: Scott Schwartz @ 2004-11-29  4:58 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

| On a related note, has anyone used the cpu performance counters
| on the x86 with Plan 9?
 
I have.  I posted patches a long time ago (3rd edition) to give them
#c files and to keep per-process statistics.



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

* Re: [9fans] kernel - kmapinval?
  2004-11-29  4:58     ` Scott Schwartz
@ 2004-11-29 15:04       ` Ronald G. Minnich
  0 siblings, 0 replies; 6+ messages in thread
From: Ronald G. Minnich @ 2004-11-29 15:04 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs



On Sun, 28 Nov 2004, Scott Schwartz wrote:

> I have.  I posted patches a long time ago (3rd edition) to give them
> #c files and to keep per-process statistics.


I'll take them if you have them, ... 

ron


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

end of thread, other threads:[~2004-11-29 15:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-27 20:23 [9fans] kernel - kmapinval? Tim Newsham
2004-11-28  1:10 ` Russ Cox
2004-11-28 16:52   ` jmk
2004-11-28 17:30     ` William Josephson
2004-11-29  4:58     ` Scott Schwartz
2004-11-29 15:04       ` Ronald G. Minnich

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).