Re: CGROUPS: HowTo: perform force_empty

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

 



On Mon 02-02-15 15:23:22, PINTU KUMAR wrote:
> Hi,
> 
> I have a question about memory cgroups under Linux kernel 3.10.
> Under: /sys/fs/cgroup/memory/:
> 
> I found, memory.force_empty.
> But, when I try to do the following it says invalid argument:
> # echo 0 > memory.force_empty
> sh: echo: write error: Invalid argument
> 
> It even fails with "echo 1"

It is not clear on which cgroup you are trying to invoke force_empty.
The knob is disabled for the root memcg so I suppose this is why you see
the failure. 

> I am using this command from the shell using the root login.
> Can you tell me how to execute the force_empty command.

You can echo anything to the knob to trigger the reclaim.

> Or, how to release all the memory under all cgroups and release it to the
> system?

Why would you use memcg API to release memory from the system as whole?
What are you trying to achieve?

> Under, mm/memcontrol.c , if I use the function: mem_cgroup_force_empty(struct
> mem_cgroup *memcg), will it help to release all memory?
> But, then, how to initialize the memcg data structure?
> Can you provide some example to use this API, from some other kernel
> sub-system.

mem_cgroup_force_empty is an internal memory controller functionality
which is not supposed to be used from other kernel subsystems. Why would
you want to force reclaim on memcg level from the kernel in the first
place?
-- 
Michal Hocko
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe cgroups" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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