linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: Jan Kara <jack@suse.cz>
Cc: Andrew Morton <akpm@linux-foundation.org>, linux-mm@kvack.org
Subject: Re: [PATCH] mm: Fix THP handling in invalidate_mapping_pages()
Date: Mon, 19 Jun 2017 16:25:10 +0300	[thread overview]
Message-ID: <20170619132510.4uzwyww43g5jt5si@node.shutemov.name> (raw)
In-Reply-To: <20170619124723.21656-1-jack@suse.cz>

On Mon, Jun 19, 2017 at 02:47:23PM +0200, Jan Kara wrote:
> The condition checking for THP straddling end of invalidated range is
> wrong - it checks 'index' against 'end' but 'index' has been already
> advanced to point to the end of THP and thus the condition can never be
> true. As a result THP straddling 'end' has been fully invalidated. Given
> the nature of invalidate_mapping_pages(), this could be only performance
> issue. In fact, we are lucky the condition is wrong because if it was
> ever true, we'd leave locked page behind.
> 
> Fix the condition checking for THP straddling 'end' and also properly
> unlock the page. Also update the comment before the condition to explain
> why we decide not to invalidate the page as it was not clear to me and I
> had to ask Kirill.
> 
> Signed-off-by: Jan Kara <jack@suse.cz>

Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>

Thanks a lot for the fix.

-- 
 Kirill A. Shutemov

--
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-06-19 13:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-19 12:47 Jan Kara
2017-06-19 13:25 ` Kirill A. Shutemov [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=20170619132510.4uzwyww43g5jt5si@node.shutemov.name \
    --to=kirill@shutemov.name \
    --cc=akpm@linux-foundation.org \
    --cc=jack@suse.cz \
    --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