From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Date: Sat, 27 Nov 2004 20:10:08 -0500 From: Russ Cox To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Subject: Re: [9fans] kernel - kmapinval? In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: Topicbox-Message-UUID: 0d3f87f0-eace-11e9-9e20-41e7f4b1d025 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 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. >