From owner-freebsd-stable@FreeBSD.ORG Wed Apr 8 16:15:16 2015 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BE3FEC59; Wed, 8 Apr 2015 16:15:16 +0000 (UTC) Received: from mail-ob0-x22d.google.com (mail-ob0-x22d.google.com [IPv6:2607:f8b0:4003:c01::22d]) (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 87B8BFBF; Wed, 8 Apr 2015 16:15:16 +0000 (UTC) Received: by obbfy7 with SMTP id fy7so145513121obb.2; Wed, 08 Apr 2015 09:15:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=TDpjwGGcPcobfZ+ZyWFBJotWSuBT7CMsjJdRtI/4voo=; b=aK1eTEYJ4eClhB6oXU1U4sAL2QfBBfByOaOShVy9RtSjIJxaTgSYs9e6zPkd9VoGCL YIVOyzabm2s2rHMLolTrqmHBLevSkTFMUpTeQqO3omKVHrZKDihyeLu5koJHqP7OL224 57hNQN2j0GWZQk/iUTDGUxKBUQ/qBr+tTik2G+lg9rrS5VrtGBNtbss32YAgHPFIbndH Pi/q5FiMgdVVUOyxQ6whDGTyvCovnUW0c+/B+yFtc5z2/LdUMcvZVDPTIIG8PjtfqXT/ 1Y/nQpk+PLxfrTY6Y/FskhvOq00bHarS76J9G/qBFDdpSPnhra87cIUWDY1gEh49bRkp 6wCQ== MIME-Version: 1.0 X-Received: by 10.60.44.241 with SMTP id h17mr6320055oem.71.1428509701489; Wed, 08 Apr 2015 09:15:01 -0700 (PDT) Sender: asomers@gmail.com Received: by 10.202.215.7 with HTTP; Wed, 8 Apr 2015 09:15:01 -0700 (PDT) In-Reply-To: References: Date: Wed, 8 Apr 2015 10:15:01 -0600 X-Google-Sender-Auth: Y7K-IsxFppbXhZ-HG9L0ZMK3Dds Message-ID: Subject: Re: FreeBSD/ZFS on 9.3-RELEASE chews up memory with "wide" directories when calling readdir, etc; causes trap 12 panics From: Alan Somers To: Garrett Cooper Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-fs , freebsd-stable X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2015 16:15:16 -0000 On Tue, Apr 7, 2015 at 12:37 AM, Garrett Cooper wro= te: > Hi, > Long story short, I had a lot of mail spooled up in /var/spool. W= hen I did ls /var/spool, ZFS chewed up almost all 12GB of my memory in <10 = mins (because there were enough files there) and the system eventually pani= cked because [I assume that a memory allocation failed and] a trap 12 panic= was caught. I don=E2=80=99t have the exact details, but it should be relat= ively easy to repro (YMMV if you have a boatload of RAM): > > repro_end=3D10000000000 > for i in $(seq 1 $repro_end); do mktemp tmp.XXXXXXXXXXXX; done > ls > > This might be ameliorated via r281026, but this change is only av= ailable in CURRENT (so far), and I haven=E2=80=99t tested it. > Are there any comments about this scalability issue with FreeBSD/= ZFS? > Thanks, I spent the last ~ 24 hours creating 58,567,635 empty files in one directory. I can ls it without crashing on a machine with 32 GB RAM. # /usr/bin/time -l ls /tmp/tmp | wc 1061.21 real 225.54 user 36.61 sys 9720268 maximum resident set size 28 average shared memory size 8 average unshared data size 128 average unshared stack size 2425013 page reclaims 0 page faults 0 swaps 108036 block input operations 0 block output operations 0 messages sent 0 messages received 0 signals received 108004 voluntary context switches 2428 involuntary context switches 58567635 58567635 644243985 -Alan