> >Hmmm, so there is lots of evictable cache here (mostly in the MFU
> >part of the cache)... could you make your core file available?
> >I would like to take a look at it.
> 
> Isn't this just like:
> 6493923 nfsfind on ZFS filesystem quickly depletes memory in a 1GB system
> 
> Which was introduced in b51(or 52) and fixed in snv_54.

Hmm, or like:
6483887 without direct management, arc ghost lists can run amok
(which isn't fixed at this time)

See also this thread:
http://www.opensolaris.org/jive/thread.jspa?messageID=67370

Mark had send me some test bits with a modified arc.c; it tried to
evict ghost list entries when the arc cache is in no_grow state
and the arc ghost lists consume too much memory.

The main change was a new function arc_buf_hdr_alloc(), in arc.c
that shrinks the ghost lists when the system is running out
of memory:

static arc_buf_hdr_t *
arc_buf_hdr_alloc(spa_t *spa, int size)
{
        arc_buf_hdr_t *hdr;

        if (arc.no_grow && arc.mru_ghost->size + arc.mfu_ghost->size > arc.c) {
                int64_t mru_over = arc.anon->size + arc.mru->size +
                    arc.mru_ghost->size - arc.c;

                if (mru_over > 0 && arc.mru_ghost->size > 0) {
                        int64_t todelete = MIN(arc.mru_ghost->lsize, mru_over);
                        arc_evict_ghost(arc.mru_ghost, todelete);
                } else {
                        int64_t todelete = MIN(arc.mfu_ghost->lsize,
                            arc.mru_ghost->size + arc.mfu_ghost->size - arc.c);
                        arc_evict_ghost(arc.mfu_ghost, todelete);
                }
        }

        ASSERT3U(size, >, 0);
        hdr = kmem_cache_alloc(hdr_cache, KM_SLEEP);
        ASSERT(BUF_EMPTY(hdr));
        hdr->b_size = size;
        hdr->b_spa = spa;
        hdr->b_state = arc.anon;
        hdr->b_arc_access = 0;
        hdr->b_flags = 0;
        return (hdr);
}



This was then used by arc_buf_alloc():

arc_buf_t *
arc_buf_alloc(spa_t *spa, int size, void *tag)
{
        arc_buf_hdr_t *hdr;
        arc_buf_t *buf;

        hdr = arc_buf_hdr_alloc(spa, size);
        buf = kmem_cache_alloc(buf_cache, KM_SLEEP);
        buf->b_hdr = hdr;
...
        return (buf);
}
 
 
This message posted from opensolaris.org
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to