Re: PROBLEM: Memory leaking when running kubernetes cronjobs

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

 



On Thu, Sep 20, 2018 at 06:28:13PM +0100, Daniel McGinnes wrote:
> Hi Roman,
> 
> yeah, from what I could see docker/kube don't support cgroups v2 yet, it 
> would be great if you could help with a patch for debugging.
> 
> I ran stress in parallel with the workload. drop_caches cleared some also, 
> but a lot was left leaked still even after that.
> 
> My plan is to let it run over the weekend as it is, so I can do a direct 
> comparison with the run without the patches. Monday I'll drop_caches, then 
> create some more regular ambient memory pressure and see what happens.
> 
> thanks,
> 
> Dan McGinnes

Hi Daniel!

Here is the patch. It's against Linus's tree, but shouldn't be hard to apply
to any relatively new version.

Thanks!

diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 32c553556bbd..b43d5fd49173 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -113,6 +113,7 @@ int task_cgroup_path(struct task_struct *task, char *buf, size_t buflen);
 int cgroupstats_build(struct cgroupstats *stats, struct dentry *dentry);
 int proc_cgroup_show(struct seq_file *m, struct pid_namespace *ns,
                     struct pid *pid, struct task_struct *tsk);
+int cgroup_stat_show(struct seq_file *seq, void *v);
 
 void cgroup_fork(struct task_struct *p);
 extern int cgroup_can_fork(struct task_struct *p);
diff --git a/kernel/cgroup/cgroup-v1.c b/kernel/cgroup/cgroup-v1.c
index 51063e7a93c2..b0082913f6b6 100644
--- a/kernel/cgroup/cgroup-v1.c
+++ b/kernel/cgroup/cgroup-v1.c
@@ -678,6 +678,10 @@ struct cftype cgroup1_base_files[] = {
                .write = cgroup_release_agent_write,
                .max_write_len = PATH_MAX - 1,
        },
+       {
+               .name = "cgroup.stat",
+               .seq_show = cgroup_stat_show,
+       },
        { }     /* terminate */
 };
 
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index aae10baf1902..a1039023afa1 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -3366,7 +3366,7 @@ static int cgroup_events_show(struct seq_file *seq, void *v)
        return 0;
 }
 
-static int cgroup_stat_show(struct seq_file *seq, void *v)
+int cgroup_stat_show(struct seq_file *seq, void *v)
 {
        struct cgroup *cgroup = seq_css(seq)->cgroup;
 




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [Monitors]

  Powered by Linux