Le 20/09/2016 à 04:28, Aneesh Kumar K.V a écrit :
christophe leroy <christophe.le...@c-s.fr> writes:

Le 19/09/2016 à 07:50, Aneesh Kumar K.V a écrit :

Christophe Leroy <christophe.le...@c-s.fr> writes:
+static void hugepd_free(struct mmu_gather *tlb, void *hugepte)
+       BUG();

I 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 *tlb, 
hugepd_t *hpdp, int pdshif
        for (i = 0; i < num_hugepd; i++, hpdp++)
                hpdp->pd = 0;

-       hugepd_free(tlb, hugepte);
-       pgtable_free_tlb(tlb, hugepte, pdshift - shift);
+       if (shift >= 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
Now, it is compiled at all time, but it should never be called if not
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.
Should I just define it static inline {} ?

For 8M with 4K mode, we have shift >= pdshift right ?

Yes, thats the reason why in the following patch we get. That way we get a real hugepd_free() also for the 8xx.

@@ -366,7 +373,7 @@ int alloc_bootmem_huge_page(struct hstate *hstate)

+#if defined(CONFIG_PPC_FSL_BOOK3E) || defined(CONFIG_PPC_8xx)
        ((PAGE_SIZE - sizeof(struct hugepd_freelist)) / sizeof(pte_t))


Reply via email to