From: Rik van Riel <riel@redhat.com>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: Andi Kleen <andi@firstfloor.org>,
Andrew Morton <akpm@linux-foundation.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Hugh Dickins <hugh.dickins@tiscali.co.uk>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [patch][v2] swap: virtual swap readahead
Date: Wed, 03 Jun 2009 10:51:36 -0400 [thread overview]
Message-ID: <4A268DF8.6000701@redhat.com> (raw)
In-Reply-To: <20090603132751.GA1813@cmpxchg.org>
Johannes Weiner wrote:
> On Wed, Jun 03, 2009 at 01:34:57AM +0200, Andi Kleen wrote:
>> On Wed, Jun 03, 2009 at 12:37:39AM +0200, Johannes Weiner wrote:
>>> + pgd = pgd_offset(vma->vm_mm, pos);
>>> + if (!pgd_present(*pgd))
>>> + continue;
>>> + pud = pud_offset(pgd, pos);
>>> + if (!pud_present(*pud))
>>> + continue;
>>> + pmd = pmd_offset(pud, pos);
>>> + if (!pmd_present(*pmd))
>>> + continue;
>>> + pte = pte_offset_map_lock(vma->vm_mm, pmd, pos, &ptl);
>> You could be more efficient here by using the standard mm/* nested loop
>> pattern that avoids relookup of everything in each iteration. I suppose
>> it would mainly make a difference with 32bit highpte where mapping a pte
>> can be somewhat costly. And you would take less locks this way.
>
> I ran into weird problems here. The above version is actually faster
> in the benchmarks than writing a nested level walker or using
> walk_page_range(). Still digging but it can take some time. Busy
> week :(
I'm not too worried about not walking the page tables,
because swap is an extreme slow path anyway.
--
All rights reversed.
--
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>
next prev parent reply other threads:[~2009-06-03 14:53 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-02 22:37 Johannes Weiner
2009-06-02 23:34 ` Andi Kleen
2009-06-03 13:27 ` Johannes Weiner
2009-06-03 14:51 ` Rik van Riel [this message]
2009-06-03 15:02 ` Andi Kleen
2009-06-05 11:03 ` Minchan Kim
2009-06-04 1:46 ` KAMEZAWA Hiroyuki
2009-06-04 10:04 ` Johannes Weiner
2009-06-07 17:55 ` Hugh Dickins
2009-06-08 15:21 ` Johannes Weiner
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=4A268DF8.6000701@redhat.com \
--to=riel@redhat.com \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=andi@firstfloor.org \
--cc=hannes@cmpxchg.org \
--cc=hugh.dickins@tiscali.co.uk \
--cc=linux-kernel@vger.kernel.org \
--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