From owner-freebsd-current@FreeBSD.ORG Fri Jan 4 12:45:38 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4DA716A419; Fri, 4 Jan 2008 12:45:38 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 6B22213C458; Fri, 4 Jan 2008 12:45:38 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (localhost [127.0.0.1]) by spam.des.no (Postfix) with ESMTP id 4FFB420BE; Fri, 4 Jan 2008 13:45:30 +0100 (CET) X-Spam-Tests: AWL X-Spam-Learn: disabled X-Spam-Score: -0.2/3.0 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on tim.des.no Received: from ds4.des.no (des.no [80.203.243.180]) by smtp.des.no (Postfix) with ESMTP id 2AC0020BD; Fri, 4 Jan 2008 13:45:30 +0100 (CET) Received: by ds4.des.no (Postfix, from userid 1001) id 04399844CD; Fri, 4 Jan 2008 13:45:30 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: "Igor Mozolevsky" References: <477C82F0.5060809@freebsd.org> <863ateemw2.fsf@ds4.des.no> <20080104002002.L30578@fledge.watson.org> <86bq81c12d.fsf@ds4.des.no> Date: Fri, 04 Jan 2008 13:45:29 +0100 In-Reply-To: (Igor Mozolevsky's message of "Fri\, 4 Jan 2008 11\:18\:05 +0000") Message-ID: <86myrlahee.fsf@ds4.des.no> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.1 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-current@freebsd.org, Robert Watson , Jason Evans Subject: Re: sbrk(2) broken 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: Fri, 04 Jan 2008 12:45:38 -0000 "Igor Mozolevsky" writes: > Broadcasting SIGDANGER would be a much better option; followed by > SIGTERM to the memory hogger (to allow for graceful termination) and > only then SIGKILL. I can imagine a few (legitimate) scenarios when a > user process would want to hog as much RAM as possible... We don't currently have SIGDANGER, but the signal code was rewritten years ago to allow more than 32 signals precisely for the purpose of implementing an AIX-like SIGDANGER. This wasn't done, however, and eventually SIGTHR was the first new signal to take advantage of the rewritten code. > [about pre-zeroing a backing file] > Surely you can just fseek() on the file at the correct lenght? No. First of all, you're thinking of lseek(), not fseek() Second, an lseek() beyond the end of a file will not actually extend the file. Third, ftruncate() (which *will* extend a file if it is shorter than the requested length) or lseek() followed by write() will not allocate physical disk space except for the data actually written; it will create a sparse file, which when later written to will become fragmented, resulting in horrible performance. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no