Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3589061imm; Mon, 6 Aug 2018 07:22:49 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdBerwqP90FLJs+Pk8QesBavxQ9T0II2IfoKoiBplTJgBJhPvm8dlLcoamIrEjFkRjHPl6V X-Received: by 2002:a62:57dc:: with SMTP id i89-v6mr17313360pfj.65.1533565369264; Mon, 06 Aug 2018 07:22:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533565369; cv=none; d=google.com; s=arc-20160816; b=VOMKWo1DDVmRzws3KAfotnffDyILtNy2ju2QqPigvsxn6AOyj8PFaYSerlrgT6Hh4y NZS6PXKFEQYfwfx6Fidk7YpBWztapRDKLNPooFqKEJtdXDgpTEwvPBW8INspzFvpYCZn 1D/5g1rhrczj2eTx7fxPjzhcQiPQ3hW4BPH0cuwTaGUoSeQg9ZRwCsH2BZDxlHILs/O1 OU43jyTddrwkaPPbzo1b8BM9w8VkE5QYzMxnUmIP8LYGiQGxIlhUGR/sRs4xRIBcY493 +yFQq+Ugj7BhIKpRgSeWgazLheAO6RoxzlAxRzixrLELm7DJSx7PgFhFsq+mQSpB5eqK L74Q== 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=yOjt909i2Rcys62GP4WV2fY9ezXpD18TbLgFp3j6jb4=; b=N5OXMET+OMom0vDjB/Q7aRAecdleSs/+1X7Kfr7Z8xC9g/7SxdM4bwBB/CByDqKQvr JoXso3otS6KOclaIamYwtINypoDs90wGxQuafgdqeUX//0WCT2Wzt4q1DZqYcP4XNfM4 9oEB2JIxdPF9bb1chrQ0Ol8oVsJrifpOM5Hw09/0YteB9wNPeguH7TAXccSwgE5WfBxT qhP4Bh6lsDVxnCVWpg3/WKQ1rQXNc0nNYMQcVjXGUOswDYN2MDdmpYPOZwxT4rTqaDy4 cTYaXmtwy6m7cqEOpcPRbOQe0eZu5jUuPvnL2YzKqKn12lgVIhUwmvTtRCZN9+npq5N7 tTeA== 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 y4-v6si14600729pfg.246.2018.08.06.07.22.34; Mon, 06 Aug 2018 07:22:49 -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 S1731697AbeHFQar (ORCPT + 99 others); Mon, 6 Aug 2018 12:30:47 -0400 Received: from mx2.suse.de ([195.135.220.15]:44872 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729233AbeHFQar (ORCPT ); Mon, 6 Aug 2018 12:30:47 -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 D599BADE6; Mon, 6 Aug 2018 14:21:25 +0000 (UTC) Date: Mon, 6 Aug 2018 16:21:24 +0200 From: Michal Hocko To: Dmitry Vyukov Cc: syzbot , cgroups@vger.kernel.org, Johannes Weiner , LKML , Linux-MM , syzkaller-bugs , Vladimir Davydov , Dmitry Torokhov Subject: Re: WARNING in try_charge Message-ID: <20180806142124.GP19540@dhcp22.suse.cz> References: <0000000000005e979605729c1564@google.com> <20180806091552.GE19540@dhcp22.suse.cz> <20180806094827.GH19540@dhcp22.suse.cz> <20180806110224.GI19540@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.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 06-08-18 13:57:38, Dmitry Vyukov wrote: > On Mon, Aug 6, 2018 at 1:02 PM, Michal Hocko wrote: [...] > >> A much > >> friendlier for user way to say this would be print a message at the > >> point of misconfiguration saying what exactly is wrong, e.g. "pid $PID > >> misconfigures cgroup /cgroup/path with mem.limit=0" without a stack > >> trace (does not give any useful info for user). And return EINVAL if > >> it can't fly at all? And then leave the "or a kernel bug" part for the > >> WARNING each occurrence of which we do want to be reported to kernel > >> developers. > > > > But this is not applicable here. Your misconfiguration is quite obvious > > because you simply set the hard limit to 0. This is not the only > > situation when this can happen. There is no clear point to tell, you are > > doing this wrong. If it was we would do it at that point obviously. > > But, isn't there a point were hard limit is set to 0? I would expect > there is a something like cgroup file write handler with a value of 0 > or something. Yeah, but this is only one instance of the problem. Other is that the memcg is not reclaimable for any other reasons. And we do not know what those might be > > > If you have a strong reason to believe that this is an abuse of WARN I > > am all happy to change that. But I haven't heard any yet, to be honest. > > WARN must not be used for anything that is not kernel bugs. If this is > not kernel bug, WARN must not be used here. This is rather strong wording without any backing arguments. I strongly doubt 90% of existing WARN* match this expectation. WARN* has traditionally been a way to tell that something suspicious is going on. Those situation are mostly likely not fatal but it is good to know they are happening. Sure there is that panic_on_warn thingy which you seem to be using and I suspect it is a reason why you are so careful about warnings in general but my experience tells me that this configuration is barely usable except for testing (which is your case). But as I've said, I do not insist on WARN here. All I care about is to warn user that something might go south and this may be either due to misconfiguration or a subtly wrong memcg reclaim/OOM handler behavior. -- Michal Hocko SUSE Labs