From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: "linux-mm@kvack.org" <linux-mm@kvack.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"balbir@linux.vnet.ibm.com" <balbir@linux.vnet.ibm.com>,
"nishimura@mxp.nes.nec.co.jp" <nishimura@mxp.nes.nec.co.jp>
Subject: [RFC][PATCH 3/5] memcg: unmap, truncate, invalidate uncharege in batch
Date: Fri, 28 Aug 2009 13:25:42 +0900 [thread overview]
Message-ID: <20090828132542.37d712ba.kamezawa.hiroyu@jp.fujitsu.com> (raw)
In-Reply-To: <20090828132015.10a42e40.kamezawa.hiroyu@jp.fujitsu.com>
We can do batched uncharge when
- invalidate/truncte file
- unmap range of pages.
This means we don't do "batched" uncharge in memory reclaim path.
I think it's reasonable.
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
---
mm/memory.c | 2 ++
mm/truncate.c | 6 ++++++
2 files changed, 8 insertions(+)
Index: mmotm-2.6.31-Aug27/mm/memory.c
===================================================================
--- mmotm-2.6.31-Aug27.orig/mm/memory.c
+++ mmotm-2.6.31-Aug27/mm/memory.c
@@ -909,6 +909,7 @@ static unsigned long unmap_page_range(st
details = NULL;
BUG_ON(addr >= end);
+ mem_cgroup_uncharge_batch_start();
tlb_start_vma(tlb, vma);
pgd = pgd_offset(vma->vm_mm, addr);
do {
@@ -921,6 +922,7 @@ static unsigned long unmap_page_range(st
zap_work, details);
} while (pgd++, addr = next, (addr != end && *zap_work > 0));
tlb_end_vma(tlb, vma);
+ mem_cgroup_uncharge_batch_end();
return addr;
}
Index: mmotm-2.6.31-Aug27/mm/truncate.c
===================================================================
--- mmotm-2.6.31-Aug27.orig/mm/truncate.c
+++ mmotm-2.6.31-Aug27/mm/truncate.c
@@ -272,6 +272,7 @@ void truncate_inode_pages_range(struct a
pagevec_release(&pvec);
break;
}
+ mem_cgroup_uncharge_batch_start();
for (i = 0; i < pagevec_count(&pvec); i++) {
struct page *page = pvec.pages[i];
@@ -286,6 +287,7 @@ void truncate_inode_pages_range(struct a
unlock_page(page);
}
pagevec_release(&pvec);
+ mem_cgroup_uncharge_batch_end();
}
}
EXPORT_SYMBOL(truncate_inode_pages_range);
@@ -327,6 +329,7 @@ unsigned long invalidate_mapping_pages(s
pagevec_init(&pvec, 0);
while (next <= end &&
pagevec_lookup(&pvec, mapping, next, PAGEVEC_SIZE)) {
+ mem_cgroup_uncharge_batch_start();
for (i = 0; i < pagevec_count(&pvec); i++) {
struct page *page = pvec.pages[i];
pgoff_t index;
@@ -354,6 +357,7 @@ unsigned long invalidate_mapping_pages(s
break;
}
pagevec_release(&pvec);
+ mem_cgroup_uncharge_batch_end();
cond_resched();
}
return ret;
@@ -428,6 +432,7 @@ int invalidate_inode_pages2_range(struct
while (next <= end && !wrapped &&
pagevec_lookup(&pvec, mapping, next,
min(end - next, (pgoff_t)PAGEVEC_SIZE - 1) + 1)) {
+ mem_cgroup_uncharge_batch_start();
for (i = 0; i < pagevec_count(&pvec); i++) {
struct page *page = pvec.pages[i];
pgoff_t page_index;
@@ -477,6 +482,7 @@ int invalidate_inode_pages2_range(struct
unlock_page(page);
}
pagevec_release(&pvec);
+ mem_cgroup_uncharge_batch_end();
cond_resched();
}
return ret;
--
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-08-28 4:27 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-28 4:20 [RFC][PATCH 0/5] memcg: reduce lock conetion KAMEZAWA Hiroyuki
2009-08-28 4:23 ` [RFC][PATCH 1/5] memcg: change for softlimit KAMEZAWA Hiroyuki
2009-08-28 7:20 ` Balbir Singh
2009-08-28 7:35 ` KAMEZAWA Hiroyuki
2009-08-28 13:26 ` Balbir Singh
2009-08-28 14:29 ` KAMEZAWA Hiroyuki
2009-08-28 14:40 ` KAMEZAWA Hiroyuki
2009-08-28 14:46 ` Balbir Singh
2009-08-28 15:06 ` KAMEZAWA Hiroyuki
2009-08-28 15:08 ` Balbir Singh
2009-08-28 15:12 ` KAMEZAWA Hiroyuki
2009-08-28 15:15 ` Balbir Singh
2009-08-28 14:45 ` Balbir Singh
2009-08-28 14:58 ` KAMEZAWA Hiroyuki
2009-08-28 15:07 ` Balbir Singh
2009-08-28 4:24 ` [RFC][PATCH 2/5] memcg: uncharge in batched manner KAMEZAWA Hiroyuki
2009-08-28 4:53 ` KAMEZAWA Hiroyuki
2009-08-28 4:55 ` KAMEZAWA Hiroyuki
2009-08-28 15:10 ` Balbir Singh
2009-08-28 15:21 ` KAMEZAWA Hiroyuki
2009-08-28 16:03 ` Balbir Singh
2009-08-31 11:02 ` Balbir Singh
2009-08-31 11:59 ` KAMEZAWA Hiroyuki
2009-08-31 12:10 ` Balbir Singh
2009-08-31 12:14 ` KAMEZAWA Hiroyuki
2009-08-31 12:23 ` Balbir Singh
2009-08-31 14:36 ` KAMEZAWA Hiroyuki
2009-08-28 4:25 ` KAMEZAWA Hiroyuki [this message]
2009-08-31 11:02 ` [RFC][PATCH 3/5] memcg: unmap, truncate, invalidate uncharege in batch Balbir Singh
2009-08-28 4:27 ` [RFC][PATCH 4/5] memcg: per-cpu charge stock KAMEZAWA Hiroyuki
2009-08-31 11:10 ` Balbir Singh
2009-08-31 12:07 ` KAMEZAWA Hiroyuki
2009-08-28 4:28 ` [RFC][PATCH 5/5] memcg: drain per cpu stock KAMEZAWA Hiroyuki
2009-08-31 11:11 ` Balbir Singh
2009-08-31 12:09 ` KAMEZAWA Hiroyuki
2009-08-28 4:28 ` [RFC][PATCH 0/5] memcg: reduce lock conetion Balbir Singh
2009-08-28 4:33 ` KAMEZAWA Hiroyuki
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=20090828132542.37d712ba.kamezawa.hiroyu@jp.fujitsu.com \
--to=kamezawa.hiroyu@jp.fujitsu.com \
--cc=balbir@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=nishimura@mxp.nes.nec.co.jp \
/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