On Thu 25-03-21 11:17:32, Oscar Salvador wrote: > On Thu, Mar 25, 2021 at 11:11:49AM +0100, Michal Hocko wrote: > > I have overlooked that > > +static void cma_clear_bitmap_fn(struct work_struct *work) > > +{ > > + struct cma_clear_bitmap_work *w; > > + > > + w = container_of(work, struct cma_clear_bitmap_work, work); > > + > > + cma_clear_bitmap(w->cma, w->pfn, w->count); > > + > > + __free_page(pfn_to_page(w->pfn)); > > +} > > > > should be doing free_contig_range with w->count target. > > That is currently done in cma_release_nowait(). > You meant we should move that work there in the wq? I have missed that part. My bad. But it seems this whole thing is moot because we can make the lock a spinlock as pointed out by David. -- Michal Hocko SUSE Labs