Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 178833
b: refs/heads/master
c: cfe79c0
h: refs/heads/master
i:
  178831: 161b238
v: v3
  • Loading branch information
Mike Frysinger authored and Linus Torvalds committed Jan 7, 2010
1 parent 1d7fb51 commit 1c2abc8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 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: 04e4f2b18c8de1389d1e00fef0f42a8099910daf
refs/heads/master: cfe79c00a2f4f687eed8b7534d1d3d3d35540c29
2 changes: 2 additions & 0 deletions trunk/include/linux/mm_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ struct vm_region {
struct file *vm_file; /* the backing file or NULL */

atomic_t vm_usage; /* region usage count */
bool vm_icache_flushed : 1; /* true if the icache has been flushed for
* this region */
};

/*
Expand Down
11 changes: 8 additions & 3 deletions trunk/mm/nommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ SYSCALL_DEFINE1(brk, unsigned long, brk)
/*
* Ok, looks good - let it rip.
*/
flush_icache_range(mm->brk, brk);
return mm->brk = brk;
}

Expand Down Expand Up @@ -1353,10 +1354,14 @@ unsigned long do_mmap_pgoff(struct file *file,
share:
add_vma_to_mm(current->mm, vma);

up_write(&nommu_region_sem);
/* we flush the region from the icache only when the first executable
* mapping of it is made */
if (vma->vm_flags & VM_EXEC && !region->vm_icache_flushed) {
flush_icache_range(region->vm_start, region->vm_end);
region->vm_icache_flushed = true;
}

if (prot & PROT_EXEC)
flush_icache_range(result, result + len);
up_write(&nommu_region_sem);

kleave(" = %lx", result);
return result;
Expand Down

0 comments on commit 1c2abc8

Please sign in to comment.