[PATCH v9 5/7] powerpc/tlb: Add local flush for page given mm_struct and psize

Benjamin Gray bgray at linux.ibm.com
Mon Nov 7 17:58:25 AEDT 2022


On Thu, 2022-11-03 at 11:39 +1100, Benjamin Gray wrote:
> On Wed, 2022-11-02 at 09:56 +0000, Christophe Leroy wrote:
> > By the way, 'extern' keyword is pointless and deprecated for
> > functions 
> > prototypes, please don't add new ones, even if other historical 
> > prototypes have one.
> 
> This and the above commented parts match the style of the surrounding
> implementations. For example,
> 
>         static inline void local_flush_tlb_mm(struct mm_struct *mm)
>         {
>                 if (radix_enabled())
>                         return radix__local_flush_tlb_mm(mm);
>                 return hash__local_flush_tlb_mm(mm);
>         }
> 
> I am not going to add code that is inconsistent with the surrounding
> code. That just causes confusion later down the line when readers
> wonder why this function is special compared to the others. If it
> needs
> to use modern style, then I would be happy to include a patch that
> modernises the surrounding code first.
> 
> Though why the hash__* functions are empty I'm not sure... If they
> were
> not implemented I would have expected a BUILD_BUG(). If they are
> unnecessary due to hash itself, it's odd that they exist (as you
> point
> out for the new one).

>From what I can see in the history, the empty hash functions were
originally introduced as 64-bit compatibility definitions for the hash
MMU (which I guess doesn't require any action). These empty functions
were shuffled around, then eventually prefixed with hash__* to make way
for the radix variants, which are hidden behind a generic
'local_flush_tlb_mm' etc. implementation as we see today. So basically,
the empty hash__* functions no longer (never, really) served a purpose
once the generic wrapper was added. I'll add a patch to delete them and
clean up the return voids.


More information about the Linuxppc-dev mailing list