lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 3 Mar 2022 13:35:56 -0800
From:   Nadav Amit <nadav.amit@...il.com>
To:     Johannes Weiner <hannes@...xchg.org>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Michal Hocko <mhocko@...e.com>,
        Vlastimil Babka <vbabka@...e.cz>,
        Linux-MM <linux-mm@...ck.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm: madvise: MADV_DONTNEED_LOCKED



> On Mar 3, 2022, at 1:29 PM, Johannes Weiner <hannes@...xchg.org> wrote:
> 
> MADV_DONTNEED historically rejects mlocked ranges, but with
> MLOCK_ONFAULT and MCL_ONFAULT allowing to mlock without populating,
> there are valid use cases for depopulating locked ranges as well.

...

> @@ -850,7 +858,7 @@ static long madvise_dontneed_free(struct vm_area_struct *vma,
> 		VM_WARN_ON(start >= end);
> 	}
> 
> -	if (behavior == MADV_DONTNEED)
> +	if (behavior == MADV_DONTNEED || behavior == MADV_DONTNEED_LOCKED)
> 		return madvise_dontneed_single_vma(vma, start, end);
> 	else if (behavior == MADV_FREE)
> 		return madvise_free_single_vma(vma, start, end);
> @@ -988,6 +996,7 @@ static int madvise_vma_behavior(struct vm_area_struct *vma,
> 		return madvise_pageout(vma, prev, start, end);
> 	case MADV_FREE:
> 	case MADV_DONTNEED:
> +	case MADV_DONTNEED_LOCKED:
> 		return madvise_dontneed_free(vma, prev, start, end, behavior);
> 	case MADV_POPULATE_READ:
> 	case MADV_POPULATE_WRITE:
> @@ -1113,6 +1122,7 @@ madvise_behavior_valid(int behavior)
> 	case MADV_REMOVE:
> 	case MADV_WILLNEED:
> 	case MADV_DONTNEED:
> +	case MADV_DONTNEED_LOCKED:
> 	case MADV_FREE:
> 	case MADV_COLD:
> 	case MADV_PAGEOUT:

Don’t you want to change madvise_need_mmap_write() as well and add
MADV_DONTNEED_LOCKED there too?

Powered by blists - more mailing lists