From owner-freebsd-fs@freebsd.org Wed Aug 17 07:18:51 2016 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1541BBB3D1 for ; Wed, 17 Aug 2016 07:18:51 +0000 (UTC) (envelope-from mgamsjager@gmail.com) Received: from mail-io0-x230.google.com (mail-io0-x230.google.com [IPv6:2607:f8b0:4001:c06::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7CA241EBA for ; Wed, 17 Aug 2016 07:18:51 +0000 (UTC) (envelope-from mgamsjager@gmail.com) Received: by mail-io0-x230.google.com with SMTP id q83so129090645iod.1 for ; Wed, 17 Aug 2016 00:18:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:cc; bh=x4WMCXJNByJ+2wnajUZDpldZMVbWJTAxjhdsCp+F8KA=; b=IDEBGyWxgEMGm7GnHUZyts679E6/oZR7rqknrzGDsr98OrH3r68LyJhvRPnH01pRK3 w2/MASgcj9/Pof9mPzeaY9s3hq7YdMRYlwX/6PMLkyPDpsMkF8BEvQU8pEZC7MwQTY0y RpWY8GzUthLlppKBtSLdcYWPb3bRoAd5ig85QcDX84MsGE2AspWeMXB4VIobAF9UhxG4 eBB4SoazqMpfoxYHKgrcBNDlXh8c1/hTnJ3SOrV8WLjq/HS6NC1U7kgLQ9+YVV18ZLSf vqwQD2TZ0PeKhUZG5gdPA8OQvKtkXTcOWciOGgFhs4ArUlYfGuPHmiBgo0dK6X+YWWuy MOUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:cc; bh=x4WMCXJNByJ+2wnajUZDpldZMVbWJTAxjhdsCp+F8KA=; b=EMqksGdE/o3vcmdwjA/qhVEf9KIpazsMW7jtwXd3LJWACuWNZyHwxc48QtL18T36Ba TU5qBhIAGXQetJcTLec8pDTJI6EpnMEG/82F6qbUeC3G3Gydec9cPvcIExTfLbXJGFIm f4SrCpTtVsLwbE0UjOlXE4e9I5F9xRd1nFTH+CNUjjPKqVTVjnj9nx6erdHJiPevAVVj KLth+C8uowmxFL7fVb1dJeeYcxRiVEYptZAba7rsGjNJhBD7v1NjbF/0Dlzqt48kqql4 77AbQ00+K6rNejkgRi2j+HqBpyazL6py4h/qiKmpwMkgpu4lrch3JsZhZ57AlxGN01u3 uezQ== X-Gm-Message-State: AEkoouuzKdXx0R/iYtLQXxfo0/EWscY0JiZH4r37fxz+oIbsJN0UXi+w0aogSkrDQHMHNcHxdc0daoeCcKrz3A== X-Received: by 10.107.139.8 with SMTP id n8mr44439153iod.96.1471418330671; Wed, 17 Aug 2016 00:18:50 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.63.197 with HTTP; Wed, 17 Aug 2016 00:18:20 -0700 (PDT) In-Reply-To: <20160816193416.GM8192@zxy.spb.ru> References: <20160816193416.GM8192@zxy.spb.ru> From: Matthias Gamsjager Date: Wed, 17 Aug 2016 09:18:20 +0200 Message-ID: Subject: Re: ZFS ARC under memory pressure Cc: freebsd-fs@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Aug 2016 07:18:51 -0000 On 16 August 2016 at 21: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? > _______________________________________________ > What version are you on?