On Tue 03-04-18 08:20:05, Li,Rongqing wrote: > > > > -----邮件原件----- > > 发件人: Michal Hocko [mailto:mhocko@xxxxxxxxxx] > > 发送时间: 2018年4月3日 15:37 > > 收件人: Li,Rongqing <lirongqing@xxxxxxxxx> > > 抄送: akpm@xxxxxxxxxxxxxxxxxxxx; kirill.shutemov@xxxxxxxxxxxxxxx; > > jglisse@xxxxxxxxxx; minchan@xxxxxxxxxx; linux-mm@xxxxxxxxx > > 主题: Re: [PATCH] mm: limit a process RSS > > > > On Mon 02-04-18 15:45:19, Li RongQing wrote: > > > we cannot limit a process RSS although there is ulimit -m, not sure > > > why and when ulimit -m is not working, make it work > > > > Could you be more specific about why do you need this functionality? > > The RSS limit has never been implemented AFAIK and the main reason is that > > the semantic is quite weak to be useful (e.g. the shared memory accounting, > > resident memory that is not mapped etc.). > > avoid some buggy process will exhaust memory, sometime the engineer > did not sure if an application has bug since lots of conditions are > needed to trigger bug, like an application will take more and more > memory when lots of request arrived. > > This method give user an alternative Which will not work in general. > > > > We have memory cgroup controller as an alternative. > > Memory cgroup is to control a group processes, But this method only > control a process, if every process has a different limit, lots of > cgroup need to create, if lots of cgroup, I think the cgroup maybe not > efficient. Why does each process need a separate limit? Processes usually run in sessions with other related processes. If you have a standalone process then nothing really prevents it from running inside a dedicated cgroup. -- Michal Hocko SUSE Labs