2022-09-30 02:35:33

by haoxin

[permalink] [raw]
Subject: [PATCH v3] x86/mm/tlb: update some comments in pte_flags_need_flush

There just changed the comment about 'flush_on_clear' check, which make
the explanation more reasonable.

Suggested-by: Nadav Amit <[email protected]>
Suggested-by: Randy Dunlap <[email protected]>
Signed-off-by: Xin Hao <[email protected]>
---

Changes from v2
(https://lore.kernel.org/lkml/[email protected]/)
- fix some comments suggested-by Nadav Amit <[email protected]> and
Randy Dunlap <[email protected]>

arch/x86/include/asm/tlbflush.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/tlbflush.h b/arch/x86/include/asm/tlbflush.h
index cda3118f3b27..2a17698fb194 100644
--- a/arch/x86/include/asm/tlbflush.h
+++ b/arch/x86/include/asm/tlbflush.h
@@ -291,8 +291,8 @@ static inline bool pte_flags_need_flush(unsigned long oldflags,
diff &= ~_PAGE_ACCESSED;

/*
- * Did any of the 'flush_on_clear' flags was clleared set from between
- * 'oldflags' and 'newflags'?
+ * Consider the 'flush_on_clear' flags that are set on 'oldflags',
+ * Flush if any of these flags is cleared on 'newflags'.
*/
if (diff & oldflags & flush_on_clear)
return true;
--
2.31.0


2022-09-30 03:21:28

by Randy Dunlap

[permalink] [raw]
Subject: Re: [PATCH v3] x86/mm/tlb: update some comments in pte_flags_need_flush



On 9/29/22 19:24, Xin Hao wrote:
> There just changed the comment about 'flush_on_clear' check, which make
> the explanation more reasonable.
>
> Suggested-by: Nadav Amit <[email protected]>
> Suggested-by: Randy Dunlap <[email protected]>
> Signed-off-by: Xin Hao <[email protected]>

Acked-by: Randy Dunlap <[email protected]>

Thanks.

> ---
>
> Changes from v2
> (https://lore.kernel.org/lkml/[email protected]/)
> - fix some comments suggested-by Nadav Amit <[email protected]> and
> Randy Dunlap <[email protected]>
>
> arch/x86/include/asm/tlbflush.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/include/asm/tlbflush.h b/arch/x86/include/asm/tlbflush.h
> index cda3118f3b27..2a17698fb194 100644
> --- a/arch/x86/include/asm/tlbflush.h
> +++ b/arch/x86/include/asm/tlbflush.h
> @@ -291,8 +291,8 @@ static inline bool pte_flags_need_flush(unsigned long oldflags,
> diff &= ~_PAGE_ACCESSED;
>
> /*
> - * Did any of the 'flush_on_clear' flags was clleared set from between
> - * 'oldflags' and 'newflags'?
> + * Consider the 'flush_on_clear' flags that are set on 'oldflags',
> + * Flush if any of these flags is cleared on 'newflags'.
> */
> if (diff & oldflags & flush_on_clear)
> return true;
> --
> 2.31.0

--
~Randy