[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <12bb3414-2ca8-4384-80e5-81889f2bd35f@redhat.com>
Date: Tue, 2 Sep 2025 10:11:04 +0200
From: David Hildenbrand <david@...hat.com>
To: Max Kellermann <max.kellermann@...os.com>, akpm@...ux-foundation.org,
axelrasmussen@...gle.com, yuanchu@...gle.com, willy@...radead.org,
hughd@...gle.com, mhocko@...e.com, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, lorenzo.stoakes@...cle.com, Liam.Howlett@...cle.com,
vbabka@...e.cz, rppt@...nel.org, surenb@...gle.com, vishal.moola@...il.com,
linux@...linux.org.uk, James.Bottomley@...senPartnership.com, deller@....de,
agordeev@...ux.ibm.com, gerald.schaefer@...ux.ibm.com, hca@...ux.ibm.com,
gor@...ux.ibm.com, borntraeger@...ux.ibm.com, svens@...ux.ibm.com,
davem@...emloft.net, andreas@...sler.com, dave.hansen@...ux.intel.com,
luto@...nel.org, peterz@...radead.org, tglx@...utronix.de, mingo@...hat.com,
bp@...en8.de, x86@...nel.org, hpa@...or.com, chris@...kel.net,
jcmvbkbc@...il.com, viro@...iv.linux.org.uk, brauner@...nel.org,
jack@...e.cz, weixugc@...gle.com, baolin.wang@...ux.alibaba.com,
rientjes@...gle.com, shakeel.butt@...ux.dev, thuth@...hat.com,
broonie@...nel.org, osalvador@...e.de, jfalempe@...hat.com,
mpe@...erman.id.au, nysal@...ux.ibm.com,
linux-arm-kernel@...ts.infradead.org, linux-parisc@...r.kernel.org,
linux-s390@...r.kernel.org, sparclinux@...r.kernel.org,
linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH v6 12/12] mm: constify highmem related functions for
improved const-correctness
On 01.09.25 22:50, Max Kellermann wrote:
> Lots of functions in mm/highmem.c do not write to the given pointers
> and do not call functions that take non-const pointers and can
> therefore be constified.
>
> This includes functions like kunmap() which might be implemented in a
> way that writes to the pointer (e.g. to update reference counters or
> mapping fields), but currently are not.
>
> kmap() on the other hand cannot be made const because it calls
> set_page_address() which is non-const in some
> architectures/configurations.
Right, we store the address in page->virtual.
It's interesting that kumap() won't set that field to NULL. That seems
to happen in flush_all_zero_pkmaps(). And we seem to flush during kmap()
in case we have to empty slots.
Acked-by: David Hildenbrand <david@...hat.com>
--
Cheers
David / dhildenb
Powered by blists - more mailing lists