Re: [RFC 3/7] mm/vmalloc: Avoid cond_resched() when blocking is not permitted

Uladzislau Rezki
2025-07-08T12:29:17Z

On Mon, Jul 07, 2025 at 09:11:43AM +0200, Michal Hocko wrote:
> On Fri 04-07-25 17:25:33, Uladzislau Rezki wrote:
> > The vm_area_alloc_pages() function uses cond_resched() to yield the
> > CPU during potentially long-running loops. However, yielding should
> > only be done if the given GFP flags allow blocking.
> >
> > This patch avoids calling cond_resched() when the allocation context
> > is non-blocking(GFP_ATOMIC, GFP_NOWAIT).
>
> Do we even need those cond_resched calls? Both of them are called
> shortly after memory allocator which already yields CPU when allowed.
>
I think it can be just dropped.

--
Uladzislau Rezki