Re: [PATCH 7/7] mm/page_alloc: Replace local_lock with normal spinlock

Yu Zhao
2022-06-15T22:43:44Z

On Mon, Jun 13, 2022 at 8:54 AM Mel Gorman <mgorman@techsingularity.net> wrote:
...

> +#define pcpu_spin_trylock_irqsave(type, member, ptr, flags) \
> +({ \
> + type *_ret; \
> + pcpu_task_pin(); \
> + _ret = this_cpu_ptr(ptr); \
> + if (!spin_trylock_irqsave(&_ret->member, flags)) \
> + _ret = NULL; \

I'm getting "BUG: sleeping function called from invalid context" with
mm-everything-2022-06-14-19-05.

Perhaps missing a pcpu_task_unpin() here?

> + _ret; \
> +})