linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Mel Gorman <mgorman@suse.de>, Rik van Riel <riel@redhat.com>,
	Andi Kleen <ak@linux.intel.com>,
	Matthew Wilcox <matthew.r.wilcox@intel.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	linux-mm <linux-mm@kvack.org>
Subject: Re: [RFC, PATCH 0/2] mm: map few pages around fault address if they are in page cache
Date: Wed, 12 Feb 2014 02:44:55 +0200 (EET)	[thread overview]
Message-ID: <20140212004455.DB848E0090@blue.fi.intel.com> (raw)
In-Reply-To: <CA+55aFyNmux-1dT0ADr24mVwCVRxL2CNXo9HLTgTh3dLD_pAcg@mail.gmail.com>

Linus Torvalds wrote:
> On Tue, Feb 11, 2014 at 3:58 PM, Kirill A. Shutemov
> <kirill.shutemov@linux.intel.com> wrote:
> > Linus Torvalds wrote:
> >
> > It's on top of v3.14-rc1 + __do_fault() claen up[1].
> >
> > It's also on git:
> >
> > git://git.kernel.org/pub/scm/linux/kernel/git/kas/linux fault_around/v1
> >
> > [1] http://thread.gmane.org/gmane.linux.kernel.mm/113364
> 
> Ok, that patch-series looks good to me too.
> 
> And I still see nothing wrong that would cause it not to boot.

It actually boot to UI and kinda work until I try to rebuild kernel.
Then all IO stops, but my window manager is still work. I can switch
between windows :-/

> I think the "do_async_mmap_readahead()" in lock_secondary_pages() is silly
> and shouldn't really be done, but I don't think it should cause any problems
> per se, it just feels very wrong to do that inside the loop.

I tried to replace do_async_mmap_readahead() locally with this:

diff --git a/mm/filemap.c b/mm/filemap.c
index 0661358db958..b28d19cafefc 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -1612,8 +1612,8 @@ static struct page *lock_secondary_pages(struct vm_area_struct *vma,
 		}
 		if (pages[i]->index > vmf->max)
 			goto put;
-		do_async_mmap_readahead(vma, &file->f_ra, file,
-				pages[i], pages[i]->index);
+		if (PageReadahead(pages[i]))
+			goto put;
 		if (!trylock_page(pages[i]))
 			goto put;
 		/* Truncated? */
@@ -1625,6 +1625,8 @@ static struct page *lock_secondary_pages(struct vm_area_struct *vma,
 			>> PAGE_CACHE_SHIFT;
 		if (unlikely(pages[i]->index >= size))
 			goto unlock;
+		if (file->f_ra.mmap_miss > 0)
+			file->f_ra.mmap_miss--;
 		continue;
 unlock:
 		unlock_page(pages[i]);
-- 
 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:[~2014-02-12  0:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-11  3:05 [RFC, PATCH 0/2] mm: map few pages around fault address if they are in page cache Kirill A. Shutemov
2014-02-11  3:05 ` [PATCH 1/2] mm: extend ->fault interface to fault in few pages around fault address Kirill A. Shutemov
2014-02-11  3:05 ` [PATCH 2/2] mm: implement FAULT_FLAG_AROUND in filemap_fault() Kirill A. Shutemov
2014-02-11 21:39 ` [RFC, PATCH 0/2] mm: map few pages around fault address if they are in page cache Andrew Morton
2014-02-11 23:52   ` Linus Torvalds
2014-02-11 23:58     ` Kirill A. Shutemov
2014-02-12  0:25       ` Linus Torvalds
2014-02-12  0:44         ` 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=20140212004455.DB848E0090@blue.fi.intel.com \
    --to=kirill.shutemov@linux.intel.com \
    --cc=ak@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=dave.hansen@linux.intel.com \
    --cc=linux-mm@kvack.org \
    --cc=matthew.r.wilcox@intel.com \
    --cc=mgorman@suse.de \
    --cc=riel@redhat.com \
    --cc=torvalds@linux-foundation.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).