From: Matthew Wilcox <willy@infradead.org>
To: mawupeng <mawupeng1@huawei.com>
Cc: akpm@linux-foundation.org, david@redhat.com, kasong@tencent.com,
ryan.roberts@arm.com, chrisl@kernel.org,
huang.ying.caritas@gmail.com, schatzberg.dan@gmail.com,
baohua@kernel.org, hanchuanhua@oppo.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: swap: Avoid infinite loop if no valid swap entry found during do_swap_page
Date: Sun, 23 Feb 2025 02:42:00 +0000 [thread overview]
Message-ID: <Z7qK-NFJsqcV0rPw@casper.infradead.org> (raw)
In-Reply-To: <2c7dfa44-266a-4aa6-9401-7528368f171e@huawei.com>
On Sat, Feb 22, 2025 at 11:59:53AM +0800, mawupeng wrote:
>
>
> On 2025/2/22 11:45, Matthew Wilcox wrote:
> > On Sat, Feb 22, 2025 at 10:46:17AM +0800, Wupeng Ma wrote:
> >> Digging into the source, we found that the swap entry is invalid due to
> >> unknown reason, and this lead to invalid swap_info_struct. Excessive log
> >> printing can fill up the prioritized log space, leading to the purging of
> >> originally valid logs and hindering problem troubleshooting. To make this
> >> more robust, kill this task.
> >
> > this seems like a very bad way to fix this problem
>
> Sure, It's a bad way to fix this. Just a proper way to make it more robust?
> Since it will produce lots of invalid and same log?
We have a mechanism to prevent flooding the log: <linux/ratelimit.h>.
If you grep for 'ratelimit' in include, you'll see a number of
convenience functions exist; not sure whether you'll need to use the raw
ratelilmit stuff, or if you can just use one of the prepared ones.
next prev parent reply other threads:[~2025-02-23 2:42 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-22 2:46 Wupeng Ma
2025-02-22 3:45 ` Matthew Wilcox
2025-02-22 3:59 ` mawupeng
2025-02-23 2:42 ` Matthew Wilcox [this message]
2025-02-23 6:09 ` Barry Song
2025-02-23 6:18 ` Barry Song
2025-02-24 1:27 ` mawupeng
2025-02-24 4:22 ` Matthew Wilcox
2025-02-24 7:11 ` Barry Song
2025-02-24 15:37 ` Matthew Wilcox
2025-02-22 7:33 ` Kairui Song
2025-02-22 7:41 ` mawupeng
2025-02-22 8:02 ` Kairui Song
2025-02-22 9:58 ` Barry Song
2025-02-23 2:38 ` kernel test robot
2025-02-23 2:50 ` kernel test robot
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=Z7qK-NFJsqcV0rPw@casper.infradead.org \
--to=willy@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=baohua@kernel.org \
--cc=chrisl@kernel.org \
--cc=david@redhat.com \
--cc=hanchuanhua@oppo.com \
--cc=huang.ying.caritas@gmail.com \
--cc=kasong@tencent.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mawupeng1@huawei.com \
--cc=ryan.roberts@arm.com \
--cc=schatzberg.dan@gmail.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