mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chanho Min <chanho.min@lge.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	Hugh Dickins <hughd@google.com>, Michal Hocko <mhocko@suse.cz>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	HyoJun Im <hyojun.im@lge.com>, Gunho Lee <gunho.lee@lge.com>,
	Wonhong Kwon <wonhong.kwon@lge.com>,
	Chanho Min <chanho.min@lge.com>
Subject: [PATCH] mm: add parameter to disable faultaround
Date: Tue, 25 Nov 2014 15:51:58 +0900	[thread overview]
Message-ID: <1416898318-17409-1-git-send-email-chanho.min@lge.com> (raw)

The faultaround improves the file read performance, whereas pages which
can be dropped by drop_caches are reduced. On some systems, The amount of
freeable pages under memory pressure is more important than read
performance. So It prefers to be selectable.

This patch adds a new kernel cmdline parameter "nofaultaround"
for situations where users want to disable faultaround.

Signed-off-by: Chanho Min <chanho.min@lge.com>
---
 mm/memory.c |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/mm/memory.c b/mm/memory.c
index 4879b42..c36a96f 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -2888,6 +2888,14 @@ static int __init fault_around_debugfs(void)
 late_initcall(fault_around_debugfs);
 #endif
 
+static bool enable_fault_around = true;
+static int __init disable_fault_around(char *s)
+{
+	enable_fault_around = false;
+	return 1;
+}
+__setup("nofaultaround", disable_fault_around);
+
 /*
  * do_fault_around() tries to map few pages around the fault address. The hope
  * is that the pages will be needed soon and this will lower the number of
@@ -2965,7 +2973,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 && !(flags & FAULT_FLAG_NONLINEAR) &&
+	if (enable_fault_around && 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);
-- 
1.7.9.5


             reply	other threads:[~2014-11-25  6:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-25  6:51 Chanho Min [this message]
2014-11-25  7:05 ` Andrew Morton
     [not found]   ` <547465d2.6561420a.04ed.0514SMTPIN_ADDED_BROKEN@mx.google.com>
2014-11-25 11:40     ` Andrew Morton
     [not found]   ` <547465d2.0937460a.7739.fffff2baSMTPIN_ADDED_BROKEN@mx.google.com>
2014-11-25 11:48     ` Kirill A. Shutemov

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=1416898318-17409-1-git-send-email-chanho.min@lge.com \
    --to=chanho.min@lge.com \
    --cc=akpm@linux-foundation.org \
    --cc=gunho.lee@lge.com \
    --cc=hughd@google.com \
    --cc=hyojun.im@lge.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.cz \
    --cc=wonhong.kwon@lge.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®