[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160517085724.GD14453@dhcp22.suse.cz>
Date: Tue, 17 May 2016 10:57:25 +0200
From: Michal Hocko <mhocko@...nel.org>
To: Sebastian Frias <sf84@...oste.net>
Cc: One Thousand Gnomes <gnomes@...rguk.ukuu.org.uk>,
Mason <slash.tmp@...e.fr>, linux-mm@...ck.org,
Andrew Morton <akpm@...ux-foundation.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mm: add config option to select the initial overcommit
mode
On Tue 17-05-16 10:24:20, Sebastian Frias wrote:
[...]
> >> Also, under what conditions would copy-on-write fail?
> >
> > When you have no memory or swap pages free and you touch a COW page that
> > is currently shared. At that point there is no resource to back to the
> > copy so something must die - either the process doing the copy or
> > something else.
>
> Exactly, and why does "killing something else" makes more sense (or
> was chosen over) "killing the process doing the copy"?
Because that "something else" is usually a memory hog and so chances are
that the out of memory situation will get resolved. If you kill "process
doing the copy" then you might end up just not getting any memory back
because that might be a little forked process which doesn't own all that
much memory on its own. That would leave you in the oom situation for a
long time until somebody actually sitting on some memory happens to ask
for CoW... See the difference?
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists