From: Vlastimil Babka <vbabka@suse.cz>
To: Oscar Salvador <osalvador@suse.de>, Matthew Wilcox <willy@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Michal Hocko <mhocko@suse.com>, Marco Elver <elver@google.com>,
Andrey Konovalov <andreyknvl@gmail.com>,
Alexander Potapenko <glider@google.com>,
Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Subject: Re: [PATCH v2 2/2] mm,page_owner: Fix accounting of pages when migrating
Date: Thu, 21 Mar 2024 11:50:36 +0100 [thread overview]
Message-ID: <ed41d5cf-d068-412d-b7bb-5468df2fefb7@suse.cz> (raw)
In-Reply-To: <ZfptWDsfdxBltN6T@localhost.localdomain>
On 3/20/24 06:00, Oscar Salvador wrote:
> On Tue, Mar 19, 2024 at 06:48:31PM +0000, Matthew Wilcox wrote:
>> Is this the right way to fix this problem? I would have thought we'd
>> be better off accounting this as migration freeing the old page and
>> allocating the new page. If I understand correctly, this is the code
>> which says "This page was last allocated by X and freed by Y", and I
>> would think that being last freed (or allocated) by the migration code
>> would be a very nice hint about where a problem might stem from.
>
> I hear you, and I had the same thought when I stumbled upon this.
> I did not know that the handle was being changed, otherwise it would
> have saved me quite a lot of debugging time.
>
> Checking the history of this, I can see this decision was made in
> 2016 in:
>
> commit d435edca928805074dae005ab9a42d9fa60fc702
> Author: Vlastimil Babka <vbabka@suse.cz>
> Date: Tue Mar 15 14:56:15 2016 -0700
>
> mm, page_owner: copy page owner info during migration
>
Yeah I think we could keep that logic.
But we could also simply subtract the refcount of the old handle (the
"allocated for migration") in __folio_copy_owner() no? Then we wouldn't need
the extra migrate_handle.
Also we might have more issues here. Most page owner code takes care to set
everything for all pages within a folio, but __folio_copy_owner() and
__set_page_owner_migrate_reason() don't.
next prev parent reply other threads:[~2024-03-21 10:50 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-19 18:32 [PATCH v2 0/2] page_owner: Refcount fixups Oscar Salvador
2024-03-19 18:32 ` [PATCH v2 1/2] mm,page_owner: Fix refcount imbalance Oscar Salvador
2024-03-19 23:24 ` Andrew Morton
2024-03-20 4:40 ` Tetsuo Handa
2024-03-20 5:49 ` Oscar Salvador
2024-03-20 9:42 ` Tetsuo Handa
2024-03-20 17:35 ` kernel test robot
2024-03-20 23:37 ` kernel test robot
2024-03-21 10:36 ` Vlastimil Babka
2024-03-19 18:32 ` [PATCH v2 2/2] mm,page_owner: Fix accounting of pages when migrating Oscar Salvador
2024-03-19 18:48 ` Matthew Wilcox
2024-03-20 5:00 ` Oscar Salvador
2024-03-21 10:50 ` Vlastimil Babka [this message]
2024-03-21 11:07 ` Oscar Salvador
2024-03-21 11:20 ` Vlastimil Babka
2024-03-21 11:54 ` Oscar Salvador
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=ed41d5cf-d068-412d-b7bb-5468df2fefb7@suse.cz \
--to=vbabka@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=andreyknvl@gmail.com \
--cc=elver@google.com \
--cc=glider@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=osalvador@suse.de \
--cc=penguin-kernel@i-love.sakura.ne.jp \
--cc=willy@infradead.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