From: Jan Kara <jack@suse.cz>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Jan Kara <jack@suse.cz>,
linux-mm@kvack.org, linux-fsdevel@vger.kernel.org,
Zach O'Keefe <zokeefe@google.com>
Subject: Re: [PATCH 2/2] mm: Avoid overflows in dirty throttling logic
Date: Mon, 24 Jun 2024 10:16:00 +0200 [thread overview]
Message-ID: <20240624081600.fi4om7huw3w5oxy4@quack3> (raw)
In-Reply-To: <20240621101058.afff9eb37e99fd48452599b7@linux-foundation.org>
On Fri 21-06-24 10:10:58, Andrew Morton wrote:
> On Fri, 21 Jun 2024 16:42:38 +0200 Jan Kara <jack@suse.cz> wrote:
>
> > The dirty throttling logic is interspersed with assumptions that dirty
> > limits in PAGE_SIZE units fit into 32-bit (so that various
> > multiplications fit into 64-bits). If limits end up being larger, we
> > will hit overflows, possible divisions by 0 etc. Fix these problems by
> > never allowing so large dirty limits as they have dubious practical
> > value anyway. For dirty_bytes / dirty_background_bytes interfaces we can
> > just refuse to set so large limits. For dirty_ratio /
> > dirty_background_ratio it isn't so simple as the dirty limit is computed
> > from the amount of available memory which can change due to memory
> > hotplug etc. So when converting dirty limits from ratios to numbers of
> > pages, we just don't allow the result to exceed UINT_MAX.
>
> Shouldn't this also be cc:stable?
So this is root-only triggerable problem and kind of "don't do it when it
hurts" issue (who really wants to set dirty limits to > 16 TB?). So I'm not
sure CC stable is warranted but I won't object.
Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
prev parent reply other threads:[~2024-06-24 8:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-21 14:42 [PATCH 0/2] mm: Avoid possible overflows in dirty throttling Jan Kara
2024-06-21 14:42 ` [PATCH 1/2] Revert "mm/writeback: fix possible divide-by-zero in wb_dirty_limits(), again" Jan Kara
2024-06-21 17:26 ` Zach O'Keefe
2024-06-21 14:42 ` [PATCH 2/2] mm: Avoid overflows in dirty throttling logic Jan Kara
2024-06-21 17:10 ` Andrew Morton
2024-06-21 17:29 ` Zach O'Keefe
2024-06-24 8:16 ` Jan Kara [this message]
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=20240624081600.fi4om7huw3w5oxy4@quack3 \
--to=jack@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=zokeefe@google.com \
/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