[PATCH -V2] powerpc: thp: Fix crash on mremap
Benjamin Herrenschmidt
benh at kernel.crashing.org
Thu Jan 2 23:29:46 EST 2014
On Thu, 2014-01-02 at 16:22 +0530, Aneesh Kumar K.V wrote:
> > Just use config option directly:
> >
> > if (new_ptl != old_ptl ||
> > IS_ENABLED(CONFIG_ARCH_THP_MOVE_PMD_ALWAYS_WITHDRAW))
>
>
> I didn't like that. I found the earlier one easier for reading.
> If you and others strongly feel about this, I can redo the patch.
> Please let me know
Yes, use IS_ENABLED, no need to have two indirections of #define's
Another option is to have
if (pmd_move_must_withdraw(new,old)) {
}
With in a generic header:
#ifndef pmd_move_must_withdraw
static inline bool pmd_move_must_withdraw(spinlock_t *new_ptl, ...)
{
return new_ptl != old_ptl;
}
#endif
And in powerpc:
static inline bool pmd_move_must_withdraw(spinlock_t *new_ptl, ...)
{
return true;
}
#define pmd_move_must_withdraw pmd_move_must_withdraw
Cheers,
Ben.
More information about the Linuxppc-dev
mailing list