From: David Hildenbrand <david@redhat.com>
To: Sergey Senozhatsky <senozhatsky@chromium.org>,
Andrew Morton <akpm@linux-foundation.org>
Cc: Matthew Wilcox <willy@infradead.org>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Mike Rapoport <rppt@kernel.org>, Minchan Kim <minchan@kernel.org>,
Hyeonggon Yoo <42.hyeyoo@gmail.com>
Subject: Re: [PATCH v2 3/6] mm/zsmalloc: use a proper page type
Date: Wed, 26 Jun 2024 07:08:47 +0200 [thread overview]
Message-ID: <96e0915c-e836-4413-81ea-37bbb6abba6b@redhat.com> (raw)
In-Reply-To: <20240626044122.GA15925@google.com>
On 26.06.24 06:41, Sergey Senozhatsky wrote:
> On (24/06/25 15:33), Andrew Morton wrote:
>> On Fri, 31 May 2024 16:32:04 +0200 David Hildenbrand <david@redhat.com> wrote:
>>
>>> On 31.05.24 16:27, Matthew Wilcox wrote:
>>>> On Thu, May 30, 2024 at 02:01:23PM +0900, Sergey Senozhatsky wrote:
>>>> 1409: 83 c0 01 add $0x1,%eax
>>>> if (mapcount < PAGE_MAPCOUNT_RESERVE + 1)
>>>> 140c: 83 f8 81 cmp $0xffffff81,%eax
>>>> 140f: 7d 63 jge 1474 <filemap_unaccount_folio+0x8
>>>> 4>
>>>> if (folio_test_hugetlb(folio))
>>>> 1411: 80 7b 33 84 cmpb $0x84,0x33(%rbx)
>>>> 1415: 74 4e je 1465 <filemap_unaccount_folio+0x75>
>>>>
>>>> so we go from "mov, and, cmp, je" to just "cmpb, je", which must surely
>>>> be faster to execute as well as being more compact in the I$ (6 bytes vs 15).
>>>>
>>>> Anyway, not tested but this is the patch I used to generate the above.
>>>> More for comment than application.
>>>
>>> Right, it's likely very similar to my previous proposal to use 8 bit
>>> (uint8_t) for the type.
>>>
>>> https://lore.kernel.org/all/00ba1dff-7c05-46e8-b0d9-a78ac1cfc198@redhat.com/
>>>
>>> I would prefer if we would do that separately; unless someone is able to
>>> raise why we care about zram + 256KiB that much right now. (claim: we don't)
>>>
>>
>> iow, "this is ok for now", yes?
>
> Perhaps. I'm not in position to claim that zram + 256KiB PAGE_SIZE is
> irrelevant, but I'm also not in position to claim the opposite.
>
> Matthew and David have ideas/proposals/patches to fix it should 256KiB
> PAGE_SIZE become an issue.
Yes, let's keep it simple for now. There are various ways to handle that
if there is really the need to. 256KiB is not particularly common (quite
the opposite I would claim), and a simple fix would be dedicating 18
instead of 16 bit.
Long-term, we should handle it more cleanly though, and there are also
various ways forward (store offset in page, separate allocation like
memdesc for metadata, etc.).
Mess with turning page types from flags into values should be a separate
effort, because requires more care (e.g., PAGE_SLAB_MAPCOUNT_VALUE).
--
Cheers,
David / dhildenb
next prev parent reply other threads:[~2024-06-26 5:08 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-29 11:18 [PATCH v2 0/6] mm: page_type, zsmalloc and page_mapcount_reset() David Hildenbrand
2024-05-29 11:18 ` [PATCH v2 1/6] mm: update _mapcount and page_type documentation David Hildenbrand
2024-05-29 11:19 ` [PATCH v2 2/6] mm: allow reuse of the lower 16 bit of the page type with an actual type David Hildenbrand
2024-05-29 16:00 ` David Hildenbrand
2024-05-29 11:19 ` [PATCH v2 3/6] mm/zsmalloc: use a proper page type David Hildenbrand
2024-05-30 5:01 ` Sergey Senozhatsky
2024-05-31 14:27 ` Matthew Wilcox
2024-05-31 14:32 ` David Hildenbrand
2024-06-25 22:33 ` Andrew Morton
2024-06-26 4:41 ` Sergey Senozhatsky
2024-06-26 5:08 ` David Hildenbrand [this message]
2024-05-29 11:19 ` [PATCH v2 4/6] mm/page_alloc: clear PageBuddy using __ClearPageBuddy() for bad pages David Hildenbrand
2024-05-29 11:19 ` [PATCH v2 5/6] mm/filemap: reinitialize folio->_mapcount directly David Hildenbrand
2024-05-29 11:19 ` [PATCH v2 6/6] mm/mm_init: initialize page->_mapcount directly in __init_single_page() David Hildenbrand
2024-05-30 5:02 ` [PATCH v2 0/6] mm: page_type, zsmalloc and page_mapcount_reset() Sergey Senozhatsky
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=96e0915c-e836-4413-81ea-37bbb6abba6b@redhat.com \
--to=david@redhat.com \
--cc=42.hyeyoo@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=minchan@kernel.org \
--cc=rppt@kernel.org \
--cc=senozhatsky@chromium.org \
--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