NetBSD-Bugs archive

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

Re: kern/57558: pgdaemon 100% busy - no scanning (ZFS case)



On Thu, May 09, 2024 at 09:06:43PM +0200, Frank Kardel wrote:
> On 05/09/24 19:48, Chuck Silvers wrote:
> 
> > great, thanks for testing.
> > 
> > which other cases are you talking about?
> > 
> > -Chuck
> 
> The cases in the KVA nkmempages determination.
> 
> #if defined(NKMEMPAGES_MAX_UNLIMITED) && !defined(KMSAN)
>         /*
>          * The extra 1/9 here is to account for uvm_km_va_starved_p()
>          * wanting to keep 10% of kmem virtual space free.
>          * The intent is that on "unlimited" platforms we should be able
>          * to allocate all of physical memory as kmem without running short
>          * of kmem virtual space.
>          */
>         npages = (physmem * 10) / 9;
> #else
> 
> #if defined(KMSAN)
>         npages = (physmem / 4);
> #elif defined(PMAP_MAP_POOLPAGE)
>         npages = (physmem / 4);
> #else
>         npages = (physmem / 3) * 2;
> #endif /* defined(PMAP_MAP_POOLPAGE) */
> 
> #if !defined(NKMEMPAGES_MAX_UNLIMITED)
>         if (npages > NKMEMPAGES_MAX)
>                 npages = NKMEMPAGES_MAX;
> #endif
> 
> #endif
> 
>         if (npages < NKMEMPAGES_MIN)
>                 npages = NKMEMPAGES_MIN;
> 
>         nkmempages = npages;
> 
> defined(NKMEMPAGES_MAX_UNLIMITED) && !defined(KMSAN) is running fine now.
> 
> I wonder whether we could hit the starvation scenario where ZFS does not
> reclaim memory in time in the other cases as there nkmempages is set to
> a value less than physmem.
> 
> Just wondering.


all of the other cases (except for KMSAN) only exist in 32-bit kernels,
and I don't think that it's worthwhile to try to make ZFS work in a 32-bit kernel.

I have not thought about what to do for the combination of KMSAN and ZFS.
I guess I'm leaving that for a rainy day.

-Chuck


Home | Main Index | Thread Index | Old Index