All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konstantin Khlebnikov <k.khlebnikov@samsung.com>
To: linux-mm@kvack.org, Hugh Dickins <hughd@google.com>,
	linux-kernel@vger.kernel.org,
	Sasha Levin <sasha.levin@oracle.com>
Cc: Ingo Korb <ingo.korb@tu-dortmund.de>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	Dave Jones <davej@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Ning Qu <quning@google.com>,
	Konstantin Khlebnikov <koct9i@gmail.com>
Subject: [PATCH] mm: do not call do_fault_around for non-linear fault
Date: Tue, 15 Jul 2014 15:58:32 +0400	[thread overview]
Message-ID: <20140715115832.18997.90349.stgit@buzz> (raw)
In-Reply-To: <CALYGNiM9Fu9-i7hXMQNTUP69RfydN+2NqO29wZYd+4Gn25GbCQ@mail.gmail.com>

From: Konstantin Khlebnikov <koct9i@gmail.com>

Faulting around non-linear page-fault has no sense and
breaks logic in do_fault_around because pgoff is shifted.

Signed-off-by: Konstantin Khlebnikov <koct9i@gmail.com>
Reported-by: "Ingo Korb" <ingo.korb@tu-dortmund.de>
---
 mm/memory.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mm/memory.c b/mm/memory.c
index d67fd9f..7e8d820 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -2882,7 +2882,8 @@ static int do_read_fault(struct mm_struct *mm, struct vm_area_struct *vma,
 	 * if page by the offset is not ready to be mapped (cold cache or
 	 * something).
 	 */
-	if (vma->vm_ops->map_pages && fault_around_pages() > 1) {
+	if (vma->vm_ops->map_pages && !(flags & FAULT_FLAG_NONLINEAR) &&
+	    fault_around_pages() > 1) {
 		pte = pte_offset_map_lock(mm, pmd, address, &ptl);
 		do_fault_around(vma, address, pte, pgoff, flags);
 		if (!pte_same(*pte, orig_pte))

--
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>

WARNING: multiple messages have this Message-ID (diff)
From: Konstantin Khlebnikov <k.khlebnikov@samsung.com>
To: linux-mm@kvack.org, Hugh Dickins <hughd@google.com>,
	linux-kernel@vger.kernel.org,
	Sasha Levin <sasha.levin@oracle.com>
Cc: Ingo Korb <ingo.korb@tu-dortmund.de>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	Dave Jones <davej@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Ning Qu <quning@google.com>,
	Konstantin Khlebnikov <koct9i@gmail.com>
Subject: [PATCH] mm: do not call do_fault_around for non-linear fault
Date: Tue, 15 Jul 2014 15:58:32 +0400	[thread overview]
Message-ID: <20140715115832.18997.90349.stgit@buzz> (raw)
In-Reply-To: <CALYGNiM9Fu9-i7hXMQNTUP69RfydN+2NqO29wZYd+4Gn25GbCQ@mail.gmail.com>

From: Konstantin Khlebnikov <koct9i@gmail.com>

Faulting around non-linear page-fault has no sense and
breaks logic in do_fault_around because pgoff is shifted.

Signed-off-by: Konstantin Khlebnikov <koct9i@gmail.com>
Reported-by: "Ingo Korb" <ingo.korb@tu-dortmund.de>
---
 mm/memory.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mm/memory.c b/mm/memory.c
index d67fd9f..7e8d820 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -2882,7 +2882,8 @@ static int do_read_fault(struct mm_struct *mm, struct vm_area_struct *vma,
 	 * if page by the offset is not ready to be mapped (cold cache or
 	 * something).
 	 */
-	if (vma->vm_ops->map_pages && fault_around_pages() > 1) {
+	if (vma->vm_ops->map_pages && !(flags & FAULT_FLAG_NONLINEAR) &&
+	    fault_around_pages() > 1) {
 		pte = pte_offset_map_lock(mm, pmd, address, &ptl);
 		do_fault_around(vma, address, pte, pgoff, flags);
 		if (!pte_same(*pte, orig_pte))


  parent reply	other threads:[~2014-07-15 11:58 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-14 12:58 PROBLEM: repeated remap_file_pages on tmpfs triggers bug on process exit Ingo Korb
2014-07-14 19:22 ` Hugh Dickins
2014-07-14 19:22   ` Hugh Dickins
2014-07-14 20:13   ` Konstantin Khlebnikov
2014-07-14 20:13     ` Konstantin Khlebnikov
2014-07-15  9:55     ` [PATCH] mm: fix faulting range in do_fault_around Konstantin Khlebnikov
2014-07-15  9:55       ` Konstantin Khlebnikov
2014-07-15 10:55     ` PROBLEM: repeated remap_file_pages on tmpfs triggers bug on process exit Kirill A. Shutemov
2014-07-15 10:55       ` Kirill A. Shutemov
2014-07-15 11:33       ` Konstantin Khlebnikov
2014-07-15 11:33         ` Konstantin Khlebnikov
2014-07-15 11:54         ` Kirill A. Shutemov
2014-07-15 11:54           ` Kirill A. Shutemov
2014-07-15 20:46           ` Hugh Dickins
2014-07-15 20:46             ` Hugh Dickins
2014-07-15 11:58     ` Konstantin Khlebnikov [this message]
2014-07-15 11:58       ` [PATCH] mm: do not call do_fault_around for non-linear fault Konstantin Khlebnikov
2014-07-15 15:29       ` Ingo Korb
2014-07-15 15:29         ` Ingo Korb
2014-07-15 20:42       ` Andrew Morton
2014-07-15 20:42         ` Andrew Morton
2014-07-15 21:07         ` Konstantin Khlebnikov
2014-07-15 21:07           ` Konstantin Khlebnikov

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=20140715115832.18997.90349.stgit@buzz \
    --to=k.khlebnikov@samsung.com \
    --cc=akpm@linux-foundation.org \
    --cc=davej@redhat.com \
    --cc=hughd@google.com \
    --cc=ingo.korb@tu-dortmund.de \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=koct9i@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=quning@google.com \
    --cc=sasha.levin@oracle.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.