+ memcg-check-for-proper-lock-held-in-mem_cgroup_update_page_stat.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Subject: + memcg-check-for-proper-lock-held-in-mem_cgroup_update_page_stat.patch added to -mm tree
To: handai.szj@xxxxxxxxxx,fengguang.wu@xxxxxxxxx,gthelen@xxxxxxxxxx,hannes@xxxxxxxxxxx,kamezawa.hiroyu@xxxxxxxxxxxxxx,mhocko@xxxxxxx
From: akpm@xxxxxxxxxxxxxxxxxxxx
Date: Thu, 22 Aug 2013 15:43:32 -0700


The patch titled
     Subject: memcg: check for proper lock held in mem_cgroup_update_page_stat
has been added to the -mm tree.  Its filename is
     memcg-check-for-proper-lock-held-in-mem_cgroup_update_page_stat.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/memcg-check-for-proper-lock-held-in-mem_cgroup_update_page_stat.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/memcg-check-for-proper-lock-held-in-mem_cgroup_update_page_stat.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Sha Zhengju <handai.szj@xxxxxxxxxx>
Subject: memcg: check for proper lock held in mem_cgroup_update_page_stat

We should call mem_cgroup_begin_update_page_stat() before
mem_cgroup_update_page_stat() to get proper locks, however the latter
doesn't do any checking that we use proper locking, which would be hard. 
Suggested by Michal Hock we could at least test for rcu_read_lock_held()
because RCU is held if !mem_cgroup_disabled().

Signed-off-by: Sha Zhengju <handai.szj@xxxxxxxxxx>
Acked-by: Michal Hocko <mhocko@xxxxxxx>
Reviewed-by: Greg Thelen <gthelen@xxxxxxxxxx>
Cc: Fengguang Wu <fengguang.wu@xxxxxxxxx>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx>
Cc: Johannes Weiner <hannes@xxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 mm/memcontrol.c |    1 +
 1 file changed, 1 insertion(+)

diff -puN mm/memcontrol.c~memcg-check-for-proper-lock-held-in-mem_cgroup_update_page_stat mm/memcontrol.c
--- a/mm/memcontrol.c~memcg-check-for-proper-lock-held-in-mem_cgroup_update_page_stat
+++ a/mm/memcontrol.c
@@ -2225,6 +2225,7 @@ void mem_cgroup_update_page_stat(struct
 	if (mem_cgroup_disabled())
 		return;
 
+	VM_BUG_ON(!rcu_read_lock_held());
 	memcg = pc->mem_cgroup;
 	if (unlikely(!memcg || !PageCgroupUsed(pc)))
 		return;
_

Patches currently in -mm which might be from handai.szj@xxxxxxxxxx are

memcg-correct-resource_max-to-ullong_max.patch
memcg-rename-resource_max-to-res_counter_max.patch
memcg-avoid-overflow-caused-by-page_align.patch
memcg-reduce-function-dereference.patch
memcg-remove-memcg_nr_file_mapped.patch
memcg-check-for-proper-lock-held-in-mem_cgroup_update_page_stat.patch
memcg-add-per-cgroup-writeback-pages-accounting.patch
memcg-document-cgroup-dirty-writeback-memory-statistics.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux