do_mmap: don't pre-populate the whole file when asked for smaller segment
The linker maps parts of libs with different access flags, so we cannot prepopulate the whole file. [dominique.martinet@cea.fr: moved min and friends in compiler.h] Change-Id: Ifbeddc0908699099cfae5ce9cc2adc578221db31
This commit is contained in:
committed by
Dominique Martinet
parent
641d9f1b39
commit
e828398c8b
@ -1925,13 +1925,12 @@ do_mmap(const uintptr_t addr0, const size_t len0, const int prot,
|
||||
}
|
||||
|
||||
/* Determine pre-populated size */
|
||||
populate_len = len;
|
||||
populate_len = memobj ? min(len, memobj->size) : len;
|
||||
|
||||
if (!(flags & MAP_ANONYMOUS)) {
|
||||
if (atomic_cmpxchg4(&memobj->status, MEMOBJ_TO_BE_PREFETCHED,
|
||||
MEMOBJ_READY)) {
|
||||
populated_mapping = 1;
|
||||
populate_len = memobj->size;
|
||||
}
|
||||
|
||||
/* Update PTEs for pre-mapped memory object */
|
||||
|
||||
Reference in New Issue
Block a user