Re: [PATCH 2/2] mm/madvise: add process_madvise MADV_DONTNEER support

2020-12-08 Thread Suren Baghdasaryan
On Tue, Dec 8, 2020 at 3:40 PM Jann Horn wrote: > > On Tue, Nov 24, 2020 at 6:50 AM Suren Baghdasaryan wrote: > > In modern systems it's not unusual to have a system component monitoring > > memory conditions of the system and tasked with keeping system memory > > pressure under control. One way

Re: [PATCH 2/2] mm/madvise: add process_madvise MADV_DONTNEER support

2020-12-08 Thread Jann Horn
On Tue, Nov 24, 2020 at 6:50 AM Suren Baghdasaryan wrote: > In modern systems it's not unusual to have a system component monitoring > memory conditions of the system and tasked with keeping system memory > pressure under control. One way to accomplish that is to kill > non-essential processes to

Re: [PATCH 2/2] mm/madvise: add process_madvise MADV_DONTNEER support

2020-11-24 Thread Suren Baghdasaryan
On Tue, Nov 24, 2020 at 5:42 AM Oleg Nesterov wrote: > > On 11/23, Suren Baghdasaryan wrote: > > > > + if (madvise_destructive(behavior)) { > > + /* Allow destructive madvise only on a dying processes */ > > + if (!signal_group_exit(task->signal)) { > > signal_group_exi

Re: [PATCH 2/2] mm/madvise: add process_madvise MADV_DONTNEER support

2020-11-24 Thread Oleg Nesterov
On 11/23, Suren Baghdasaryan wrote: > > + if (madvise_destructive(behavior)) { > + /* Allow destructive madvise only on a dying processes */ > + if (!signal_group_exit(task->signal)) { signal_group_exit(task) is true if this task execs and kills other threads, see the c

[PATCH 2/2] mm/madvise: add process_madvise MADV_DONTNEER support

2020-11-23 Thread Suren Baghdasaryan
In modern systems it's not unusual to have a system component monitoring memory conditions of the system and tasked with keeping system memory pressure under control. One way to accomplish that is to kill non-essential processes to free up memory for more important ones. Examples of this are Facebo