Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754436AbbFEL3y (ORCPT ); Fri, 5 Jun 2015 07:29:54 -0400 Received: from mail-qk0-f181.google.com ([209.85.220.181]:32888 "EHLO mail-qk0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752115AbbFEL3u (ORCPT ); Fri, 5 Jun 2015 07:29:50 -0400 Message-ID: <557187F9.8020301@gmail.com> Date: Fri, 05 Jun 2015 07:28:57 -0400 From: Austin S Hemmelgarn User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: David Rientjes , Michal Hocko CC: Andrew Morton , linux-mm@kvack.org, LKML Subject: Re: [PATCH] oom: split out forced OOM killer References: <1433235187-32673-1-git-send-email-mhocko@suse.cz> In-Reply-To: x-hashcash: 1:21:150605:rientjes@google.com::1d96c495e1b04bf68e6229622b15c767:443294d3f1b9a6fc x-hashcash: 1:21:150605:mhocko@suse.cz::bdce344861dfeefa69f67af3e2f293b8:7ec30f02d05ce06e x-hashcash: 1:21:150605:akpm@linux-foundation.org::93d16e65975ae466ae2dd5f89958b0c6:c4ed2a2fd0d4826 x-hashcash: 1:21:150605:linux-mm@kvack.org::c6f73f665ae9ff587ff2ecc0c803199a:cdeed204eeb76a6e x-hashcash: 1:21:150605:linux-kernel@vger.kernel.org::ba5952e7b5137859c1626badb32452f3:16950dfd9e463445 x-stampprotocols: hashcash:1:17;mbound:0:10:3000:5000 Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms010302080500080207080006" X-Antivirus: avast! (VPS 150604-1, 2015-06-04), 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: 7360 Lines: 135 This is a cryptographically signed message in MIME format. --------------ms010302080500080207080006 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: quoted-printable On 2015-06-04 18:59, David Rientjes wrote: > On Tue, 2 Jun 2015, Michal Hocko wrote: > >> OOM killer might be triggered externally via sysrq+f. This is supposed= >> to kill a task no matter what e.g. a task is selected even though ther= e >> is an OOM victim on the way to exit. This is a big hammer for an admin= >> to help to resolve a memory short condition when the system is not abl= e >> to cope with it on its own in a reasonable time frame (e.g. when the >> system is trashing or the OOM killer cannot make sufficient progress).= >> >> The forced OOM killing is currently wired into out_of_memory() >> call which is kind of ugly because generic out_of_memory path >> has to deal with configuration settings and heuristics which >> are completely irrelevant to the forced OOM killer (e.g. >> sysctl_oom_kill_allocating_task or OOM killer prevention for already >> dying tasks). Some of those will not apply to sysrq because the handle= r >> runs from the worker context. >> check_panic_on_oom on the other hand will work and that is kind of >> unexpected because sysrq+f should be usable to kill a mem hog whether >> the global OOM policy is to panic or not. >> It also doesn't make much sense to panic the system when no task canno= t >> be killed because admin has a separate sysrq for that purpose. >> >> Let's pull forced OOM killer code out into a separate function >> (force_out_of_memory) which is really trivial now. Also extract the co= re >> of oom_kill_process into __oom_kill_process which doesn't do any >> OOM prevention heuristics. >> As a bonus we can clearly state that this is a forced OOM killer in th= e >> OOM message which is helpful to distinguish it from the regular OOM >> killer. >> > > I'm not sure what the benefit of this is, and it's adding more code. > Having multiple pathways and requirements, such as constrained_alloc(),= to > oom kill a process isn't any clearer, in my opinion. It also isn't > intended to be optimized since the oom killer called from the page > allocator and from sysrq aren't fastpaths. To me, this seems like only= a > source code level change and doesn't make anything more clear but rathe= r > adds more code and obfuscates the entry path. At the very least, it does make the semantics of sysrq-f much nicer for=20 admins (especially the bit where it ignores the panic_on_oom setting, if = the admin wants the system to panic, he'll use sysrq-c). There have=20 been times I've had to hit sysrq-f multiple times to get to actually=20 kill anything, and this looks to me like it would eliminate that rather=20 annoying issue as well. --------------ms010302080500080207080006 Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/M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luZyBBdXRob3JpdHkxITAfBgkqhkiG9w0BCQEWEnN1cHBvcnRAY2FjZXJ0Lm9yZwIDEG5V MA0GCSqGSIb3DQEBAQUABIICAAUeybENZE2cw8pqNu5AdNT5jGPRoarMEVkK7FpnPFwCnHwL y+W70brTsiP5LhzqL5Vq4cLjoWGk/uyMm671v+grR7wn6ALn1ZangltsZ8gOLUmp1aHbtoyR aUfqE+A2GV+0Tn6Erpitd2DKe7GP9SMjHJrjYx9lLr7q3qP5h0GT324q2j6LEK15d2HzYj38 b6SxlUcX5uz8hSq4dp/YXv+LDrnjUksrJyyj3RxafcUtipf9Ib3oPGYqz4ImM7baeMFe8CMM Ym/HmNFrI42RwpWggfewSOOgqrgn3bpil4aZUpMZJpJ9CQypOdBdq5lIFHm2OdpJhGi+0bdj R7gr8QYkGDGWmn21y/78KCdrJWJIKh+CkwqOuhUhjDKW1hHOfJIWS6Z8F6VYvGDS4ctmU1A0 QvFg8CQpP3JtDkM/MgsnvbwW4tqH7UJkHvleCo6CETgiDzzqS7N5I372WyGS0SscoQjmKeCX u9UmRDf9sBem3/rKY5hBDmMEomFfiV6nKqqR8difXPGyKrMq/JZq8fPAIz9OvYOSPrloqK3x kW+rEAVzK9Cg8I7VzzyYKT0y3lHVO5IxMVr8AaRusLwvr/1EzneLx8Ipv1ZeIGpu1vieIfUi oehQyf590kkAbTW6UquT3QhN2izQaaXGNG015DscFpizuJy1NcZMw1GI2f4mAAAAAAAA --------------ms010302080500080207080006-- -- 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/