Re: + dma-pool-do-not-complain-if-dma-pool-is-not-allocated.patch added to mm-hotfixes-unstable branch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat 13-08-22 08:29:13, Christoph Hellwig wrote:
> On Thu, Aug 11, 2022 at 11:51:19AM +0200, Michal Hocko wrote:
> > this will not consider any gaps in the zone. We have zone_managed_pages
> > which tells you how many pages there are in the zone which have been
> > provided to the page allocator which seems like something that would fit
> > better. And it is also much better than basing it on the global amount
> > of memory which just doesn't make much sens for constrained zones
> 
> Yes, that is a much better helper.
> 
> > Except that it will not work for this case as
> > +static unsigned long calculate_pool_size(unsigned long zone_pages)
> > +{
> > +       unsigned long nr_pages = min_t(unsigned long,
> > +                                      zone_pages / (SZ_1G / SZ_128K),
> > +                                      MAX_ORDER_NR_PAGES);
> > +
> > +       return max_t(unsigned long, nr_pages << PAGE_SHIFT, SZ_128K);
> > +}
> > 
> > this will return 128kB, correct?
> 
> Yes.
> 
> > The DMA zone still has 126kB of usable memory. I think what you
> > want/need to do something like
> 
> No.  If you don't have 128k free you have another bug and we really
> should warn here.  Please go back to that system and figure out what
> uses up almost all of ZONE_DMA on that system, because we have another
> big problem there.

I do agree that such a large consumption from the DMA zone is unusual. I
have reached out to the original reporter and ask for help to
investigate more. Let's see whether we can get something out of that.
This can really reveal some DMA zone abuser.

Anyway, you seem to be not thrilled about the __GFP_NOWARN approach and
I won't push it. But is the existing inconsistency really desirable? I
mean we can get pretty vocal warning if the allocation fails but no
information when the zone doesn't have any managed memory. Why should we
treat them differently? 
-- 
Michal Hocko
SUSE Labs



[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux