Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3649016imm; Mon, 2 Jul 2018 03:05:12 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcSWxhbLNKS9WhFePZe+NnGcKvcmQSXtKuMkygsUaymyJKpZ6f8x3PfiKN5A7kjlMukW+gG X-Received: by 2002:a63:9902:: with SMTP id d2-v6mr13035435pge.343.1530525912246; Mon, 02 Jul 2018 03:05:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530525912; cv=none; d=google.com; s=arc-20160816; b=wey2NxSh/MlokdeVsea/aOFBqeVmJmOFZyyD7sAtqRf0OrGfqKWbDziFWzvoHau3Pg uR/ljgeUQUtLKFAKQLGoDD0YmdX2Hnma4GtYOrTKjENYIm97FixApll668mQHUAyqW2c sZFCIMGsBZeB2K4v3TXLHXedoviwv5xKLITXxdk9UJR9a/J5XTBQEGwXns9pb8Mvl33j QdriaHL3W7WMiDjXrOxoV8F4nWis2Wt2NRgPFcPl1iDMaf4Brm0GBklDTpx72zUhRrHf CxquZNrQLC4+NrtRoIuz7mOZyiFCAtbtmRV7SaEpcKnmOfGtj1u6pEzEPO6oits1uvJN VMpQ== 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=8HnXWoyD9aU0Ky2mUdnaBeVr5M97Xc3cDNLFZAAYYEo=; b=ZKUfmwlyt2ifCk6lRgCEjxlBrQUxKijLrnt1MIVVLZH1/R4QRVAIYrbGkPAR4bWp8F t13elqIYc1d2WaGahG7x2cB0gbUMHy4RmBRhYWXSaGRW2mYmVPg6blj4Qhs8AXRXC6I2 0MlW+LqZGT4seO0NkupiJuHvUfQ5xjzEWykOPWgJT/PzKH4sVPmcVLiEK0Y0m0HYzc80 h/L7K5dacQUrdan0lpvxU+sQBH3QGg/Z6cxNka+ApKSKsNjYn2FzkLGa932/OjNz9ieV IQk01tl4jVjWJ2dAkcUHO4i489vTRft9RcZQyoMC6UFXgPeMPWhhLw0wwq+UUJtfMwBH n2eA== 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 j3-v6si5958254pgs.329.2018.07.02.03.04.57; Mon, 02 Jul 2018 03:05:12 -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 S933917AbeGBKDG (ORCPT + 99 others); Mon, 2 Jul 2018 06:03:06 -0400 Received: from mx2.suse.de ([195.135.220.15]:35138 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933467AbeGBKDD (ORCPT ); Mon, 2 Jul 2018 06:03:03 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 4C58CAEC7; Mon, 2 Jul 2018 10:03:02 +0000 (UTC) Date: Mon, 2 Jul 2018 12:03:01 +0200 From: Michal Hocko To: Greg Thelen Cc: Andrew Morton , Johannes Weiner , Shakeel Butt , linux-mm@kvack.org, LKML Subject: Re: [PATCH] memcg, oom: move out_of_memory back to the charge path Message-ID: <20180702100301.GC19043@dhcp22.suse.cz> References: <20180628151101.25307-1-mhocko@kernel.org> <20180629072132.GA13860@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 29-06-18 11:59:04, Greg Thelen wrote: > Michal Hocko wrote: > > > On Thu 28-06-18 16:19:07, Greg Thelen wrote: > >> Michal Hocko wrote: > > [...] > >> > + if (mem_cgroup_out_of_memory(memcg, mask, order)) > >> > + return OOM_SUCCESS; > >> > + > >> > + WARN(1,"Memory cgroup charge failed because of no reclaimable memory! " > >> > + "This looks like a misconfiguration or a kernel bug."); > >> > >> I'm not sure here if the warning should here or so strongly worded. It > >> seems like the current task could be oom reaped with MMF_OOM_SKIP and > >> thus mem_cgroup_out_of_memory() will return false. So there's nothing > >> alarming in that case. > > > > If the task is reaped then its charges should be released as well and > > that means that we should get below the limit. Sure there is some room > > for races but this should be still unlikely. Maybe I am just > > underestimating though. > > > > What would you suggest instead? > > I suggest checking MMF_OOM_SKIP or deleting the warning. So what do you do when you have MMF_OOM_SKIP task? Do not warn? Checking for all the tasks would be quite expensive and remembering that from the task selection not nice either. Why do you think it would help much? I feel strongly that we have to warn when bypassing the charge limit during the corner case because it can lead to unexpected behavior and users should be aware of this fact. I am open to the wording or some optimizations. I would prefer the latter on top with a clear description how it helped in a particular case though. I would rather not over optimize now without any story to back it. -- Michal Hocko SUSE Labs