Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp774340pxb; Tue, 5 Apr 2022 22:46:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJ0xZUa/7kmSCDZE7qL/PdfkRbePkhBFVzEjnDg1XEDOIklsPh/jjuy6mhDf1xkWnB1Be1 X-Received: by 2002:a17:902:ea52:b0:153:fd04:c158 with SMTP id r18-20020a170902ea5200b00153fd04c158mr6759840plg.83.1649224000849; Tue, 05 Apr 2022 22:46:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649224000; cv=none; d=google.com; s=arc-20160816; b=BQgXK/v6ABzDfHe1I0t2k2WN8Mzl0+jXtIEj+94pqFkQG4Phpg5Ds3t1jiBUwLMEbm SMiiJLg3h0hCKviB0HOmJVLl5l/+/qD9+MwWcvIQ0QVP/khzezLGoqxa3lvfYEAnZYrD w93mlodro4PT9eGVVqAc0AFmWrtF7GsK95uTkzwjx59Ul6R/XRIIithUGOpmTa7Vfnv0 JkoyZTzM0fYMNtAEQbYWoZifgHl3xU9cdyZhMhHrllfUV1MYgaIN3SkpKzQDgtGCJ13D EA0XnbF0Wk/CvNgNpRdpwsyKWPy+Rb/b+BnYsfj5DbtSeGGpmyLQqHwv4BmRXd/4E3me qxxg== 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=v7RhwSdFBdFAV4I4U99CD8mNsut6/bKcMt5u4DsCemM=; b=FEkuhu0yOGhmHggfcYzjcrxTGn+/73HZ2Ut4i1XN+fgimwh3nC/p9kaWdIU/T34DZj numfzLQKVbC/KXxvUDzkWgI991hCnC3bJIlJnjczxD3imN/nPq77JktFLMxPV+Za8xAk OlirXj6lK5YbQjWL23JE2d8ubZ0yDiu5evIAGoW5oLxmDmxSnN45TVkhE5LdQHHzLLn6 1hTBiIqhNql1G/eSFflwpVyuVvsqPLhO6rxUAEnNkR0kaMIPt610Vsm7XsWui9H9gtKi KpnmvRqF+Wc1U1IqxJ0l6Xt7UdeZnwaGR1RRIyAvKZIIjZwdVYT155gCrAIdjySdoXiF uXmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cB6fIKhX; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id t11-20020a170902b20b00b00153b2d16474si13709381plr.124.2022.04.05.22.46.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 22:46:40 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cB6fIKhX; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8DA2A487C14; Tue, 5 Apr 2022 22:11:23 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1583210AbiDEXvh (ORCPT + 99 others); Tue, 5 Apr 2022 19:51:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354201AbiDEKMP (ORCPT ); Tue, 5 Apr 2022 06:12:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F35B653709; Tue, 5 Apr 2022 02:58:28 -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 8E93D616D7; Tue, 5 Apr 2022 09:58:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6C58EC385A2; Tue, 5 Apr 2022 09:58:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649152708; bh=H3I7y/rRseTzNvxZw4IcBbimlRO08GhSoaw43F0QV1c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cB6fIKhXmWwYROhXrLjdBAbxfX3X3GtH98l61k9+O3MBzs79KdoSf7e4JjWrG7+08 ZeG0y9Mv+CVYogZp0za70gc8hY1ZH4dJenp7oJYQd7h+jjssriveHG+g6Vlr3L5LQV 75+R0OuJybz5S0IfKLyHX1N2DAkL9aaAB38LEA8Q= 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.15 875/913] mm/memcontrol: return 1 from cgroup.memory __setup() handler Date: Tue, 5 Apr 2022 09:32:17 +0200 Message-Id: <20220405070406.051120082@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@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=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 @@ -7105,7 +7105,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);