lkml.org 
[lkml]   [2022]   [Sep]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -next] memregion: Add arch_flush_memregion() interface
Andrew Morton wrote:
> I really dislike the term "flush". Sometimes it means writeback,
> sometimes it means invalidate. Perhaps at other times it means
> both.
>
> Can we please be very clear in comments and changelogs about exactly
> what this "flush" does. With bonus points for being more specific in the
> function naming?
>

That's a good point, "flush" has been cargo-culted along in Linux's
cache management APIs to mean write-back-and-invalidate. In this case I
think this API is purely about invalidate. It just so happens that x86
has not historically had a global invalidate instruction readily
available which leads to the overuse of wbinvd.

It would be nice to make clear that this API is purely about
invalidating any data cached for a physical address impacted by address
space management event (secure erase / new region provision). Write-back
is an unnecessary side-effect.

So how about:

s/arch_flush_memregion/cpu_cache_invalidate_memregion/?

\
 
 \ /
  Last update: 2022-09-08 03:08    [W:0.359 / U:1.488 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site