Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp823985imm; Tue, 3 Jul 2018 00:09:59 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK4X5PfohMpmWYEwphL4VMsD1w7U+fhCxuj0lp3MiSu/P6HLrZDZWCRwhBuaC4BMieAtkii X-Received: by 2002:a17:902:2f43:: with SMTP id s61-v6mr28631784plb.274.1530601799688; Tue, 03 Jul 2018 00:09:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530601799; cv=none; d=google.com; s=arc-20160816; b=zH+aAavxT22YJSqyja70MbS7yAJrHe/3uVywo+zNDM/obrNHlVehAHby5QZF10P7i8 6IIUWGjX/E3w0YVFm9aqe48nHF172oql+qx+444EugJJkq7EHvQp84diz8qpj8EhIEU1 HxlpG1E02WTAIKD4jLGNkfsR/FTVZUPdCkDEQrxXbSWwEIzFvhYErNGA6xjDodaMpgr9 B7pOPpscESvTxxwS1mcCzSzPsXzrHlRn9qrmAoFb4VVejutb5+CUF2zeeNRtVc+EtCZe iCt6mvqLvW4AXAcOl1ONQI3bpXvuIsRh4vVZJjcym6qmwEV5tTZAg5yRkT/GA50+A+VG NNwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:references :mime-version:message-id:in-reply-to:date:dkim-signature :arc-authentication-results; bh=I6uosl1zIWwBC1sQZN+ohO0DgT673+yEsyktb6d5uuU=; b=cPlUhHhfGErjOPV7To1zFJkuSiGEHZw9jNl6nuPAyD1TyNtXA7v6GCQy+VK0Kqj8ew a9wNVYrcp/8e0DAJdVc96DHDW3Oiq2JN6465d8rKdBf5BBmFz4msHiCs+MZoOMU7X6aA unxelUkpvWeLMN85X5j544wyfXdv4VgfLZOB2ET8X4ZThpBqCMiQg7u4LbLhHGEdFDlq AR85bkTycBY6yo4VZW3aC+hAJKesBfcnQb+AtBFqctWykbXKAAewesX+5VxYFxJlcR+8 PHcfuW9b9T3lBxEDXK9+m9VmBI2rT6F0tGDap6Y0fwYnfOuXR0fQL2XQ+BuaJYFBfi4W JWEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=rN+fJ8LA; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s64-v6si422865pgs.499.2018.07.03.00.09.45; Tue, 03 Jul 2018 00:09:59 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=rN+fJ8LA; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932470AbeGCHIL (ORCPT + 99 others); Tue, 3 Jul 2018 03:08:11 -0400 Received: from mail-qt0-f201.google.com ([209.85.216.201]:42676 "EHLO mail-qt0-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932095AbeGCHIJ (ORCPT ); Tue, 3 Jul 2018 03:08:09 -0400 Received: by mail-qt0-f201.google.com with SMTP id f8-v6so1202088qth.9 for ; Tue, 03 Jul 2018 00:08:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=I6uosl1zIWwBC1sQZN+ohO0DgT673+yEsyktb6d5uuU=; b=rN+fJ8LAbvHbAp5txQiEGhmICd7MnVMPwbij4gJdBBFTxDSRdV73oKChJlueF657xw IaeRoWGHsKsrai7jY3+Zhd3eumpC0Tvxv3+VC8FxAGEat2aWOB9sbzbo657ZABXg6dFB uga198+mUIlbSj6Hs76Q0sjaxDtWuFLh+7N/cnuRMd9+sVtCAz/UPTFZtP/4nNWtotxy ac0QlsU60uDy5MqAzIBlzA0RiuM9qyvf+Xdphdf2iLtPBl3nCMK2U55cpZmbrw72CCwI cUK8BJoXLqhcbzl+k+n2xEWfmx3FF40upDl8NU8mO11m66v2Z2HmtXjZF1JnOqstDRLI qYkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=I6uosl1zIWwBC1sQZN+ohO0DgT673+yEsyktb6d5uuU=; b=UKx+esLxzeAn11pV8WV9gftPH+PVMsY3w5elHRQjcl6hgqZ7i+4ZirVcHRMRzAxHd7 plG7Ba+O7TNtgsK/7izSnlZLOIPTq/JyAoDoSvUIUOHYs3A6hni1ubCNhaD35SM3j2J0 jrb6zhCmMQuWZB6w6eYjolBC/UcIgbilRjyjhLebLVA6+yuyw/fEDIGJluvZJd2k3B58 IsLwcjP9dJ5MRClpXLkSVln+Has3p46YoJd9izm8uMX5SUg+Y7TWEFkXUhOOUoqgFnie v2KWN1nc2fNzaIVBzbGlnZalfOdiW3QJSFogAinptoaAp4hq1FV8ElwGAdv050t11IKz MsIg== X-Gm-Message-State: APt69E14pLM3RFCccrab4gNcaKKOepQ7iHTGXdSviTzwENwmEketoikd o1TOoh5WIlohaABCIIchY5HPJYfBcJN/ X-Received: by 2002:aed:2106:: with SMTP id 6-v6mr15706370qtc.24.1530601688459; Tue, 03 Jul 2018 00:08:08 -0700 (PDT) Date: Tue, 03 Jul 2018 00:08:05 -0700 In-Reply-To: <20180702100301.GC19043@dhcp22.suse.cz> Message-Id: Mime-Version: 1.0 References: <20180628151101.25307-1-mhocko@kernel.org> <20180629072132.GA13860@dhcp22.suse.cz> <20180702100301.GC19043@dhcp22.suse.cz> Subject: Re: [PATCH] memcg, oom: move out_of_memory back to the charge path From: Greg Thelen To: Michal Hocko Cc: Andrew Morton , Johannes Weiner , Shakeel Butt , linux-mm@kvack.org, LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Michal Hocko wrote: > 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 assume we could just check current's MMF_OOM_SKIP - no need to check all tasks. My only (minor) objection is that the warning text suggests misconfiguration or kernel bug, when there may be neither. > 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. I'm fine with the warning. I know enough to look at dmesg logs to take an educates that the race occurred. We can refine it later if/when the reports start rolling in. No change needed.