Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1318338

Re: fork on processes with lots of memory

Path csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Mikael Pettersson <mikpelinux@gmail.com>
Newsgroups linux.kernel
Subject Re: fork on processes with lots of memory
Date Tue, 26 Jan 2016 21:30:02 +0100
Message-ID <qVips-Vs-19@gated-at.bofh.it> (permalink)
References <qVevx-6B0-19@gated-at.bofh.it> <qVeFd-6F7-23@gated-at.bofh.it>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:mime-version:content-type:content-transfer-encoding:message-id :date:to:cc:subject:in-reply-to:references; bh=+xZ4C13gCefAokI1VkP6VbSN3qXVM6P+t3KtqbyrFiE=; b=FDRFFTt6gLNyMPE13gyKIlgbHJKr9Km5Qno8tUieNQJLCECMaAIvCsHgADWpkQK04d MHBuaNn8C3ZzBqwVh7gsYXVoT0nm4K+g56vXqhdbRv5kyqsKr1OAUSSSMLFZtKa0RCM1 GGZ+zC/jmazpphev2ysVaxY0hUzrj+xOBRBy+bqszaVG9Yya5ELKc4ReF5HGvaJUL4hd Xo7dPxLHLd7ZaAMJSdwb7N4zlAuWRmPksfx+9iuoWD2F4Q3NHuyOzBwu71+qSdeB29Ke CSjaW+0sJZrG9sdHP7nGPfcjKxsbesTPiryT/ARNDH4Sq0B/Ma3vLS1SAv8fUZe2aHxz Tf7g==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:mime-version:content-type :content-transfer-encoding:message-id:date:to:cc:subject:in-reply-to :references; bh=+xZ4C13gCefAokI1VkP6VbSN3qXVM6P+t3KtqbyrFiE=; b=iZy8Ut2dGxBCXt0vtquZuhDEAwOyiUj8YUyXBckwwChVXpS39jOaPm6A1kH2NWuB4R 4kQYSwWtsEo4AT9s+9MeNdDoNmjhjeBGF/L2JrgrnnicfEAI5NlE9vm8M0tNGevduGR4 y77PVVI4/x9/g++WPvLezB1KJ6ubDUnMvVZBqLajT7YUb+1PIz9TT40zleLM9+3CCjd1 lYgGSfWCoD2iZwiAiDg+Kw1Mt5xr1K7zPerdROn9EPOK1ZqgjeXNvs73aImiRt2i9eZR TKk7fHjlYdbmtW79MMm+5xQn2NwwRdWelW0Djv6Vg3cuVeLVddcPn+PIDChJXAe8Imlq eQcw==
X-Gm-Message-State AG10YOSUUgBFVMnhqfM6VZiDdPnjhdkqXn7TOMbsUmFdwMFnsUOV1GrOAtxsPMLulxGKIw==
X-Received by 10.112.164.97 with SMTP id yp1mr9232949lbb.30.1453839989322; Tue, 26 Jan 2016 12:26:29 -0800 (PST)
X-Google-Original-From "Mikael Pettersson" <mikpe@cascade>
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
X-Mailer VM 8.1.2 under 24.5.1 (x86_64-redhat-linux-gnu)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 57
Organization linux.* mail to news gateway
X-Original-Cc linux-kernel@vger.kernel.org
X-Original-Date Tue, 26 Jan 2016 21:26:27 +0100
X-Original-Message-ID <22183.54899.11116.307229@gargle.gargle.HOWL>
X-Original-References <20160126160641.GA530@qarx.de> <20160126162853.GA1836@qarx.de>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1318338

Show key headers only | View raw


Felix von Leitner writes:
 > > Dear Linux kernel devs,
 > 
 > > I talked to someone who uses large Linux based hardware to run a
 > > process with huge memory requirements (think 4 GB), and he told me that
 > > if they do a fork() syscall on that process, the whole system comes to
 > > standstill. And not just for a second or two. He said they measured a 45
 > > minute (!) delay before the system became responsive again.
 > 
 > I'm sorry, I meant 4 TB not 4 GB.
 > I'm not used to working with that kind of memory sizes.

Make sure you have >>4TB physical if you're going to fork from a process
with a 4TB virtual address space.  (I'm assuming it's not sparse, but all
actually being used.)

Disable transparent hugepages (THP).  The internal book-keeping mechanisms
have been known to run amok with large RAM sizes causing severe performance
issues.  Maybe 4.x kernels are better, I haven't checked.

If you're using explicit hugepages and these kinds of RAM sizes, don't
bother with RHEL 6 or 7 kernels -- they're broken.  Vanilla 4.x kernels work.

We're also in the TB range, though not quite 4TB, and fork()ing from inside
such processes definitely works for us.  We do disable THP since it kills us
otherwise.

 > 
 > > Their working theory is that all the pages need to be marked copy-on-write
 > > in both processes, and if you touch one page, a copy needs to be made,
 > > and than just takes a while if you have a billion pages.
 > 
 > > I was wondering if there is any advice for such situations from the
 > > memory management people on this list.
 > 
 > > In this case the fork was for an execve afterwards, but I was going to
 > > recommend fork to them for something else that can not be tricked around
 > > with vfork.
 > 
 > > Can anyone comment on whether the 45 minute number sounds like it could
 > > be real? When I heard it, I was flabberghasted. But the other person
 > > swore it was real. Can a fork cause this much of a delay? Is there a way
 > > to work around it?
 > 
 > > I was going to recommend the fork to create a boundary between the
 > > processes, so that you can recover from memory corruption in one
 > > process. In fact, after the fork I would want to munmap almost all of
 > > the shared pages anyway, but there is no way to tell fork that.
 > 
 > > Thanks,
 > 
 > > Felix
 > 
 > > PS: Please put me on Cc if you reply, I'm not subscribed to this mailing
 > > list.

-- 

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

fork on processes with lots of memory Felix von Leitner <felix-linuxkernel@fefe.de> - 2016-01-26 17:20 +0100
  Re: fork on processes with lots of memory Felix von Leitner <felix-linuxkernel@fefe.de> - 2016-01-26 17:30 +0100
    Re: fork on processes with lots of memory Borislav Petkov <bp@alien8.de> - 2016-01-26 17:40 +0100
    Re: fork on processes with lots of memory Mikael Pettersson <mikpelinux@gmail.com> - 2016-01-26 21:30 +0100

csiph-web