Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4581629imm; Tue, 7 Aug 2018 04:07:39 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdpZ/tuOSP6Qykvt3DWUUiFA/Y0FAmET5+wWlXbag9KFLfLKO97paxBuJDybqGt6tK2yhej X-Received: by 2002:a62:c410:: with SMTP id y16-v6mr21297246pff.161.1533640058985; Tue, 07 Aug 2018 04:07:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533640058; cv=none; d=google.com; s=arc-20160816; b=dPLLnQqTUNCyy4frStQDWMVYKDRgwWJnc0P5fb+sGqur6+MrK+KyoKdKPJNuncVYkQ H1/YoUUBR9FEk5nJ/RVGpWvIpyoX+hR7VrzCeN90/oOnGvb3HomgixVDBpa4zsQ+J3P0 RmYGhUctcdcCu+A6gJ2WIwMgJF3ToDNER3L+gR9E/Y61sq6pcMMOQ4gZc6QXNWZkjyxs pzx20UAt9rBAD0oAyxXXOclbra40raPKj9ABaN8FiP+ORkmPc/c3lB3YQl1DK+0iCT6R IUesB+CprZygKSnI7B79HkcjuW5E9LLht+fnxfgU6K8vKsYu0JAVP/eQ2WPBZaRZGjjq dksw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=kLyc4OXLB3AWZtdl0uTc4M/Sn3+QWJqmPz4sQA2Ctiw=; b=sPgGMF04og2T6X97KO1KO86gzFpSX6KNT1jlxtmvNzDUrlvKtJTcYVblXGFB+eQlTO MtOj47+ECPUiuCTVclXHYRvWZDS8gjGF8wrE+llwyY8zD2KHaanhqv1XDjXKnqmmNPej jcT5lnzF8jyXva9RVbUHheo1H+6KTOTgO1tk05itpWaG8KIojFO1wCM/9oi2YHWknnrU +YygQrSO+sPzyKVCdqz6jNhk3nGWjasCM/GUsCFfRvslVbhZeyT6exQvMReYmwvXuj/M Vc7IK6zPrP9vsfpnCYL5dcAo3YXZOOk9EWSGEHle5n8MFOqvuBn07H/RzOT4OLatzK2f 0/RQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d35-v6si821149pla.116.2018.08.07.04.07.23; Tue, 07 Aug 2018 04:07:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387728AbeHGNRz (ORCPT + 99 others); Tue, 7 Aug 2018 09:17:55 -0400 Received: from mx2.suse.de ([195.135.220.15]:53468 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726179AbeHGNRz (ORCPT ); Tue, 7 Aug 2018 09:17:55 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id B438EAFC9; Tue, 7 Aug 2018 11:04:06 +0000 (UTC) Date: Tue, 7 Aug 2018 13:04:05 +0200 From: Michal Hocko To: Tetsuo Handa Cc: Andrew Morton , Johannes Weiner , Vladimir Davydov , linux-mm@kvack.org, Greg Thelen , Dmitry Vyukov , LKML , David Rientjes Subject: Re: [PATCH] memcg, oom: be careful about races when warning about no reclaimable task Message-ID: <20180807110405.GW10003@dhcp22.suse.cz> References: <20180807072553.14941-1-mhocko@kernel.org> <863d73ce-fae9-c117-e361-12c415c787de@i-love.sakura.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <863d73ce-fae9-c117-e361-12c415c787de@i-love.sakura.ne.jp> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 07-08-18 19:15:11, Tetsuo Handa wrote: [...] > Of course, if the hard limit is 0, all processes will be killed after all. But > Michal is ignoring the fact that if the hard limit were not 0, there is a chance > of saving next process from needlessly killed if we waited until "mm of PID=23766 > completed __mmput()" or "mm of PID=23766 failed to complete __mmput() within > reasonable period". This is a completely different issue IMHO. I haven't seen reports about overly eager memcg oom killing so far. > We can make efforts not to return false at > > /* > * This task has already been drained by the oom reaper so there are > * only small chances it will free some more > */ > if (test_bit(MMF_OOM_SKIP, &mm->flags)) > return false; > > (I admit that ignoring MMF_OOM_SKIP for once might not be sufficient for memcg > case), and we can use feedback based backoff like > "[PATCH 4/4] mm, oom: Fix unnecessary killing of additional processes." *UNTIL* > we come to the point where the OOM reaper can always reclaim all memory. The code is quite tricky and I am really reluctant to make it even more so without seeing this is really hurting real users with real workloads. -- Michal Hocko SUSE Labs