From owner-freebsd-stable@FreeBSD.ORG Mon Sep 7 09:37:27 2009 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2BE6E1065670; Mon, 7 Sep 2009 09:37:27 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-bw0-f206.google.com (mail-bw0-f206.google.com [209.85.218.206]) by mx1.freebsd.org (Postfix) with ESMTP id 75AD18FC14; Mon, 7 Sep 2009 09:37:26 +0000 (UTC) Received: by bwz2 with SMTP id 2so243308bwz.43 for ; Mon, 07 Sep 2009 02:37:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=B3hir2z9ETfG8nqQUASiCmuZH2wm+79iNdqfr0lZ4WE=; b=pzgxS2JTB5VRHom2bdpzcZE9v1BObTIhjCcF+zyfZOTzhIPz7PtuiTRopoM2onwgyG 3WS85ruKna55k36wpGP9Aex2m/FFum3ldUdS6jOsfjllj7wwT20Lt8YNj9rdmi4vHHat 9rZD6R6QsL2e3qEELFmufLCft+emCBSPwQtCs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=omTT4qUy8jJc6G4F7e4e9F+hM+KlyHIsuXxRAFMIMhusKYNjtXM/yY751iKlbcWDYR ZcZU/0lQ2TutRAVWknt8I/E4Y7xdBIh1VtyIAyjzFV/h5qq1CUef7wUsnNfq0TRgLFMq ZpeuHAw/iGHCezdbsDuWimGWRvAbiFMwoa30k= MIME-Version: 1.0 Received: by 10.204.26.150 with SMTP id e22mr11957784bkc.68.1252316245452; Mon, 07 Sep 2009 02:37:25 -0700 (PDT) In-Reply-To: <200908141122.n7EBM9ml032712@svn.freebsd.org> References: <200908141122.n7EBM9ml032712@svn.freebsd.org> Date: Mon, 7 Sep 2009 13:37:25 +0400 Message-ID: From: pluknet To: Konstantin Belousov Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-stable Subject: Re: svn commit: r196210 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/ata dev/cxgb dev/sound/usb dev/usb dev/usb/controller dev/usb/input dev/usb/mis... X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2009 09:37:27 -0000 2009/8/14 Konstantin Belousov : > Author: kib > Date: Fri Aug 14 11:22:09 2009 > New Revision: 196210 > URL: http://svn.freebsd.org/changeset/base/196210 > > Log: > =A0MFC r196206: > =A0Take the number of allocated freeblks into consideration for > =A0softdep_slowdown(), to prevent kernel memory exhaustioni on > =A0mass-truncation. > > =A0Approved by: =A0re (rwatson) > [...] Hi. Is it scheduled to be merged to stable/7 (and even to stable/6, which also has this issue)? Thanks. > Modified: stable/8/sys/ufs/ffs/ffs_softdep.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- stable/8/sys/ufs/ffs/ffs_softdep.c =A0Fri Aug 14 11:17:34 2009 =A0 = =A0 =A0 =A0(r196209) > +++ stable/8/sys/ufs/ffs/ffs_softdep.c =A0Fri Aug 14 11:22:09 2009 =A0 = =A0 =A0 =A0(r196210) > @@ -663,6 +663,8 @@ static int req_clear_inodedeps; =A0 =A0 /* synce > =A0static int req_clear_remove; =A0 /* syncer process flush some freeblks= */ > =A0#define FLUSH_REMOVE =A0 =A0 =A0 =A0 =A0 2 > =A0#define FLUSH_REMOVE_WAIT =A0 =A0 =A03 > +static long num_freeblkdep; =A0 =A0/* number of freeblks workitems alloc= ated */ > + > =A0/* > =A0* runtime statistics > =A0*/ > @@ -2223,6 +2225,9 @@ softdep_setup_freeblocks(ip, length, fla > =A0 =A0 =A0 =A0freeblks->fb_uid =3D ip->i_uid; > =A0 =A0 =A0 =A0freeblks->fb_previousinum =3D ip->i_number; > =A0 =A0 =A0 =A0freeblks->fb_devvp =3D ip->i_devvp; > + =A0 =A0 =A0 ACQUIRE_LOCK(&lk); > + =A0 =A0 =A0 num_freeblkdep++; > + =A0 =A0 =A0 FREE_LOCK(&lk); > =A0 =A0 =A0 =A0extblocks =3D 0; > =A0 =A0 =A0 =A0if (fs->fs_magic =3D=3D FS_UFS2_MAGIC) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0extblocks =3D btodb(fragroundup(fs, ip->i_= din2->di_extsize)); > @@ -2815,6 +2820,7 @@ handle_workitem_freeblocks(freeblks, fla > > =A0 =A0 =A0 =A0ACQUIRE_LOCK(&lk); > =A0 =A0 =A0 =A0WORKITEM_FREE(freeblks, D_FREEBLKS); > + =A0 =A0 =A0 num_freeblkdep--; > =A0 =A0 =A0 =A0FREE_LOCK(&lk); > =A0} > > @@ -5768,7 +5774,8 @@ softdep_slowdown(vp) > =A0 =A0 =A0 =A0max_softdeps_hard =3D max_softdeps * 11 / 10; > =A0 =A0 =A0 =A0if (num_dirrem < max_softdeps_hard / 2 && > =A0 =A0 =A0 =A0 =A0 =A0num_inodedep < max_softdeps_hard && > - =A0 =A0 =A0 =A0 =A0 VFSTOUFS(vp->v_mount)->um_numindirdeps < maxindirde= ps) { > + =A0 =A0 =A0 =A0 =A0 VFSTOUFS(vp->v_mount)->um_numindirdeps < maxindirde= ps && > + =A0 =A0 =A0 =A0 =A0 num_freeblkdep < max_softdeps_hard) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0FREE_LOCK(&lk); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return (0); > =A0 =A0 =A0 =A0} --=20 wbr, pluknet