From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-23.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3A96C433DB for ; Fri, 19 Mar 2021 13:50:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7FA5164EE1 for ; Fri, 19 Mar 2021 13:50:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7FA5164EE1 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id EB54A8D0003; Fri, 19 Mar 2021 09:50:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E70FE6B007E; Fri, 19 Mar 2021 09:50:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CDF038D0003; Fri, 19 Mar 2021 09:50:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0130.hostedemail.com [216.40.44.130]) by kanga.kvack.org (Postfix) with ESMTP id B001D6B007B for ; Fri, 19 Mar 2021 09:50:10 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 71D0C181AC9BF for ; Fri, 19 Mar 2021 13:50:10 +0000 (UTC) X-FDA: 77936757780.13.11B71F5 Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) by imf10.hostedemail.com (Postfix) with ESMTP id E4F384080F66 for ; Fri, 19 Mar 2021 13:50:08 +0000 (UTC) Received: by mail-lf1-f53.google.com with SMTP id u10so10093113lff.1 for ; Fri, 19 Mar 2021 06:50:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=UsGaLcv8p/W1uMdTq13khVuGSy6Z0QJqkLpFYQ1bIJk=; b=i77Av+sBL8n+9UII8kK0PPrV0npH/0edODNbc1YUASq98qZ1gcvqBFDVwq1QLt1zyX 7s4RpGH1yxfP87oZyrB+44qDBZUm8EUWzYn2cMXYhz8eq1T6/ozPZSt3dMDmsjB1YKZg 6P2buZ8iGuy07bMMD+S2xdHzzYCWej0gyZK8KtUyVjNtJAzk6v/Lzp0MRhuESwTipzmm pZdGUo7CLI9ROlYI7rxw21LEGWx4f9FN7yZda+kKZtQ6rpPxkuV+78/gHaHWZ6a0R8i7 nGs9ZB98n7tT8UtgieFAhSqszHDkwHh7qHtzNJ0T4Nia0yB3JEVoR2Mv6s81hF0QcQ8l lFOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=UsGaLcv8p/W1uMdTq13khVuGSy6Z0QJqkLpFYQ1bIJk=; b=gPQqhXzI0XcrJQqgKRqGfWzrquH9OIewSJKfAxWRk2r/hkginUprJjbwd7PLbJb9rG nyKsfEh//vPQb0uSIEC/Z2os/7C7whd4oGXvjMU3BwEJUSqWWGiy7Ofgxof/9w3dQ9ud pfhycEFtSnltWGpDFNju896YlQ0wQJzBfXIuaUa1tA/vRxQQYg7SYJsRSvjMPAcnK5q8 ZmDkEKAKXgtKoHdQe7ZwvaWbbNlzQPVNtCG3SZXwkTNwKMbjxJMp2NUTGQ75iEi9xaQc UHFG6d3mFzckErBhubdeYL3j7mxWchl+pSiTnCil/IzuUuvPZ/iaEZXQa6PIW5HEkNz6 9ZRQ== X-Gm-Message-State: AOAM533AP6/if4x+6DQJpnZh9BIJ4qvwY0tbu5NtWcp9o4CFXGTSmw7J AX9rydNNUXqxFiKbvsT0oHRyEMgAir/RY2f89454qw== X-Google-Smtp-Source: ABdhPJxjwHKa49QiYCC84s2uwLM8UKaH50qIbT/IGPLOnGzyv5F1r59+1hsVAoH7p5Tce+4oowp6iqf/ofxqUxf9M1Y= X-Received: by 2002:a05:6512:2356:: with SMTP id p22mr853666lfu.347.1616161807266; Fri, 19 Mar 2021 06:50:07 -0700 (PDT) MIME-Version: 1.0 References: <20210319054944.50048-1-hannes@cmpxchg.org> <20210319054944.50048-2-hannes@cmpxchg.org> In-Reply-To: <20210319054944.50048-2-hannes@cmpxchg.org> From: Shakeel Butt Date: Fri, 19 Mar 2021 06:49:55 -0700 Message-ID: Subject: Re: [PATCH 2/2] mm: memcontrol: deprecate swapaccounting=0 mode To: Johannes Weiner Cc: Andrew Morton , Hugh Dickins , Michal Hocko , Linux MM , Cgroups , LKML , Kernel Team Content-Type: text/plain; charset="UTF-8" X-Stat-Signature: g78uodwzoyt3y1y3jn4hmen9cfrsuub8 X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: E4F384080F66 Received-SPF: none (google.com>: No applicable sender policy available) receiver=imf10; identity=mailfrom; envelope-from=""; helo=mail-lf1-f53.google.com; client-ip=209.85.167.53 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1616161808-852928 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Mar 18, 2021 at 10:49 PM Johannes Weiner wrote: > > The swapaccounting= commandline option already does very little > today. To close a trivial containment failure case, the swap ownership > tracking part of the swap controller has recently become mandatory > (see commit 2d1c498072de ("mm: memcontrol: make swap tracking an > integral part of memory control") for details), which makes up the > majority of the work during swapout, swapin, and the swap slot map. > > The only thing left under this flag is the page_counter operations and > the visibility of the swap control files in the first place, which are > rather meager savings. There also aren't many scenarios, if any, where > controlling the memory of a cgroup while allowing it unlimited access > to a global swap space is a workable resource isolation stragegy. *strategy > > On the other hand, there have been several bugs and confusion around > the many possible swap controller states (cgroup1 vs cgroup2 behavior, > memory accounting without swap accounting, memcg runtime disabled). > > This puts the maintenance overhead of retaining the toggle above its > practical benefits. Deprecate it. > > Suggested-by: Shakeel Butt > Signed-off-by: Johannes Weiner [...] > > static int __init setup_swap_account(char *s) > { > - if (!strcmp(s, "1")) > - cgroup_memory_noswap = false; > - else if (!strcmp(s, "0")) > - cgroup_memory_noswap = true; > - return 1; > + pr_warn_once("The swapaccount= commandline option is deprecated. " > + "Please report your usecase to linux-mm@kvack.org if you " > + "depend on this functionality.\n"); > + return 0; What's the difference between returning 0 or 1 here? > } > __setup("swapaccount=", setup_swap_account); > > @@ -7291,27 +7287,13 @@ static struct cftype memsw_files[] = { > { }, /* terminate */ > }; > > -/* > - * If mem_cgroup_swap_init() is implemented as a subsys_initcall() > - * instead of a core_initcall(), this could mean cgroup_memory_noswap still > - * remains set to false even when memcg is disabled via "cgroup_disable=memory" > - * boot parameter. This may result in premature OOPS inside > - * mem_cgroup_get_nr_swap_pages() function in corner cases. > - */ > static int __init mem_cgroup_swap_init(void) > { > - /* No memory control -> no swap control */ > - if (mem_cgroup_disabled()) > - cgroup_memory_noswap = true; > - > - if (cgroup_memory_noswap) > - return 0; > - Do we need a mem_cgroup_disabled() check here? > WARN_ON(cgroup_add_dfl_cftypes(&memory_cgrp_subsys, swap_files)); > WARN_ON(cgroup_add_legacy_cftypes(&memory_cgrp_subsys, memsw_files)); > > return 0; > } > -core_initcall(mem_cgroup_swap_init); > +subsys_initcall(mem_cgroup_swap_init); > > #endif /* CONFIG_MEMCG_SWAP */ > -- > 2.30.1 >