Re: [PATCH v2 2/3] powerpc: get hugetlbpage handling more generic
From: Aneesh Kumar K.V <hidden>
Date: 2016-09-20 02:28:57
Also in:
lkml
christophe leroy [off-list ref] writes:
Le 19/09/2016 =C3=A0 07:50, Aneesh Kumar K.V a =C3=A9crit :quoted
Christophe Leroy [off-list ref] writes:quoted
+#else +static void hugepd_free(struct mmu_gather *tlb, void *hugepte) +{ + BUG(); +} + #endifI was expecting that BUG will get removed in the next patch. But I don't see it in the next patch. Considering@@ -475,11 +453,10 @@ static void free_hugepd_range(struct mmu_gather *t=
lb, hugepd_t *hpdp, int pdshif
quoted
for (i =3D 0; i < num_hugepd; i++, hpdp++) hpdp->pd =3D 0; -#ifdef CONFIG_PPC_FSL_BOOK3E - hugepd_free(tlb, hugepte); -#else - pgtable_free_tlb(tlb, hugepte, pdshift - shift); -#endif + if (shift >=3D pdshift) + hugepd_free(tlb, hugepte); + else + pgtable_free_tlb(tlb, hugepte, pdshift - shift); } What is that I am missing ?Previously, call to hugepd_free() was compiled only when #ifdef=20 CONFIG_PPC_FSL_BOOK3E Now, it is compiled at all time, but it should never be called if not=20 CONFIG_PPC_FSL_BOOK3E because we always have shift < pdshift in that case. Then the function needs to be defined anyway but should never be called.=
=20
Should I just define it static inline {} ?For 8M with 4K mode, we have shift >=3D pdshift right ? -aneesh