Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753964AbdIFMfF (ORCPT ); Wed, 6 Sep 2017 08:35:05 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:58047 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753167AbdIFMfB (ORCPT ); Wed, 6 Sep 2017 08:35:01 -0400 Date: Wed, 6 Sep 2017 13:33:45 +0100 From: Roman Gushchin To: Michal Hocko CC: , Vladimir Davydov , Johannes Weiner , Tetsuo Handa , David Rientjes , Andrew Morton , Tejun Heo , , , , Subject: Re: [v7 2/5] mm, oom: cgroup-aware OOM killer Message-ID: <20170906123345.GA12904@castle> References: <20170904142108.7165-1-guro@fb.com> <20170904142108.7165-3-guro@fb.com> <20170905145700.fd7jjd37xf4tb55h@dhcp22.suse.cz> <20170905202357.GA10535@castle.DHCP.thefacebook.com> <20170906083413.4nzwc27fk3bu2ye4@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20170906083413.4nzwc27fk3bu2ye4@dhcp22.suse.cz> User-Agent: Mutt/1.8.3 (2017-05-23) X-Originating-IP: [2620:10d:c092:200::1:1bb7] X-ClientProxiedBy: HE1PR05CA0165.eurprd05.prod.outlook.com (2603:10a6:3:f8::13) To CO1PR15MB1079.namprd15.prod.outlook.com (2a01:111:e400:7b66::9) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0094797c-759b-4fb4-57c4-08d4f5239060 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:CO1PR15MB1079; X-Microsoft-Exchange-Diagnostics: 1;CO1PR15MB1079;3:yBFe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5FrEz8uqQMXldRZHaECWgWMwHZOel2j+9rUs6daLEWDiaH1qXNErQh8ARCdjlW8nX5sEKtz1X8BDfKeSP56yJbUaZkDluvpfK2eEm9dPkfGWDFCs0OwvXS+F5qkbmzVcLeLs3lbmdooJ6sToA4Q8Zs3oDnmokldPXtMna/wDerhQlr/aOTZyo8IOYL+Y8HnosCp05kZgrZj3++CaPXn8jvepF8Js7oNV+Q8FZ0Vpe7y6QfE1SD1YzwjlhRXN+fuy8VwdjXaMN4199oNsIist/KjRJqd7yl3u7y0mr2RKL1GuJnW+see7uVFq+7x19q3lxsXZGUcYALpasD9KHYL9rY;4:fO0/9yMygmdK0awIivQv0AkHGsqAoR8Qsh6Rhnbjud7yn7VMS6AvVwTONNFYgilBmm9A/u5TAGI2KXVB8Q58GbSPV/lPMB3uUBCA9gwCe473FxilMhxVmin74KqW9s9MOlSbDhyyQtaW+/I1qdopDHUK+I4cvgUdGKTjs9Yz1noK8mIULGxIUFboTWT4sABtKah4T5xQ2R0ksxYnucsEwvxG507qo6Nrb3ppurbzdJX5CoYxW0ynnqwPR2LDDPJt 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)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(3002001)(6041248)(20161123564025)(20161123562025)(20161123555025)(20161123560025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CO1PR15MB1079;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CO1PR15MB1079; X-Forefront-PRVS: 0422860ED4 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6009001)(189002)(377424004)(24454002)(199003)(68736007)(83506001)(6496005)(23726003)(86362001)(39060400002)(50466002)(6246003)(110136004)(1076002)(229853002)(2906002)(93886005)(6116002)(42186005)(189998001)(25786009)(76176999)(54356999)(8936002)(101416001)(97736004)(305945005)(2950100002)(6916009)(4001350100001)(6666003)(50986999)(53936002)(106356001)(478600001)(105586002)(9686003)(54906002)(55016002)(33716001)(4326008)(7736002)(8676002)(47776003)(5660300001)(33656002)(7416002)(81156014)(81166006)(18370500001)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:CO1PR15MB1079;H:castle;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CO1PR15MB1079;23:KdA8HHU330sSaATwVbLTIdR+f7KVcbbTdSU+7EywW?= =?us-ascii?Q?fkfZHeKBPfCYQ9YTEjjtinZS84PFt9z3gmjyzIRGHcaC7W+3lMPyEwzi24XH?= =?us-ascii?Q?ui/NvQ+OVzcYEv9GszfDuN/gKCJWeDN9J42Fgrr5xaoBllDXfssR4aNZYssc?= =?us-ascii?Q?DJWi8e/PVUZZ41COgaJjdsATIha7g8Wv3wNlfFgF7mELGOxmfDahs0EZottu?= =?us-ascii?Q?Wc8oTb10LFOzpIlOOUKRd4Q38PgVYSta/HipT3D3UeXY1PtquqPo72FjTECG?= =?us-ascii?Q?7dPdZY8NaqYyKD7Ibwy3q6qNzrAQrxaup6ub/zQ3M7xhnn5gdkMJjF+meFkt?= =?us-ascii?Q?oHLIPOAJqAyFcplnq8aACAyajiWKupMnmNMEoGovko55qKG6Rnicd8rcGvY9?= =?us-ascii?Q?HtYWFiUgekP9pwMCwPuYQPUCNXPXdh9viQONOEp37huiaWAaypiuSEUUxSoC?= =?us-ascii?Q?QA3S2idB+Z5s35sO8WoatTelKtm2aEmfR8ZyRpC11+7sAwLKnhxBGWAAWsNY?= =?us-ascii?Q?WwvNGymmD/9h/wHUVMP22cfcjeN6NCma1ecm9Lc83We8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9JvHt1nKr47YxHL7V/hXpzUy6Y9wtJmnl55/T94IqyRQmE7UuP25OQsiATgzwNoX1Nz5uEoGNkG9g50lUHsZR63KohKaHGxzj+Ts9Hs/REAUHsmQwwMr+k91rtt4SBSojlX/foeXAJ02u/M483yajxg4eMtX1bJDfKULogcA==;5:zowXqf3W1yC4XDsr7qqNa6enUaAvfp9cnAFhErKOGCW+f//yzx12+SUCx9nmzGeY7Jr3E9Gpf9g5qivK0CW7kFoTurnrOAvsEw3fajHze0vASN8bEjD3MOThLNC97Tx9X5zaZ4vKc3agMG5vXbslkw==;24:9TdSs8fqmaEq9JJZ/TgzS8nP+jICpq37sSWaDNdhehE4epeRLw+4EGpcCjYIGY0UoNOTJXYXM49WctSDjE36tlyRn2omrdDay8fjhm2/wic=;7:0UKiKy2T1NeS26mNOc7resh1hz956XmhPoNT9x/3aYL++reJwLr+QxrLcxCIigtualJ+Y2P4ZSxGxLVn9dmSfM/g2CTHHN1IEE+92IkxV4jqnFbfuIWtRqR/wrZu8KLPsDJuJhpdWB+tLz59hmZ2Z6H4EqUoNQsCU3a1ZGTkebYePB6sax7ks8FRPV/vrJpUKvHLaIM8BdSDkR618WaPRRdX/rfh/+pBXF+fFwUIMt0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CO1PR15MB1079;20:mua9BK3vjUPcXhf8OSCYxmakyieDTL3m6wjAgKuIb35PVff65XiU9JRo8yRMs7q0WB2vDYxoxb+ImR05YREIQAjCHnJTG+59JpgB6IELzuCsVug+PUHFZ7VhinO8xAQWGiwY3Rd6PE7UNSGrAm/VotfYRDgk1DLHBl4GzZMge+k= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Sep 2017 12:34:02.8943 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR15MB1079 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-09-06_05:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 882 Lines: 26 On Wed, Sep 06, 2017 at 10:34:13AM +0200, Michal Hocko wrote: > On Tue 05-09-17 21:23:57, Roman Gushchin wrote: > > On Tue, Sep 05, 2017 at 04:57:00PM +0200, Michal Hocko wrote: > [...] > > > > @@ -810,6 +810,9 @@ static void __oom_kill_process(struct task_struct *victim) > > > > struct mm_struct *mm; > > > > bool can_oom_reap = true; > > > > > > > > + if (is_global_init(victim) || (victim->flags & PF_KTHREAD)) > > > > + return; > > > > + > > > > > > This will leak a reference to the victim AFACS > > > > Good catch! > > I didn't fix this after moving reference dropping into __oom_kill_process(). > > Fixed. > > Btw. didn't you want to check > victim->signal->oom_score_adj == OOM_SCORE_ADJ_MIN > > here as well? Maybe I've missed something but you still can kill a task > which is oom disabled which I thought we agreed is the wrong thing to > do. Added. Thanks!