linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Ryan Roberts <ryan.roberts@arm.com>,
	Barry Song <21cnbao@gmail.com>,
	Steven Price <steven.price@arm.com>
Cc: akpm@linux-foundation.org, catalin.marinas@arm.com,
	will@kernel.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, mhocko@suse.com, shy828301@gmail.com,
	v-songbaohua@oppo.com, wangkefeng.wang@huawei.com,
	willy@infradead.org, xiang@kernel.org, ying.huang@intel.com,
	yuzhao@google.com
Subject: Re: [RFC V3 PATCH] arm64: mm: swap: save and restore mte tags for large folios
Date: Mon, 27 Nov 2023 16:42:25 +0100	[thread overview]
Message-ID: <4ca4a5af-accb-4424-a5fb-e1e561900348@redhat.com> (raw)
In-Reply-To: <74596ea2-e7e5-4161-9600-ad1a69b6a6fe@arm.com>


>>> Are you referring to Steven's suggestion of reading the tag to see if it's
>>> zeros? I think that demonstrates my point that this has to be done per-page and
>>
>> Yes.
> 
> OK I'm obviously being thick, because checking a page's tag to see if its zero
> seems logically equivalent to checking the existing per-page flag, just more
> expensive. Yes we could make that change but I don't see how it helps solve the
> real problem at hand. Unless you are also deliberately trying to remove the
> per-page flag at the same time, as per Matthew's master plan?

I think a per-folio interface is cleaner and more future-proof, and 
removing the per-page flag might be a nice side product of that.

Anyhow, just some thoughts from my side if it could be easily/cleanly done.

At least the "easy" part does not seem to be the case, so I'm fine with 
deferring anything like that for now.

[...]

>>
>> We can identify in 1) the subpages by reading the tag from HW,
> 
> I don't think this actually works; I'm pretty sure the optimization to clear the
> tag at the same time as the page clearing only happens for small pages. I don't
> think this will be done when allocating a THP today. Obviously that could change.
> 

Could be, absolutely no expert. I was primarily on the "It would be 
possible to reverse this scheme - we could drop the page
flag and just look at the actual tag storage. If it's all zeros then
obviously there's no point in storing it." comment from Steven.

>> and on 2) by
>> checking the datastructure. For 3), there is nothing to check.
>>
>> On swapout of a large folio:
>>
>> * For 3) we don't do anything
>> * For 2) we don't do anything
>> * For 1) we store all tags that are non-zero (reading all tags) and
>>    transition to 2).
> 
> Given a tag architecturally exists for every page even when unused, and we think
> a folio being partially mte-tagged is the corner case, could you simplify this
> further and just write out all the tags for the folio and not care if some are
> not in use?

Likely this could be simplified, yes.

-- 
Cheers,

David / dhildenb




  reply	other threads:[~2023-11-27 15:42 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-14  1:43 [RFC V3 PATCH] arm64: mm: swap: save and restore mte tags for large folios Barry Song
2023-11-15 14:40 ` Steven Price
2023-11-15 15:16 ` David Hildenbrand
2023-11-15 20:49   ` Barry Song
2023-11-15 22:45     ` Yang Shi
2023-11-16  9:36     ` David Hildenbrand
2023-11-16 23:47       ` Barry Song
2023-11-17  0:15         ` Barry Song
2023-11-17 11:28           ` David Hildenbrand
2023-11-17 18:41             ` Barry Song
2023-11-20  9:11               ` David Hildenbrand
2023-11-20 10:57                 ` Ryan Roberts
2023-11-20 14:50                   ` Steven Price
2023-11-24  1:35                   ` Barry Song
2023-11-24  8:55                     ` David Hildenbrand
2023-11-24  9:01                       ` Ryan Roberts
2023-11-24  9:55                         ` Steven Price
2023-11-24 18:14                           ` Barry Song
2023-11-27 11:56                             ` Ryan Roberts
2023-11-27 12:01                               ` David Hildenbrand
2023-11-27 12:14                                 ` Ryan Roberts
2023-11-27 14:16                                   ` David Hildenbrand
2023-11-27 14:52                                     ` Ryan Roberts
2023-11-27 15:42                                       ` David Hildenbrand [this message]
2023-12-07  3:22                                     ` Barry Song
2023-12-07 10:03                                       ` David Hildenbrand
2023-12-08  0:00                                         ` Barry Song
2023-11-17 11:25         ` David Hildenbrand
2023-11-17 19:36         ` Matthew Wilcox
2023-11-17 20:36           ` Barry Song

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=4ca4a5af-accb-4424-a5fb-e1e561900348@redhat.com \
    --to=david@redhat.com \
    --cc=21cnbao@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=catalin.marinas@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=ryan.roberts@arm.com \
    --cc=shy828301@gmail.com \
    --cc=steven.price@arm.com \
    --cc=v-songbaohua@oppo.com \
    --cc=wangkefeng.wang@huawei.com \
    --cc=will@kernel.org \
    --cc=willy@infradead.org \
    --cc=xiang@kernel.org \
    --cc=ying.huang@intel.com \
    --cc=yuzhao@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;
as well as URLs for NNTP newsgroup(s).