diff options
author | Yangtao Li <[email protected]> | 2018-12-28 00:34:09 -0800 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2018-12-28 12:11:47 -0800 |
commit | 9cabf929e7d92139a7d1ef3e517ad57dfece4739 (patch) | |
tree | 3a5404254a15517f3907c4222698ec662ef75e62 | |
parent | 59e1a2f4bf83744e748636415fde7d1e9f557e05 (diff) |
mm/mmap.c: remove verify_mm_writelocked()
We should get rid of this function. It no longer serves its purpose.
This is a historical artifact from 2005 where do_brk was called outside of
the core mm. We do have a proper abstraction in vm_brk_flags and that one
does the locking properly so there is no need to use this function.
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Yangtao Li <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Acked-by: David Rientjes <[email protected]>
Cc: Dan Williams <[email protected]>
Cc: Dominik Brodowski <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: David Woodhouse <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r-- | mm/mmap.c | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/mm/mmap.c b/mm/mmap.c index 7bb64381e77c..f901065c4c64 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -2973,16 +2973,6 @@ out: return ret; } -static inline void verify_mm_writelocked(struct mm_struct *mm) -{ -#ifdef CONFIG_DEBUG_VM - if (unlikely(down_read_trylock(&mm->mmap_sem))) { - WARN_ON(1); - up_read(&mm->mmap_sem); - } -#endif -} - /* * this is really a simplified "do_mmap". it only handles * anonymous maps. eventually we may be able to do some @@ -3010,12 +3000,6 @@ static int do_brk_flags(unsigned long addr, unsigned long len, unsigned long fla return error; /* - * mm->mmap_sem is required to protect against another thread - * changing the mappings in case we sleep. - */ - verify_mm_writelocked(mm); - - /* * Clear old maps. this also does some error checking for us */ while (find_vma_links(mm, addr, addr + len, &prev, &rb_link, |