sh: Lazy dcache writeback optimizations.
This converts the lazy dcache handling to the model described in Documentation/cachetlb.txt and drops the ptep_get_and_clear() hacks used for the aliasing dcaches on SH-4 and SH7705 in 32kB mode. As a bonus, this slightly cuts down on the cache flushing frequency. With that and the PTEA handling out of the way, the update_mmu_cache() implementations can be consolidated, and we no longer have to worry about which configuration the cache is in for the SH7705 case. And finally, explicitly disable the lazy writeback on SMP (SH-4A). Signed-off-by: Paul Mundt <lethal@linux-sh.org>
这个提交包含在:
@@ -23,7 +23,6 @@ extern struct mutex p3map_mutex[];
|
||||
*/
|
||||
void clear_user_page(void *to, unsigned long address, struct page *page)
|
||||
{
|
||||
__set_bit(PG_mapped, &page->flags);
|
||||
if (((address ^ (unsigned long)to) & CACHE_ALIAS) == 0)
|
||||
clear_page(to);
|
||||
else {
|
||||
@@ -59,7 +58,6 @@ void clear_user_page(void *to, unsigned long address, struct page *page)
|
||||
void copy_user_page(void *to, void *from, unsigned long address,
|
||||
struct page *page)
|
||||
{
|
||||
__set_bit(PG_mapped, &page->flags);
|
||||
if (((address ^ (unsigned long)to) & CACHE_ALIAS) == 0)
|
||||
copy_page(to, from);
|
||||
else {
|
||||
@@ -84,23 +82,3 @@ void copy_user_page(void *to, void *from, unsigned long address,
|
||||
mutex_unlock(&p3map_mutex[(address & CACHE_ALIAS)>>12]);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* For SH-4, we have our own implementation for ptep_get_and_clear
|
||||
*/
|
||||
inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
|
||||
{
|
||||
pte_t pte = *ptep;
|
||||
|
||||
pte_clear(mm, addr, ptep);
|
||||
if (!pte_not_present(pte)) {
|
||||
unsigned long pfn = pte_pfn(pte);
|
||||
if (pfn_valid(pfn)) {
|
||||
struct page *page = pfn_to_page(pfn);
|
||||
struct address_space *mapping = page_mapping(page);
|
||||
if (!mapping || !mapping_writably_mapped(mapping))
|
||||
__clear_bit(PG_mapped, &page->flags);
|
||||
}
|
||||
}
|
||||
return pte;
|
||||
}
|
||||
|
在新工单中引用
屏蔽一个用户