Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Aug 2016 23:26:57 +0300
From:      Slawa Olhovchenkov <slw@zxy.spb.ru>
To:        Andriy Gapon <avg@FreeBSD.org>
Cc:        freebsd-fs@FreeBSD.org, Alexander Motin <mav@FreeBSD.org>
Subject:   Re: ZFS ARC under memory pressure
Message-ID:  <20160818202657.GS8192@zxy.spb.ru>
In-Reply-To: <8dbf2a3a-da64-f7f8-5463-bfa23462446e@FreeBSD.org>
References:  <20160816193416.GM8192@zxy.spb.ru> <8dbf2a3a-da64-f7f8-5463-bfa23462446e@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Aug 18, 2016 at 11:00:28PM +0300, Andriy Gapon wrote:

> On 16/08/2016 22:34, Slawa Olhovchenkov wrote:
> > I see issuses with ZFS ARC inder memory pressure.
> > ZFS ARC size can be dramaticaly reduced, up to arc_min.
> > 
> > As I see memory pressure event cause call arc_lowmem and set needfree:
> > 
> > arc.c:arc_lowmem
> > 
> >         needfree = btoc(arc_c >> arc_shrink_shift);
> > 
> > After this, arc_available_memory return negative vaules (PAGESIZE *
> > (-needfree)) until needfree is zero. Independent how too much memory
> > freed. needfree set to 0 in arc_reclaim_thread(), when arc_size <=
> > arc_c. Until arc_size don't drop below arc_c (arc_c deceased at every
> > loop interation).
> > 
> > arc_c droped to minimum value if arc_size fast enough droped.
> > 
> > No control current to initial memory allocation.
> > 
> > As result, I can see needless arc reclaim, from 10x to 100x times.
> > 
> > Can some one check me and comment this?
> 
> You might have found a real problem here, but I am short of time right now to
> properly analyze the issue.  I think that on illumos 'needfree' is a variable
> that's managed by the virtual memory system and it is akin to our
> vm_pageout_deficit.  But during the porting it became an artificial value and
> its handling might be sub-optimal.

As I see, totaly not optimal.
I am create some patch for sub-optimal handling and now test it.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160818202657.GS8192>