Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARC: [mm] Assume pagecache page dirty by default

Similar to ARM/SH

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>

+14 -7
+7
arch/arc/include/asm/cacheflush.h
··· 81 81 #endif /* CONFIG_ARC_CACHE_VIPT_ALIASING */ 82 82 83 83 /* 84 + * A new pagecache page has PG_arch_1 clear - thus dcache dirty by default 85 + * This works around some PIO based drivers which don't call flush_dcache_page 86 + * to record that they dirtied the dcache 87 + */ 88 + #define PG_dc_clean PG_arch_1 89 + 90 + /* 84 91 * Simple wrapper over config option 85 92 * Bootup code ensures that hardware matches kernel configuration 86 93 */
+6 -6
arch/arc/mm/cache_arc700.c
··· 512 512 struct address_space *mapping; 513 513 514 514 if (!cache_is_vipt_aliasing()) { 515 - set_bit(PG_arch_1, &page->flags); 515 + clear_bit(PG_dc_clean, &page->flags); 516 516 return; 517 517 } 518 518 ··· 526 526 * Make a note that K-mapping is dirty 527 527 */ 528 528 if (!mapping_mapped(mapping)) { 529 - set_bit(PG_arch_1, &page->flags); 529 + clear_bit(PG_dc_clean, &page->flags); 530 530 } else if (page_mapped(page)) { 531 531 532 532 /* kernel reading from page with U-mapping */ ··· 734 734 * non copied user pages (e.g. read faults which wire in pagecache page 735 735 * directly). 736 736 */ 737 - set_bit(PG_arch_1, &to->flags); 737 + clear_bit(PG_dc_clean, &to->flags); 738 738 739 739 /* 740 740 * if SRC was already usermapped and non-congruent to kernel mapping ··· 742 742 */ 743 743 if (clean_src_k_mappings) { 744 744 __flush_dcache_page(kfrom, kfrom); 745 - clear_bit(PG_arch_1, &from->flags); 745 + set_bit(PG_dc_clean, &from->flags); 746 746 } else { 747 - set_bit(PG_arch_1, &from->flags); 747 + clear_bit(PG_dc_clean, &from->flags); 748 748 } 749 749 } 750 750 751 751 void clear_user_page(void *to, unsigned long u_vaddr, struct page *page) 752 752 { 753 753 clear_page(to); 754 - set_bit(PG_arch_1, &page->flags); 754 + clear_bit(PG_dc_clean, &page->flags); 755 755 } 756 756 757 757
+1 -1
arch/arc/mm/tlb.c
··· 453 453 if ((vma->vm_flags & VM_EXEC) || 454 454 addr_not_cache_congruent(paddr, vaddr)) { 455 455 456 - int dirty = test_and_clear_bit(PG_arch_1, &page->flags); 456 + int dirty = !test_and_set_bit(PG_dc_clean, &page->flags); 457 457 if (dirty) { 458 458 /* wback + inv dcache lines */ 459 459 __flush_dcache_page(paddr, paddr);