[lkml]   [2001]   [Jul]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe[2]: about kmap_high function

Tuesday, July 03, 2001, 5:38:09 PM, you wrote:

SCT> kmap_high is intended to be called routinely for access to highmem
SCT> pages. It is coded to be as fast as possible as a result. TLB
SCT> flushes are expensive, especially on SMP, so kmap_high tries hard to
SCT> avoid unnecessary flushes.

SCT> The way it does it is to do only a single, complete TLB flush of the
SCT> whole kmap VA range once every time the kmap address ring cycles.
SCT> That's what flush_all_zero_pkmaps() does --- it evicts old, unused
SCT> kmap mappings and flushes the whole TLB range, so that we are
SCT> guaranteed that there is a TLB flush between any two different uses of
SCT> any given kmap virtual address.

SCT> That way, we can avoid the cost of having to flush the TLB for every
SCT> single kmap mapping we create.

Thank you very much for your kindly guide, and I have two question to ask
you, One question is, Is kmap_high intended to be called merely in the user
context, so the highmem pages are mapped into user process page table, so
on SMP, other processes ( including kernel and user process) that running
on another cpu doesn't need to get that kmap virtual address.
Another question is, when kernel evicts old, unused kmap mapping and
flushes the whole TLB range( call the flush_all_zero_pkmaps), the TLB won't
keep those zero mappings, after that, when user process call kmap_high to
get a new kmap mappings, and when the process access that virtual
address, MMU component will get the page directory and page table from MEMORY
instead of TLB to translate the virtual address into physical address.

Best regards,
Michael Chen

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:17    [W:0.047 / U:1.744 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site