Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp3032569pxb; Mon, 18 Apr 2022 14:01:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4nyHI4GXz3hUDqzd7hDEVd58w65SlJroTkzzGFW9mkbMGOBsYI0EIjL53ZahyHWe0tUw2 X-Received: by 2002:a17:907:7d90:b0:6e8:cd12:8893 with SMTP id oz16-20020a1709077d9000b006e8cd128893mr10903469ejc.13.1650315685149; Mon, 18 Apr 2022 14:01:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650315685; cv=none; d=google.com; s=arc-20160816; b=CfspwknLa/6TlmerquFnLoLeLwSFEqFFHZ2lQopGD3ZaE0UEpbUfwglmwiPYQ0TlUT nR8mhIi93gt1sBnBJqHfnOwq18DtrZTGIxSHn0NbqCEKw4UdlKVIwQ52fEdL7jrlt7mC gyyRjW5xP2VGQI1KxgkbuVvWrCwFvac+vIfGcMNztxIvWlTLsxY0doj2s2Paln++a7qs DcgPA4SgQP8hEGXsWEELkV1A4MtTAfXPn4X/SOEAMdIYrXLDW0tOu3oPN+6+i35ZEOBH lhX8CB9bBdrF612ueDlFJ1EHNAuipoPmsAKoscbTWifz3HFOhzRlzryRRAvRlNox9TCD NGPg== 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=Pjib4+DChNhDdDW2I+vLNFCB4D7uwsWyzteV/ojTnPs=; b=Ysib9OR9nakQKbYH5lXnGjq/8amojmmyMhpj3ZgWIMW4Dg5amhWs34f/oxlujS+w7W dS/qAaoxrGoWgOGwcprHjtdUZATX8I7+aVdupuZc7VTaK0pNJQW6eIEkLiOUHQlANuAl UEaQaX9iYiY4BIydRCj2osJUGKU7ReLm2g6nucPt5AKY0IY7GLRenUynUjblHJsc/vVX zBXPzAyjvhuM1Cceyi99Ldgi/I4Qm4Q2JbGV/0OdWZbtnh+SlGhPosYllDa1V61Zjk7g X2DebSeX7c8Siyy3JSvU0MYVWo6Q/TjL8Egi3sPdt3BsqB6AML6qrlbTDM8e/vo7Jp37 XMgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=um2CiFW9; 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 g13-20020a50ec0d000000b00418c2b5bd8asi6978010edr.108.2022.04.18.14.01.00; Mon, 18 Apr 2022 14:01:25 -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=um2CiFW9; 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 S244621AbiDRN5I (ORCPT + 99 others); Mon, 18 Apr 2022 09:57:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244891AbiDRNbA (ORCPT ); Mon, 18 Apr 2022 09:31:00 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4509ACE4; Mon, 18 Apr 2022 05:57:14 -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 D4310612BB; Mon, 18 Apr 2022 12:57:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B9A0AC385A7; Mon, 18 Apr 2022 12:57:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286633; bh=CFRDh/5VyK388caysqLX/bAjGN9S5E6mM71EURz4BgM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=um2CiFW9tAI0rZBZmOTaAov5Hre48zlnCtuC/nni/XKE9VB4UsyosXh6KC+oLnUXc F3wFiLWP/58OnZDCKIh6DU/8klRWS/Bu6jfxZoI77hq7LuBvTsy18o2MgptQ7/+JxW cICF/qIYdOxk6QqTGNhQawuKuSS43590QVG/WBHo= 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 4.14 196/284] mm/memcontrol: return 1 from cgroup.memory __setup() handler Date: Mon, 18 Apr 2022 14:12:57 +0200 Message-Id: <20220418121217.302617191@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@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.7 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 @@ -5978,7 +5978,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);