Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754157AbbKJP7i (ORCPT ); Tue, 10 Nov 2015 10:59:38 -0500 Received: from mail-ig0-f182.google.com ([209.85.213.182]:37842 "EHLO mail-ig0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752553AbbKJP7g (ORCPT ); Tue, 10 Nov 2015 10:59:36 -0500 Subject: Re: [PATCH] cgroup_pids: add fork limit To: Aleksa Sarai , Max Kellermann References: <144716440621.20175.1000688899886388119.stgit@rabbit.intern.cm-ag> Cc: Tejun Heo , cgroups@vger.kernel.org, lizefan@huawei.com, Johannes Weiner , max@duempel.org, linux-kernel@vger.kernel.org From: Austin S Hemmelgarn Message-ID: <5642142F.2090302@gmail.com> Date: Tue, 10 Nov 2015 10:58:39 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-512; boundary="------------ms020004030805070605030202" X-Antivirus: avast! (VPS 151110-0, 2015-11-10), Outbound message X-Antivirus-Status: Clean Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 6189 Lines: 100 This is a cryptographically signed message in MIME format. --------------ms020004030805070605030202 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable On 2015-11-10 10:25, Aleksa Sarai wrote: > Processes don't "use up resources" after they've died and been freed > (which is dealt with inside PIDs). Yes, lots of small processes that > die quickly could (in principle) make hard work for the scheduler, but > I don't see how "time spent scheduling in general" is a resource... > Fork bombs aren't bad because they cause a lot of fork()s, they're bad > because the *create a bunch of processes that use up memory*, which > happens because they call fork() a bunch of times and **don't > exit()**. While I'm indifferent about the patch, I would like to point out that=20 fork-bombs are also bad because they eat _a lot_ of processor time, and=20 I've seen ones designed to bring a system to it's knees just by=20 saturating the processor with calls to fork() (which is as slow as or=20 slower than stat() on many commodity systems, setting up the various=20 structures for a new process is an expensive operation) and clogging up=20 the scheduler. This isn't as evident of course when you run a fork-bomb = on a laptop or similar system, because you run out of memory and PID's=20 before the latency from scheduling and so many processes calling fork=20 really starts to become noticeable, but when you start to look at really = big systems (on the order of hundreds of GB of RAM), it does become much = more noticeable. --------------ms020004030805070605030202 Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgMFADCABgkqhkiG9w0BBwEAAKCC Brgwgga0MIIEnKADAgECAgMRLfgwDQYJKoZIhvcNAQENBQAweTEQMA4GA1UEChMHUm9vdCBD QTEeMBwGA1UECxMVaHR0cDovL3d3dy5jYWNlcnQub3JnMSIwIAYDVQQDExlDQSBDZXJ0IFNp Z25pbmcgQXV0aG9yaXR5MSEwHwYJKoZIhvcNAQkBFhJzdXBwb3J0QGNhY2VydC5vcmcwHhcN MTUwOTIxMTEzNTEzWhcNMTYwMzE5MTEzNTEzWjBjMRgwFgYDVQQDEw9DQWNlcnQgV29UIFVz ZXIxIzAhBgkqhkiG9w0BCQEWFGFoZmVycm9pbjdAZ21haWwuY29tMSIwIAYJKoZIhvcNAQkB FhNhaGVtbWVsZ0BvaGlvZ3QuY29tMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA nQ/81tq0QBQi5w316VsVNfjg6kVVIMx760TuwA1MUaNQgQ3NyUl+UyFtjhpkNwwChjgAqfGd LIMTHAdObcwGfzO5uI2o1a8MHVQna8FRsU3QGouysIOGQlX8jFYXMKPEdnlt0GoQcd+BtESr pivbGWUEkPs1CwM6WOrs+09bAJP3qzKIr0VxervFrzrC5Dg9Rf18r9WXHElBuWHg4GYHNJ2V Ab8iKc10h44FnqxZK8RDN8ts/xX93i9bIBmHnFfyNRfiOUtNVeynJbf6kVtd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lq7OacK52VZ32XJv5g0SKApJIHckJ6dWax38zRAxlUSFgQFdwZQMaNIMAAAAAAAAA== --------------ms020004030805070605030202-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/