From owner-freebsd-current@FreeBSD.ORG Mon Jul 2 15:04:34 2012 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B0562106564A; Mon, 2 Jul 2012 15:04:34 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 8871E8FC14; Mon, 2 Jul 2012 15:04:34 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id F2EC3B960; Mon, 2 Jul 2012 11:04:33 -0400 (EDT) From: John Baldwin To: freebsd-current@freebsd.org Date: Mon, 2 Jul 2012 10:36:45 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <7BEE3948-EE35-48C2-B4B1-25E34087A4C4@lists.zabbadoz.net> In-Reply-To: <7BEE3948-EE35-48C2-B4B1-25E34087A4C4@lists.zabbadoz.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201207021036.45567.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 02 Jul 2012 11:04:34 -0400 (EDT) Cc: "Bjoern A. Zeeb" , current@freebsd.org Subject: Re: swp_pager_meta_build DoS printf X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jul 2012 15:04:34 -0000 On Sunday, July 01, 2012 8:23:31 am Bjoern A. Zeeb wrote: > Hey, > > hitting this printf in swp_pager_meta_build() > > if (uma_zone_exhausted(swap_zone)) { > printf("swap zone exhausted, increase kern.maxswzone\n"); > vm_pageout_oom(VM_OOM_SWAPZ); > pause("swzonex", 10); > } else > > seems to be an effective way to put the machine into a state of no recovery > unless the memory situation would be able to clear itself. Not that it wouldn't > otherwise be any better but in addition having a couple of tenthousands of these > going to console as well is really not helpful to try to do anything either. Can > we make it a log() call or something? > > /bz > > PS: I am not sure as I have seen it on someone else's machines and it's > probably been ZFS that caused it. I unfortunately neither had a way to > get back in or break to a kernel debugger, so information is sparse. This used to be a silent deadlock before I added the printf() and the call to OOM. :-P Do you just want to ratelimit the printf? We have an API to ratelimit printf's already. -- John Baldwin