Skip to contentSkip to conversation

exec: remove page_table_lock for mm counters in acct_arg_size()

PATCH In review Frantisek Hrbata 2 participants 3 messages Jul 14, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 exec: remove page_table_lock for mm counters in acct_arg_size()

Commit 172703b mm: delete non-atomic mm counter implementation removed non-atomic mm counters implementation. I think there is no need to hold page_table_lock for add_mm_counter() when the splitted page table locks are not used. This patch removes the locking.

---
 fs/exec.c |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)
fs/exec.c +0 -6
index 6075a1e..e6fc5e1 100644
@@ -182,13 +182,7 @@ static void acct_arg_size(struct linux_binprm *bprm, unsigned long pages)
 
 	bprm->vma_pages = pages;
 
-#ifdef SPLIT_RSS_COUNTING
 	add_mm_counter(mm, MM_ANONPAGES, diff);
-#else
-	spin_lock(&mm->page_table_lock);
-	add_mm_counter(mm, MM_ANONPAGES, diff);
-	spin_unlock(&mm->page_table_lock);
-#endif
 }
 
 static struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos,
Signature · 1 line
1.7.4.4
#1 lore raw
Quoted 16 lines · Frantisek Hrbata

Commit 172703b mm: delete non-atomic mm counter implementation removed non-atomic mm counters implementation. I think there is no need to hold page_table_lock for add_mm_counter() when the splitted page table locks are not used. This patch removes the locking.

---
 fs/exec.c |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)
fs/exec.c +0 -0
index 6075a1e..e6fc5e1 100644

fs/exec.c static void acct_arg_size(struct linux_binprm *bprm, unsigned long pages) · line 191

Quoted 10 lines
fs/exec.c +0 -6
@@ -182,13 +182,7 @@ static void acct_arg_size(struct linux_binprm *bprm, unsigned long pages)
 
 	bprm->vma_pages = pages;
 
-#ifdef SPLIT_RSS_COUNTING
 	add_mm_counter(mm, MM_ANONPAGES, diff);
-#else
-	spin_lock(&mm->page_table_lock);
-	add_mm_counter(mm, MM_ANONPAGES, diff);
-	spin_unlock(&mm->page_table_lock);
-#endif

Heh. Thanks Frantisek, you are right. But this patch is already in mm-tree, fs-execc-acct_arg_size-ptl-is-no-longer-needed-for-add_mm_counter.patch

Oleg.

#2 lore raw
Quoted 31 lines · Oleg Nesterov
Quoted 16 lines · Frantisek Hrbata

Commit 172703b mm: delete non-atomic mm counter implementation removed non-atomic mm counters implementation. I think there is no need to hold page_table_lock for add_mm_counter() when the splitted page table locks are not used. This patch removes the locking.

---
 fs/exec.c |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)
fs/exec.c +0 -0
index 6075a1e..e6fc5e1 100644

fs/exec.c static void acct_arg_size(struct linux_binprm *bprm, unsigned long pages) · line 191

Quoted 10 lines
fs/exec.c +0 -6
@@ -182,13 +182,7 @@ static void acct_arg_size(struct linux_binprm *bprm, unsigned long pages)
 
 	bprm->vma_pages = pages;
 
-#ifdef SPLIT_RSS_COUNTING
 	add_mm_counter(mm, MM_ANONPAGES, diff);
-#else
-	spin_lock(&mm->page_table_lock);
-	add_mm_counter(mm, MM_ANONPAGES, diff);
-	spin_unlock(&mm->page_table_lock);
-#endif

Heh. Thanks Frantisek, you are right. But this patch is already in mm-tree, fs-execc-acct_arg_size-ptl-is-no-longer-needed-for-add_mm_counter.patch

Quoted 2 lines

Oleg.

:) thanks. Sorry I should check that first.

Signature · 1 line
Frantisek Hrbata