Thread (24 messages) 24 messages, 4 authors, 2021-01-27

Re: [PATCH v4 4/8] mm: Move immutable fields of 'struct vm_fault' into anonymous struct

From: Will Deacon <will@kernel.org>
Date: 2021-01-21 12:51:03
Also in: linux-mm, lkml

On Wed, Jan 20, 2021 at 10:13:37AM -0800, Nick Desaulniers wrote:
On Wed, Jan 20, 2021 at 9:36 AM Will Deacon [off-list ref] wrote:
quoted
'struct vm_fault' contains both information about the fault being
serviced alongside mutable fields contributing to the state of the
fault-handling logic. Unfortunately, the distinction between the two is
not clear-cut, and a number of callers end up manipulating the structure
temporarily before restoring it when returning.

Try to clean this up by moving the immutable fault information into an
anonymous struct, which will later be marked as 'const'. GCC will then
complain (with an error) about modification of these fields after they
have been initialised, although LLVM currently allows them without even
a warning:

https://bugs.llvm.org/show_bug.cgi?id=48755
I think this paragraph+link would be better on patch 8/8.
Agreed, I'll move it.

Will

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help