mlock.c (a8ca5d0ecbdde5cc3d7accacbd69968b0c98764e) mlock.c (de60f5f10c58d4f34b68622442c0e04180367f3f)
1/*
2 * linux/mm/mlock.c
3 *
4 * (C) Copyright 1995 Linus Torvalds
5 * (C) Copyright 2002 Christoph Hellwig
6 */
7
8#include <linux/capability.h>

--- 408 unchanged lines hidden (view full) ---

417 * We don't save and restore VM_LOCKED here because pages are
418 * still on lru. In unmap path, pages might be scanned by reclaim
419 * and re-mlocked by try_to_{munlock|unmap} before we unmap and
420 * free them. This will result in freeing mlocked pages.
421 */
422void munlock_vma_pages_range(struct vm_area_struct *vma,
423 unsigned long start, unsigned long end)
424{
1/*
2 * linux/mm/mlock.c
3 *
4 * (C) Copyright 1995 Linus Torvalds
5 * (C) Copyright 2002 Christoph Hellwig
6 */
7
8#include <linux/capability.h>

--- 408 unchanged lines hidden (view full) ---

417 * We don't save and restore VM_LOCKED here because pages are
418 * still on lru. In unmap path, pages might be scanned by reclaim
419 * and re-mlocked by try_to_{munlock|unmap} before we unmap and
420 * free them. This will result in freeing mlocked pages.
421 */
422void munlock_vma_pages_range(struct vm_area_struct *vma,
423 unsigned long start, unsigned long end)
424{
425 vma->vm_flags &= ~VM_LOCKED;
425 vma->vm_flags &= VM_LOCKED_CLEAR_MASK;
426
427 while (start < end) {
428 struct page *page = NULL;
429 unsigned int page_mask;
430 unsigned long page_increm;
431 struct pagevec pvec;
432 struct zone *zone;
433 int zoneid;

--- 337 unchanged lines hidden ---
426
427 while (start < end) {
428 struct page *page = NULL;
429 unsigned int page_mask;
430 unsigned long page_increm;
431 struct pagevec pvec;
432 struct zone *zone;
433 int zoneid;

--- 337 unchanged lines hidden ---