Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp537518imd; Fri, 26 Oct 2018 12:33:55 -0700 (PDT) X-Google-Smtp-Source: AJdET5cHnjWefbVNXXxnx9l5JyyhrF9AyF6hsKQGQ03sZJphiekDykVrUsVgASqvhVD4E2HWTPL4 X-Received: by 2002:a17:902:28a8:: with SMTP id f37-v6mr4823642plb.264.1540582434985; Fri, 26 Oct 2018 12:33:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540582434; cv=none; d=google.com; s=arc-20160816; b=P5e+6mTkuEi/Xd2QUXfrna+hEMcHqTiEgxq4lla7dzhFk3QSwAOSFmHiQhHoQELX74 1zTByVqfquWpFsSGqEabRh+exLJs8pXLv+J+AIs3SjF7Jwf4L8dbu4dgIQ7514SHhRYj AaORwzdxi8l5cWbPCmryYu3cAy+6N3u4kRm3LWDuN+0ADof9CGYPmPQ0EH5y0CaXbD95 /Tix944K12GS6nGe12RCc8kwi5VhQ9R3xSZ874JanE9TPxRhT1ppz2SkM2FYNgQvdCh+ zjCMpjpEu36IS6P25tecYQ0Q0JTn+ObvLD2zGC1/+T9CzCDRnCoUoflMMRepNSoaznx7 yeBw== 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; bh=oeM+Gwlt5l0/bjHe6br/V2FguB8udmFJaRO815JORYA=; b=rdvMu8E15RCd4SDXDKId9i8LfO07UVfe/I/JCrA4zYSmSe6Ra05cnrao3HXEEJmVd3 IDyZu5mS1yLAuHa9kvqcXZh8iSJhUgCgWBhdKy/37qy4EWgcvxmH6cjhX6MTrPb7+1jK SRLKgLmW0J9aWTYJ8kJyc/aK2fv/RsEw091oCfs0HsXZsZVHN8sA+JrpyOD82cRNt2R6 7qZZhL0VUJyOmCLAQ5/U9YiMMueW+gyBfAf0uj51LWuyPzDdIUGUsynsXRNZ8gKLTyEt 25HPSgI2Vt7Y4hvAG2EqwYjIZ32gxj1bxo9o0WP8qoHmVQ9LzrBkTCGtO5Mp4Gr1gK6C o72Q== 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 d2-v6si4977392pfa.160.2018.10.26.12.33.38; Fri, 26 Oct 2018 12:33:54 -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 S1726569AbeJ0ELY (ORCPT + 99 others); Sat, 27 Oct 2018 00:11:24 -0400 Received: from mx2.suse.de ([195.135.220.15]:49654 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725749AbeJ0ELY (ORCPT ); Sat, 27 Oct 2018 00:11:24 -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 9ABBDB074; Fri, 26 Oct 2018 19:33:05 +0000 (UTC) Date: Fri, 26 Oct 2018 21:33:04 +0200 From: Michal Hocko To: Johannes Weiner Cc: linux-mm@kvack.org, Tetsuo Handa , David Rientjes , Andrew Morton , LKML Subject: Re: [RFC PATCH 2/2] memcg: do not report racy no-eligible OOM tasks Message-ID: <20181026193304.GD18839@dhcp22.suse.cz> References: <20181022071323.9550-1-mhocko@kernel.org> <20181022071323.9550-3-mhocko@kernel.org> <20181026142531.GA27370@cmpxchg.org> <20181026192551.GC18839@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181026192551.GC18839@dhcp22.suse.cz> 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 Fri 26-10-18 21:25:51, Michal Hocko wrote: > On Fri 26-10-18 10:25:31, Johannes Weiner wrote: [...] > > There is of course the scenario brought forward in this thread, where > > multiple threads of a process race and the second one enters oom even > > though it doesn't need to anymore. What the global case does to catch > > this is to grab the oom lock and do one last alloc attempt. Should > > memcg lock the oom_lock and try one more time to charge the memcg? > > That would be another option. I agree that making it more towards the > global case makes it more attractive. My tsk_is_oom_victim is more > towards "plug this particular case". Nevertheless let me emphasise that tsk_is_oom_victim will close the race completely, while mem_cgroup_margin will always be racy. So the question is whether we want to close the race because it is just too easy for userspace to hit it or keep the global and memcg oom handling as close as possible. -- Michal Hocko SUSE Labs