Skip to contentSkip to conversation

pte_alloc_kernel parameters

DISCUSSION Jan Beulich 2 participants 2 messages Dec 15, 2005 – Dec 16, 2005

lore
Share & tools
lore
#0 lore raw

Is there any particular reason why pte_alloc_kernel() has to have 'struct mm_struct*' as its first parameter? Except for a case in parisc (where NULL gets passed) and another (ill-looking one) in arm26 it is always &init_mm, and since the function is not inline the compiler can't eliminate the needless passing of the argument.

Thanks, Jan

#1 lore raw
Quoted 5 lines · Jan Beulich

Is there any particular reason why pte_alloc_kernel() has to have 'struct mm_struct*' as its first parameter? Except for a case in parisc (where NULL gets passed) and another (ill-looking one) in arm26 it is always &init_mm, and since the function is not inline the compiler can't eliminate the needless passing of the argument.

You're looking at old source: it's gone in 2.6.15-rc. There was a point to it before 2.6.13 - arch/ppc64 used it on its ioremap_mm too, but has since amalgamated that into init_mm. I removed the arg in 2.6.15-rc, not really as an optimization, more to force a build error on mismatch when making a change to the locking there.

Hugh