Re: [RFC PATCH 6/8] hugetlb: make free_huge_page irq safe

Michal Hocko
2021-03-22T14:36:29Z

On Fri 19-03-21 15:42:07, Mike Kravetz wrote:
> Commit c77c0a8ac4c5 ("mm/hugetlb: defer freeing of huge pages if in
> non-task context") was added to address the issue of free_huge_page
> being called from irq context. That commit hands off free_huge_page
> processing to a workqueue if !in_task. However, as seen in [1] this
> does not cover all cases. Instead, make the locks taken in the
> free_huge_page irq safe.
>
> This patch does the following:
> - Make hugetlb_lock irq safe. This is mostly a simple process of
> changing spin_*lock calls to spin_*lock_irq* calls.
> - Make subpool lock irq safe in a similar manner.
> - Revert the !in_task check and workqueue handoff.

This is not sufficient (and 0day bot has captured that already). You
cannot call update_and_free_page from the same context.

--
Michal Hocko
SUSE Labs