linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: Anshuman Khandual <khandual@linux.vnet.ibm.com>, linux-mm@kvack.org
Cc: akpm@linux-foundation.org
Subject: Re: [PATCH] mm/mempolicy: Remove BUG_ON() checks for VMA inside mpol_misplaced()
Date: Fri, 1 Sep 2017 15:16:12 +0200	[thread overview]
Message-ID: <8896e04b-9db2-53cd-cdb8-58105a94f84a@suse.cz> (raw)
In-Reply-To: <20170901130137.7617-1-khandual@linux.vnet.ibm.com>

On 09/01/2017 03:01 PM, Anshuman Khandual wrote:
> VMA and its address bounds checks are too late in this function.
> They must have been verified earlier in the page fault sequence.
> Hence just remove them.
> 
> Suggested-by: Vlastimil Babka <vbabka@suse.cz>
> Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>

Acked-by: Vlastimil Babka <vbabka@suse.cz>

> ---
>  mm/mempolicy.c | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/mm/mempolicy.c b/mm/mempolicy.c
> index 618ab12..3509b84 100644
> --- a/mm/mempolicy.c
> +++ b/mm/mempolicy.c
> @@ -2172,17 +2172,12 @@ int mpol_misplaced(struct page *page, struct vm_area_struct *vma, unsigned long
>  	int polnid = -1;
>  	int ret = -1;
>  
> -	BUG_ON(!vma);
> -
>  	pol = get_vma_policy(vma, addr);
>  	if (!(pol->flags & MPOL_F_MOF))
>  		goto out;
>  
>  	switch (pol->mode) {
>  	case MPOL_INTERLEAVE:
> -		BUG_ON(addr >= vma->vm_end);
> -		BUG_ON(addr < vma->vm_start);
> -
>  		pgoff = vma->vm_pgoff;
>  		pgoff += (addr - vma->vm_start) >> PAGE_SHIFT;
>  		polnid = offset_il_node(pol, vma, pgoff);
> 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2017-09-01 13:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-01  7:02 [PATCH] mm/mempolicy: Move VMA address bound checks inside mpol_misplaced() Anshuman Khandual
2017-09-01  9:05 ` Vlastimil Babka
2017-09-01 12:17   ` Anshuman Khandual
2017-09-01 12:21     ` Anshuman Khandual
2017-09-01 13:01       ` [PATCH] mm/mempolicy: Remove BUG_ON() checks for VMA " Anshuman Khandual
2017-09-01 13:16         ` Vlastimil Babka [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8896e04b-9db2-53cd-cdb8-58105a94f84a@suse.cz \
    --to=vbabka@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=khandual@linux.vnet.ibm.com \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).