Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753989AbdHWMad (ORCPT ); Wed, 23 Aug 2017 08:30:33 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:33655 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753915AbdHWMaa (ORCPT ); Wed, 23 Aug 2017 08:30:30 -0400 Date: Wed, 23 Aug 2017 13:30:04 +0100 From: Roman Gushchin To: Johannes Weiner CC: , Michal Hocko , Vladimir Davydov , Tetsuo Handa , David Rientjes , Tejun Heo , , , , Subject: Re: [v5 1/4] mm, oom: refactor the oom_kill_process() function Message-ID: <20170823123004.GA10095@castle.dhcp.TheFacebook.com> References: <20170814183213.12319-1-guro@fb.com> <20170822170655.GB13547@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20170822170655.GB13547@cmpxchg.org> User-Agent: Mutt/1.8.3 (2017-05-23) X-Originating-IP: [2620:10d:c092:200::1:7496] X-ClientProxiedBy: VI1PR0602CA0004.eurprd06.prod.outlook.com (2603:10a6:800:bc::14) To DM3PR15MB1084.namprd15.prod.outlook.com (2603:10b6:0:12::10) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e69abefc-12aa-4a33-7ce2-08d4ea22b623 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:DM3PR15MB1084; X-Microsoft-Exchange-Diagnostics: 1;DM3PR15MB1084;3:dkXVP8FnSl50qV+pTGMPoawNgx+FIDFgPeKskIc6FWpUeu518LcH9FPqpq+ahEk5LiNTjEvmwEcMycj8VZ293d+N79Cewo6Z24JwjS/L1tsPUKefmtj4DKSkjDtDL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8Y3JsyehDpIc7qmvo7Fb1WPhfwh4Ahk9uT02vRBCQuuNMWHFAM3YTn0vf0Mnk4IzEPCUmcrqPiDJ3b7PudBtFKMHorcrDsOIeftqNKPAGQMMbcSTIeT0le2flD1eA+o4AaGKY8vix9PhfZw5y1kNq77VLhlbJOgfn4qB4a5yIoJY9yTTysfKd16usZmfHDv3kGmeCfY16PzwReK9ntPpf2OTa4rOu1Apekmw/4m;4:zbrMj39cU/Qk8ayyee/dAlJNbli8GCNh4YfsTuTuoIuJZDh1fYr8t2YeU4roLpPeP5rcV3s4tZspCvazSG9115c2lRuMASmll/01ygiW2O0NFOCwy2+LIYWybVco/ZvThZKBGdoRzKXn54Uql8E15I6kGRURyN926G48gSryWqiaa/tkHwnSVZBp+XIWGb9/S5EKZMFVStOnny0r7jcqvrx+5zPz6UQdUOuz0YCV+Yvz45Ztk9PmyvS72P8w75PS X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(100000703101)(100105400095)(3002001)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123564025)(20161123555025)(20161123562025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:DM3PR15MB1084;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:DM3PR15MB1084; X-Forefront-PRVS: 040866B734 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(7370300001)(4630300001)(6009001)(189002)(24454002)(199003)(5660300001)(229853002)(6246003)(478600001)(9686003)(50986999)(47776003)(189998001)(6116002)(6666003)(50466002)(25786009)(6506006)(7416002)(6916009)(4001350100001)(54906002)(1076002)(2950100002)(2906002)(86362001)(53936002)(110136004)(23726003)(83506001)(97736004)(7350300001)(8676002)(105586002)(81166006)(55016002)(4326008)(33656002)(7736002)(76176999)(68736007)(305945005)(54356999)(101416001)(106356001)(81156014)(42186005)(18370500001)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:DM3PR15MB1084;H:castle.dhcp.TheFacebook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DM3PR15MB1084;23:YF1vAXB/217i2cX3DoHBoz4tm3BLT0aXPTFQRnqfX?= =?us-ascii?Q?fdSAZNt+qSQMiJxiY28HnRuNS3iomUY0CAQER02A41tpNyQXngfo7nNSCjNp?= =?us-ascii?Q?OP8bL9/AJYAlOT4dZ+O+NNykPJDKjcHx2C8Cio/UsaE2PQ579Rl9/Er8zZyS?= =?us-ascii?Q?NHNGCWJmqFOhZy2zjc26auI85vuquAbE1D+R/8Fs1o2tMFWE1qeaGJuFqvqs?= =?us-ascii?Q?4NpPeaRa6KbsVpLwE38bFykM/vRxkEiZRnRVt9bpBQf7u/2Sfj9oVwStt6SB?= =?us-ascii?Q?byOfpz/yvlWc4WuHkr+JSQfldWGeDxW0yeQhQ37LbXfaQ7DVRlJHN1f6xHkE?= =?us-ascii?Q?4FV6aGBWBYasbADNy1vNOG8p0sc5wOn0DU+rGvdj9BHG9CGx4y9hKLw+VZG9?= =?us-ascii?Q?/g1kGE4Q/+8/tYjig1Kk6O1X3P5JbCYNp/yMnO5xlm/ysobpR9nKOsMOdmkC?= =?us-ascii?Q?CY61SJofL+Wfwjtey2AlBAk2u3TG/G8vLulzUdInpx2YNQwiYQidzFY9Mlq4?= =?us-ascii?Q?Pi0/WeZGgoB1SENeCTmmiNAbZ1FX2SXJ8Cq4CelOBq41Qcoj71VdWwxzEEo2?= =?us-ascii?Q?6KLFeyAONKn7nn/QRvCysjP10Mmnx7Wql6zq+5GQ4RGcRL9FgVlvUsPu+TsI?= =?us-ascii?Q?LM3E0zXG0G4ELxiQ0ZODbIzSNhivbvpQndYtw/vQsE0mi6Y9q4sIV3IPVyrV?= =?us-ascii?Q?El1OIFflsfP17NcUyE8M3NtzBnLJAMesVRqEmYkP20xeJ2eZxjtBvvedsg5u?= =?us-ascii?Q?zj6KCQ3eTbCbOqrOxUop5dqfVM1YivXInTNtOzN1YEU+80Ao2hX9mZZYS+6g?= =?us-ascii?Q?JNt2hbewZPuxGYUbmL1XFZxiTi+FazlgJ+gaKxTV6UleDwXIKm8rCqUPUj7r?= =?us-ascii?Q?746ZL525JCxrME0adhnpGFnmjBZEsahIq3WH+9j6v8VvmujnbCYu7thSJXX4?= =?us-ascii?Q?J65wr5ulEg7nLrVH87diaAOGnfwU8bS5gXRdocSdfVmzQ/J1g7QmLEeX/Pm+?= =?us-ascii?Q?Um7EY8Ee3xSm+wjaU56Avyb7Tfy1DuuN3LawnbVVCXiUcMhz3FvM/a75ypcj?= =?us-ascii?Q?H8Slm/XDMmFaGIZf+xYzCo7p/R0egiiS31rNquJC0SltQBbFUXL/j2gEB702?= =?us-ascii?Q?PUolP887KNmvrgc/nwxz4dDW5lhrCsler0R/HH+MRAis13u/P/Qkd0itkprB?= =?us-ascii?Q?g7HVd60kygggE47f4wg4bTYz6C72zeRj1hz?= X-Microsoft-Exchange-Diagnostics: 1;DM3PR15MB1084;6:opOAywmW5UKVKYqO2HZC6fJ4SRWkoHTL739Uh9DUno+MTmqm+QgetHkNT6UmjKY/p+tiSju917xcEtYA1cyeDNq6yRAjkboslpIxY+vUQ6gkM2T4X+EoNVa/mBflD5e8PAeJ+CNDYKplvZk6sEKS08TuDBColgvm5D/TXzMrNW7rf+V1WIXxpoB+uQiYxCH5ttLFptoUrC3xgBxvFqs73XMklt0dEEjR2Yl2487xd/YzRezZZ5hQeqkoIZBQOrLDnflUDdb6l6FdRB5Il4yFIz0+yFtn4EkVwKMSGIHHc0/mXwbNRDnhrghfSusFrt5scP2CBs+pLoqos+Mzup2hbw==;5:pRfFfxsFZqOqr3idsGPE/Ank/sTb/2EdXclEk3vNu7axWXEmnNKd+MIgfWnPaxdBamxmMBEI/oh9DAozvGyiSq8LzCQH3AFSblPbCZ2foaH4VvrFMFw9qdC/k1m+LSJMwC7E5CuJTdcwTDNsyvjdTg==;24:+NrqpWAoc3Yw2KXZ/knLJtcqwcPVdytKEoLad5AMXiG5iMrdMB9P5QffoFd+MPVs3nZIEsJQ5LOXbh4YfDdsApzvpEYAngEPSp+RE+PLmtg=;7:PgORBtbxr8D0XAkpeJRJ5FZb8JtdXvFEMSOzGYVipJMMPYCgHppAQMHr5krD92ANToyWfPS4c9iOYwhaSF4ZXUtPC7TDOqiuPKIc2n2xLOtmBGtXN2ReCydaUa0Za2Fi4l+JkUP27L8mpJsq1lBtHBNoamjcA6FuBZEQeAAaBrs2jWYR8+XVuHCmOG7wiH5ju50TGf9o88S+29FnxNWOBY/abZrg9dNXRkaFx1MkJw8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DM3PR15MB1084;20:xB3ywKpOdrf63Mk+q7vRmhU14C++Oc2+a1zgJFTRpxCMjgij93eBuryOI6V9ArS9M/RdK/fDe6At6jR43qPYMZpUFriNNyX4JR3dqL1WWNvFJGFMNJ/rMWC0/HG9VpzXHP/0gseWuOnx/LrFiJBKOqzLP906Sc2gfz47yBC6Sl8= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2017 12:30:14.9773 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR15MB1084 X-OriginatorOrg: fb.com X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-08-23_05:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 668 Lines: 15 On Tue, Aug 22, 2017 at 01:06:55PM -0400, Johannes Weiner wrote: > On Mon, Aug 14, 2017 at 07:32:09PM +0100, Roman Gushchin wrote: > > @@ -817,67 +817,12 @@ static bool task_will_free_mem(struct task_struct *task) > > return ret; > > } > > > > -static void oom_kill_process(struct oom_control *oc, const char *message) > > +static void __oom_kill_process(struct task_struct *victim) > > oom_kill_task()? Not sure, as it kills all tasks which are sharing mm with the given task. Also, it will be confusing to have oom_kill_process() and oom_kill_task(), where the actual difference is in how much verbose they are, and if it's allowed to perfer a child process.