From owner-freebsd-current@FreeBSD.ORG Tue Aug 28 19:35:46 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 5F263106566B; Tue, 28 Aug 2012 19:35:45 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh11.mail.rice.edu (mh11.mail.rice.edu [128.42.199.30]) by mx1.freebsd.org (Postfix) with ESMTP id 284838FC0A; Tue, 28 Aug 2012 19:35:44 +0000 (UTC) Received: from mh11.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh11.mail.rice.edu (Postfix) with ESMTP id 3F39D4C0644; Tue, 28 Aug 2012 14:35:44 -0500 (CDT) Received: from mh11.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh11.mail.rice.edu (Postfix) with ESMTP id 3DCFB4C061D; Tue, 28 Aug 2012 14:35:44 -0500 (CDT) X-Virus-Scanned: by amavis-2.7.0 at mh11.mail.rice.edu, auth channel Received: from mh11.mail.rice.edu ([127.0.0.1]) by mh11.mail.rice.edu (mh11.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id IQrFtmgzzFQW; Tue, 28 Aug 2012 14:35:44 -0500 (CDT) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh11.mail.rice.edu (Postfix) with ESMTPSA id D22494C0580; Tue, 28 Aug 2012 14:35:43 -0500 (CDT) Message-ID: <503D1D8E.3020601@rice.edu> Date: Tue, 28 Aug 2012 14:35:42 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:8.0) Gecko/20111113 Thunderbird/8.0 MIME-Version: 1.0 To: Luigi Rizzo References: <20120823163145.GA3999@onelab2.iet.unipi.it> <50366398.2070700@rice.edu> <20120823174504.GB4820@onelab2.iet.unipi.it> <50371485.1020409@rice.edu> <20120824145708.GA16557@onelab2.iet.unipi.it> <5037A803.6030100@rice.edu> <20120824165428.GA17495@onelab2.iet.unipi.it> <5037B226.3000103@rice.edu> <20120826171126.GA40672@onelab2.iet.unipi.it> <503B24E4.6090701@rice.edu> <20120827113942.GA51298@onelab2.iet.unipi.it> In-Reply-To: <20120827113942.GA51298@onelab2.iet.unipi.it> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: alc@freebsd.org, current@freebsd.org Subject: Re: less aggressive contigmalloc ? 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: Tue, 28 Aug 2012 19:35:46 -0000 On 08/27/2012 06:39, Luigi Rizzo wrote: > On Mon, Aug 27, 2012 at 02:42:28AM -0500, Alan Cox wrote: > ... >>> this is dmesg when I add kdb_backtrace() at the start of vm_pageout_oom() >>> The '... netmap_finalize_obj_allocator... are from my calls to >>> contigmalloc, each one doing one-page allocations. >> These calls are made with M_WAITOK? > no they are with M_NOWAIT: > > ... > clust = contigmalloc(p->_clustsize, M_NETMAP, M_NOWAIT | M_ZERO, > 0, -1UL, PAGE_SIZE, 0); > ... > > p->_clustsize is 4096 in this particular set of calls. If M_NOWAIT is passed to contigmalloc(), then there is no call path by which contigmalloc() or any function that it calls would call vm_pageout_oom(). contigmalloc() may, however, wake the page daemon if the free page queues become sufficiently depleted. >>> I get 7-8 'KDB: stack backtrace' blocks, then allocations >>> restart successfully, then more failures... >>> The reference to fork_exit() does not seem right, because i am >>> in a block where i call contigmalloc, so the caller of >>> vm_pageout_grow_cache() should be kmem_alloc_contig(). >> Try this instead. At the start of vm_pageout_oom(), print the value of >> its parameter "shortage". That will uniquely identify the caller. > it says "shortage is 1" which means that the call is from vm_pageout(). Yes. I'm afraid that you're simply running short of memory. There's nothing particular to contigmalloc() happening here. Anything that allocated and wired the same amount of physical memory would have the same effect. However, if you're confident that the machine really has sufficient memory to support what you're trying to run, then you could tinker with the page daemon's targets for free pages. Alan