From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
To: Michel Lespinasse <walken@google.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Dave Hansen <dave@linux.vnet.ibm.com>,
Rik van Riel <riel@redhat.com>,
Balbir Singh <bsingharora@gmail.com>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Andrea Arcangeli <aarcange@redhat.com>,
Johannes Weiner <jweiner@redhat.com>,
KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
Hugh Dickins <hughd@google.com>, Michael Wolf <mjwolf@us.ibm.com>
Subject: Re: [PATCH 6/9] kstaled: rate limit pages scanned per second.
Date: Fri, 14 Oct 2011 13:54:04 +0900 [thread overview]
Message-ID: <20111014135404.b56bed48.kamezawa.hiroyu@jp.fujitsu.com> (raw)
In-Reply-To: <CANN689HOALiiBKLUHRFuONQEyqp2on0GA1ycEguf0S6WFeuP7w@mail.gmail.com>
On Thu, 13 Oct 2011 18:25:06 -0700
Michel Lespinasse <walken@google.com> wrote:
> On Wed, Sep 28, 2011 at 1:59 AM, KAMEZAWA Hiroyuki
> <kamezawa.hiroyu@jp.fujitsu.com> wrote:
> > On Wed, 28 Sep 2011 01:19:50 -0700
> > Michel Lespinasse <walken@google.com> wrote:
> >> It tends to perform worse if we try making it multithreaded. What
> >> happens is that the scanning threads call page_referenced() a lot, and
> >> if they both try scanning pages that belong to the same file that
> >> causes the mapping's i_mmap_mutex lock to bounce. Same things happens
> >> if they try scanning pages that belong to the same anon VMA too.
> >>
> >
> > Hmm. with brief thinking, if you can scan list of page tables,
> > you can set young flags without any locks.
> > For inode pages, you can hook page lookup, I think.
>
> It would be possible to avoid taking rmap locks by instead scanning
> all page tables, and transferring the pte young bits observed there to
> the PageYoung page flag. This is a significant design change, but
> would indeed work.
>
> Just to clarify the idea, how would you go about finding all page
> tables to scan ? The most straightforward approach would be iterate
> over all processes and scan their address spaces, but I don't think we
> can afford to hold tasklist_lock (even for reads) for so long, so we'd
> have to be a bit smarter than that... I can think of a few different
> ways but I'd like to know if you have something specific in mind
> first.
Maybe there are several idea.
1. how about chasing "pgd" kmem_cache ?
I'm not sure but in x86 it seems all pgds are lined to pgd_list.
Now, it's not RCU list but making it as RCU list isn't hard.
Note: IIUC, struct page for pgd contains pointer to mm_struct.
2. track dup_mm and do_exec.
insert hook and maintain list of mm_struct.(It's not needed to be
implemented as list)
3. Like pgd_list, add some flag to pgd pages. Then, you can scan memmap
and find 'pgd' page and walk into the page table tree.
Hmm ?
Thanks,
-Kame
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2011-10-14 4:55 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-28 0:48 [PATCH 0/9] V2: idle page tracking / working set estimation Michel Lespinasse
2011-09-28 0:48 ` [PATCH 1/9] page_referenced: replace vm_flags parameter with struct page_referenced_info Michel Lespinasse
2011-09-28 6:28 ` KAMEZAWA Hiroyuki
2011-09-28 0:49 ` [PATCH 2/9] kstaled: documentation and config option Michel Lespinasse
2011-09-28 6:53 ` KAMEZAWA Hiroyuki
2011-09-28 23:48 ` Michel Lespinasse
2011-09-29 5:40 ` KAMEZAWA Hiroyuki
2011-09-28 0:49 ` [PATCH 3/9] kstaled: page_referenced_kstaled() and supporting infrastructure Michel Lespinasse
2011-09-28 7:18 ` KAMEZAWA Hiroyuki
2011-09-29 0:09 ` Michel Lespinasse
2011-09-28 0:49 ` [PATCH 4/9] kstaled: minimalistic implementation Michel Lespinasse
2011-09-28 7:41 ` Peter Zijlstra
2011-09-28 8:01 ` Michel Lespinasse
2011-09-28 10:26 ` Peter Zijlstra
2011-09-28 8:00 ` KAMEZAWA Hiroyuki
2012-02-20 9:17 ` Zhu Yanhai
2011-09-28 0:49 ` [PATCH 5/9] kstaled: skip non-RAM regions Michel Lespinasse
2011-09-28 8:03 ` KAMEZAWA Hiroyuki
2011-09-28 0:49 ` [PATCH 6/9] kstaled: rate limit pages scanned per second Michel Lespinasse
2011-09-28 8:13 ` KAMEZAWA Hiroyuki
2011-09-28 8:19 ` Michel Lespinasse
2011-09-28 8:59 ` KAMEZAWA Hiroyuki
2011-10-14 1:25 ` Michel Lespinasse
2011-10-14 4:54 ` KAMEZAWA Hiroyuki [this message]
2011-09-28 0:49 ` [PATCH 7/9] kstaled: add histogram sampling functionality Michel Lespinasse
2011-09-28 8:22 ` KAMEZAWA Hiroyuki
2011-09-28 0:49 ` [PATCH 8/9] kstaled: add incrementally updating stale page count Michel Lespinasse
2011-09-28 0:49 ` [PATCH 9/9] kstaled: export PG_stale in /proc/kpageflags Michel Lespinasse
2011-09-29 16:43 ` [PATCH 0/9] V2: idle page tracking / working set estimation Eric B Munson
2011-09-29 20:25 ` Michel Lespinasse
2011-09-29 21:18 ` Eric B Munson
2011-09-30 18:19 ` Eric B Munson
2011-09-30 21:16 ` Michel Lespinasse
2011-09-30 21:40 ` Eric B Munson
2011-10-03 15:06 ` Eric B Munson
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=20111014135404.b56bed48.kamezawa.hiroyu@jp.fujitsu.com \
--to=kamezawa.hiroyu@jp.fujitsu.com \
--cc=a.p.zijlstra@chello.nl \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=bsingharora@gmail.com \
--cc=dave@linux.vnet.ibm.com \
--cc=hughd@google.com \
--cc=jweiner@redhat.com \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mjwolf@us.ibm.com \
--cc=riel@redhat.com \
--cc=walken@google.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