From: 熊卧龙 <warren.xiong@ugreen.com>
To: akpm <akpm@linux-foundation.org>
Cc: linux-mm <linux-mm@kvack.org>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] tools/mm: prevent page_owner_sort from truncating input
Date: Thu, 30 Jul 2026 09:30:55 +0800 [thread overview]
Message-ID: <6F7F6EFFF40F9C63+202607300930523706768@ugreen.com> (raw)
In-Reply-To: <20260729173138.fbc115b5285e1b465b055de7@linux-foundation.org>
> This all sounds complex. How does sort(1) do it? Write to a temporary
> file then a rename?
>
> For page_owner_sort I expect we could load all the input into memory
> before opening the output file?
I checked the GNU sort documentation. In normal mode, sort reads all
input before opening the output file. page_owner_sort already stores all
input records in memory, so moving fopen() after the input loop is simpler
and also allows in-place sorting.
I will rework the patch and send v2. Thanks for the suggestion.
Warren
next prev parent reply other threads:[~2026-07-30 1:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-29 5:38 Warren Xiong
2026-07-30 0:31 ` Andrew Morton
2026-07-30 1:30 ` 熊卧龙 [this message]
2026-07-30 1:58 ` [PATCH v2] " Warren Xiong
2026-07-30 20:45 ` Andrew Morton
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=6F7F6EFFF40F9C63+202607300930523706768@ugreen.com \
--to=warren.xiong@ugreen.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/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
all inboxes | Powered by JetHome®