Re: [PATCH for-4.8 V2 03/10] powerpc/mm/radix: Add radix_set_pte to use in early init

From
Michael Ellerman <mpe@ellerman.id.au>
Date
2016-07-25 08:33:49
Reply to
Nicholas Piggin, 2016-07-25
Nicholas Piggin [off-list ref] writes:
On Sat, 23 Jul 2016 14:42:36 +0530
"Aneesh Kumar K.V" [off-list ref] wrote:
quoted
@@ -102,7 +123,7 @@ int radix__map_kernel_page(unsigned long ea,
unsigned long pa, }
 
 set_the_pte:
-	set_pte_at(&init_mm, ea, ptep, pfn_pte(pa >> PAGE_SHIFT,
flags));
+	radix__set_pte(&init_mm, ea, ptep, pfn_pte(pa >> PAGE_SHIFT,
flags)); smp_wmb();
What we have in existing code is set_pte_at() function that adds
the _PAGE_PTE bit, then calls __set_pte_at(), which calls radix or hash
version of __set_pte_at().

Now we also have radix__set_pte(), which has the function of the
set_pte_at(), which is starting to confuse the naming convention.
The new function is a radix-only set_pte_at(), rather than the
radix implementation that gets called via set_pte().

set_pte_at_radix()? That kind of sucks too, though. It might be better
if the radix/hash variants were called __radix__set_pte_at(), and this
new function was called radix__set_pte_at().
I think Aneesh originally used set_pte_at_r() or maybe rset_pte_at()?

It was my idea to use radix__ and hash__ as prefixes for all the
radix/hash functions.

That was 1) to make it clear that it's not part of the name as such, ie.
it's a prefix, and 2) because it's ugly as hell and hopefully that would
motivate us to consolidate as many of them as possible.

I balked at adding __radix__set_pte_at(), and just went with
radix__set_pte_at(). But it does complicate things now.

In fact I think we need to rethink this whole series, and not actually
do it this way at all, meaning this naming problem will go away.

cheers
Thread (21 messages) 21 messages, 4 authors, last reply 2016-07-25
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help