Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 21529
b: refs/heads/master
c: 7a591cf
h: refs/heads/master
i:
  21527: 796d6e7
v: v3
  • Loading branch information
David S. Miller committed Mar 20, 2006
1 parent 999582e commit 76ddd7b
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 24 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2a3a5f5ddbefde498e87f10924d4bf741c5bf37f
refs/heads/master: 7a591cfe4efef8a232e4938d44ae6693b319f6d7
50 changes: 28 additions & 22 deletions trunk/arch/sparc64/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,9 @@ atomic_t dcpage_flushes_xcall = ATOMIC_INIT(0);
#endif
#endif

__inline__ void flush_dcache_page_impl(struct page *page)
inline void flush_dcache_page_impl(struct page *page)
{
BUG_ON(tlb_type == hypervisor);
#ifdef CONFIG_DEBUG_DCFLUSH
atomic_inc(&dcpage_flushes);
#endif
Expand Down Expand Up @@ -279,29 +280,31 @@ unsigned long _PAGE_SZBITS __read_mostly;
void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t pte)
{
struct mm_struct *mm;
struct page *page;
unsigned long pfn;
unsigned long pg_flags;

pfn = pte_pfn(pte);
if (pfn_valid(pfn) &&
(page = pfn_to_page(pfn), page_mapping(page)) &&
((pg_flags = page->flags) & (1UL << PG_dcache_dirty))) {
int cpu = ((pg_flags >> PG_dcache_cpu_shift) &
PG_dcache_cpu_mask);
int this_cpu = get_cpu();

/* This is just to optimize away some function calls
* in the SMP case.
*/
if (cpu == this_cpu)
flush_dcache_page_impl(page);
else
smp_flush_dcache_page_impl(page, cpu);

clear_dcache_dirty_cpu(page, cpu);
if (tlb_type != hypervisor) {
unsigned long pfn = pte_pfn(pte);
unsigned long pg_flags;
struct page *page;

if (pfn_valid(pfn) &&
(page = pfn_to_page(pfn), page_mapping(page)) &&
((pg_flags = page->flags) & (1UL << PG_dcache_dirty))) {
int cpu = ((pg_flags >> PG_dcache_cpu_shift) &
PG_dcache_cpu_mask);
int this_cpu = get_cpu();

/* This is just to optimize away some function calls
* in the SMP case.
*/
if (cpu == this_cpu)
flush_dcache_page_impl(page);
else
smp_flush_dcache_page_impl(page, cpu);

clear_dcache_dirty_cpu(page, cpu);

put_cpu();
put_cpu();
}
}

mm = vma->vm_mm;
Expand All @@ -321,6 +324,9 @@ void flush_dcache_page(struct page *page)
struct address_space *mapping;
int this_cpu;

if (tlb_type == hypervisor)
return;

/* Do not bother with the expensive D-cache flush if it
* is merely the zero page. The 'bigcore' testcase in GDB
* causes this case to run millions of times.
Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/sparc64/mm/tlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ void tlb_batch_add(struct mm_struct *mm, unsigned long vaddr, pte_t *ptep, pte_t
if (pte_exec(orig))
vaddr |= 0x1UL;

if (pte_dirty(orig)) {
if (tlb_type != hypervisor &&
pte_dirty(orig)) {
unsigned long paddr, pfn = pte_pfn(orig);
struct address_space *mapping;
struct page *page;
Expand Down

0 comments on commit 76ddd7b

Please sign in to comment.