linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.com>
To: Narcis Garcia <debianlists@actiu.net>
Cc: linux-mm@kvack.org, Johannes Weiner <hannes@cmpxchg.org>,
	Roman Gushchin <roman.gushchin@linux.dev>
Subject: Re: swapaccount= commandline option
Date: Tue, 13 Feb 2024 09:06:29 +0100	[thread overview]
Message-ID: <ZcsjBbCSXXMyseHc@tiehlicka> (raw)
In-Reply-To: <bed8a074-7b5d-47db-a181-78e2eb905be8@actiu.net>

On Tue 13-02-24 08:01:37, Narcis Garcia wrote:
> El 12/2/24 a les 23:37, Yosry Ahmed ha escrit:
> > On Sun, Feb 11, 2024 at 1:33 AM Narcis Garcia <debianlists@actiu.net> wrote:
> > > 
> > > Hello,
> > > 
> > > I read this warning on Linux 6.1 boot:
> > > The swapaccount= commandline option is deprecated. Please report your
> > > usecase to linux-mm@kvack.org if you depend on this functionality.
> > > 
> > > And I want to know if this impacts on LinuX Containers (LXC) swap
> > > accounting.
> > 
> > swapaccount= was deprecated in the sense that it is always on now
> > (i.e. you cannot do swapaccount=0 anymore). I believe you are using
> > swapaccount=1 and want to make sure that swap accounting will still
> > work with v6.1, right?
> > 
> > This is the second question we have had about this message [1]. I
> > think we need to clarify the warning (and perhaps backport to stable
> > kernels).
> > 
> > [1]https://lore.kernel.org/linux-mm/2593755.Xrv9ptJ69j@sinistra.local/
> 
> 
> Thank you for answering this question, and sure this clarification is needed
> both in documentation and warning message.
> I've found deprecation message was commited on 26 Sep 2022.
> From what Linux version release, this deprecation is included?
> 
> I suggest this for setup_swap_account() code:
> pr_warn_once("The swapaccount= commandline option is deprecated. "
> 	"Swap accounting is always on. "
> 	"Please report your usecase to linux-mm@kvack.org if you "
> 	"depend on this functionality.\n");

Would it make more sense to warn only if somebody tries to disable the
swap accounting?
--- 
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index e4c8735e7c85..dec75eedf634 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -7936,7 +7936,10 @@ bool mem_cgroup_swap_full(struct folio *folio)
 
 static int __init setup_swap_account(char *s)
 {
-	pr_warn_once("The swapaccount= commandline option is deprecated. "
+	bool res;
+
+	if (kstrtobool(s, &res) || !res)
+		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 1;
-- 
Michal Hocko
SUSE Labs


  parent reply	other threads:[~2024-02-13  8:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-11  9:33 Narcis Garcia
2024-02-12 22:37 ` Yosry Ahmed
2024-02-13  7:01   ` Narcis Garcia
2024-02-13  8:06     ` Yosry Ahmed
2024-02-13  8:06     ` Michal Hocko [this message]
2024-02-13  8:09       ` Yosry Ahmed
2024-02-13  8:26         ` Johannes Weiner
2024-02-13  8:27           ` Yosry Ahmed
2024-02-13  8:23       ` Johannes Weiner
2024-02-13  8:18     ` Johannes Weiner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZcsjBbCSXXMyseHc@tiehlicka \
    --to=mhocko@suse.com \
    --cc=debianlists@actiu.net \
    --cc=hannes@cmpxchg.org \
    --cc=linux-mm@kvack.org \
    --cc=roman.gushchin@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox