The patch titled Subject: memcg: free spare array to avoid memory leak has been removed from the -mm tree. Its filename was memcg-free-spare-array-to-avoid-memory-leak.patch This patch was dropped because it was merged into mainline or a subsystem tree The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ From: Sha Zhengju <handai.szj@xxxxxxxxxx> Subject: memcg: free spare array to avoid memory leak When the last event is unregistered, there is no need to keep the spare array anymore. So free it to avoid memory leak. Signed-off-by: Sha Zhengju <handai.szj@xxxxxxxxxx> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> Reviewed-by: Kirill A. Shutemov <kirill@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/memcontrol.c | 6 ++++++ 1 file changed, 6 insertions(+) diff -puN mm/memcontrol.c~memcg-free-spare-array-to-avoid-memory-leak mm/memcontrol.c --- a/mm/memcontrol.c~memcg-free-spare-array-to-avoid-memory-leak +++ a/mm/memcontrol.c @@ -4507,6 +4507,12 @@ static void mem_cgroup_usage_unregister_ swap_buffers: /* Swap primary and spare array */ thresholds->spare = thresholds->primary; + /* If all events are unregistered, free the spare array */ + if (!new) { + kfree(thresholds->spare); + thresholds->spare = NULL; + } + rcu_assign_pointer(thresholds->primary, new); /* To be sure that nobody uses thresholds */ _ Patches currently in -mm which might be from handai.szj@xxxxxxxxxx are memcg-make-threshold-index-in-the-right-position.patch memcg-revise-the-position-of-threshold-index-while-unregistering-event.patch eventfd-change-int-to-__u64-in-eventfd_signal.patch eventfd-change-int-to-__u64-in-eventfd_signal-fix.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