Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp702931pxb; Tue, 5 Apr 2022 19:27:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyh41kROtNLU6L3yu9W4xqvs/hi+8i/v2vhE7xW53iymJ0SvE8gqjEBZj/rjEcUAs73Glzk X-Received: by 2002:a05:6402:1811:b0:41c:d21a:4096 with SMTP id g17-20020a056402181100b0041cd21a4096mr6490624edy.389.1649212068996; Tue, 05 Apr 2022 19:27:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649212068; cv=none; d=google.com; s=arc-20160816; b=p5oICJAXEItE1Q9pF2R/7vFlHxaFzBHCA3w93TEBia+PB4mTJgl677aV2tnStym6uC jW5EaXN5i4k6zenquwQYRAk+vNwHxjLWc42jbEESyMtcj9ys4XPmMAkq1JD8cpTLb7tD MU9BeSvZ/itWmS05UYQV3uer7glY0jazVzR5XlMNKQI/rTEKxRdrNJviipP9oEyat85o lojYStym40geRxUrWVkJMhjRSwxrZHtCR70MwfvCWLDBwsdc9Rg1F/DJqz0vhCvpQwMU 32Fy2XmQBgTrWDUbeJC/2ggRcVZiM/CekvIIn3I5yDPHkjQkLsFeXE9zHoS2LyFUXTjm k8tQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=yVCDIuPqFkl4ZRotBVkz0czKz5gcfZcG1BwwhQttOHA=; b=TkmM2tfElbhgN2qx3ar7OU9kesnsyPlGP6YDbN5q3FTGnIpRoFXGfWwb44SuQHbI7W Cn6cU3YVOshMZmELWjbgXHS/kWcB7HHBZ47f2Ncu6f7DMZxiLftxcuUKuiqV/3rKVzdl +tmCQYXQDsD0tnmRDnnH2CXIR4TCgioDd3KIjhvWwvKvKoVJpsga3a6EesrWUsWzwnBm JWX/8U1kByFXkAGYrIkDP4jCEmBto3LRBU1CcxmSlEOn0B0Pw26vBAQVqR+7QXX/ali7 Ji/xli7kFBOoQENh7xMXTRw6rLdF5I8XxiCnaaOreo/6yBW0PduQ9oPGn9c9CY1V7jgX lgRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wgj0yHSN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d12-20020a50cf4c000000b00418c2b5bea0si10358781edk.386.2022.04.05.19.27.22; Tue, 05 Apr 2022 19:27:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wgj0yHSN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356997AbiDEKZV (ORCPT + 99 others); Tue, 5 Apr 2022 06:25:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241150AbiDEIcw (ORCPT ); Tue, 5 Apr 2022 04:32:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4536B63C2; Tue, 5 Apr 2022 01:28:42 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D7AB560B0A; Tue, 5 Apr 2022 08:28:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C0CB0C385A1; Tue, 5 Apr 2022 08:28:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649147321; bh=kLA0FOygvSK2hdN4Zg8kc1lbxqXXFha3+GPW5PGe0ME=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wgj0yHSNMgXCcCcp4zdNajeO1qWA0FJemxXstr+jiw+BhJ9EFXCer/Og11D4YL8ZE g9Y2YF3sU3ZbPhkZL5P4CxI+ZJhMxb9OWv1DaYdd4nLLupKOf+YlI9WzueNW925G/m VlefBi1GSUPwJ9A38qw3DufJSoUsvn83OWCn67k8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Randy Dunlap , Igor Zhbanov , =?UTF-8?q?Michal=20Koutn=C3=BD?= , Johannes Weiner , Michal Hocko , Vladimir Davydov , Roman Gushchin , Andrew Morton , Linus Torvalds Subject: [PATCH 5.17 1081/1126] mm/memcontrol: return 1 from cgroup.memory __setup() handler Date: Tue, 5 Apr 2022 09:30:28 +0200 Message-Id: <20220405070439.183961355@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070407.513532867@linuxfoundation.org> References: <20220405070407.513532867@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Randy Dunlap commit 460a79e18842caca6fa0c415de4a3ac1e671ac50 upstream. __setup() handlers should return 1 if the command line option is handled and 0 if not (or maybe never return 0; it just pollutes init's environment). The only reason that this particular __setup handler does not pollute init's environment is that the setup string contains a '.', as in "cgroup.memory". This causes init/main.c::unknown_boottoption() to consider it to be an "Unused module parameter" and ignore it. (This is for parsing of loadable module parameters any time after kernel init.) Otherwise the string "cgroup.memory=whatever" would be added to init's environment strings. Instead of relying on this '.' quirk, just return 1 to indicate that the boot option has been handled. Note that there is no warning message if someone enters: cgroup.memory=anything_invalid Link: https://lkml.kernel.org/r/20220222005811.10672-1-rdunlap@infradead.org Fixes: f7e1cb6ec51b0 ("mm: memcontrol: account socket memory in unified hierarchy memory controller") Signed-off-by: Randy Dunlap Reported-by: Igor Zhbanov Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru Reviewed-by: Michal Koutný Cc: Johannes Weiner Cc: Michal Hocko Cc: Vladimir Davydov Cc: Roman Gushchin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- mm/memcontrol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -7053,7 +7053,7 @@ static int __init cgroup_memory(char *s) if (!strcmp(token, "nokmem")) cgroup_memory_nokmem = true; } - return 0; + return 1; } __setup("cgroup.memory=", cgroup_memory);