From owner-freebsd-arch@FreeBSD.ORG Fri Oct 12 18:46:46 2012 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B11BDC95 for ; Fri, 12 Oct 2012 18:46:46 +0000 (UTC) (envelope-from phk@phk.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 65B798FC1A for ; Fri, 12 Oct 2012 18:46:46 +0000 (UTC) Received: from critter.freebsd.dk (critter.freebsd.dk [192.168.61.3]) by phk.freebsd.dk (Postfix) with ESMTP id DB4713B080; Fri, 12 Oct 2012 18:46:43 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.5/8.14.5) with ESMTP id q9CIkg7B005512; Fri, 12 Oct 2012 18:46:42 GMT (envelope-from phk@phk.freebsd.dk) To: Alan Cox Subject: Re: Behavior of madvise(MADV_FREE) In-reply-to: <50786023.1000206@rice.edu> From: "Poul-Henning Kamp" References: <9FEBC10C-C453-41BE-8829-34E830585E90@xcllnt.net> <4835.1350062021@critter.freebsd.dk> <50786023.1000206@rice.edu> Date: Fri, 12 Oct 2012 18:46:42 +0000 Message-ID: <5511.1350067602@critter.freebsd.dk> Cc: Tim LaBerge , Marcel Moolenaar , "freebsd-arch@freebsd.org Arch" X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Oct 2012 18:46:46 -0000 -------- In message <50786023.1000206@rice.edu>, Alan Cox writes: >Given the way that madvise(MADV_FREE) is still used by malloc()/free(), >any additional overhead would still be a pessimization most of the >time. That would be my fear too. >Over the years, I think you and I have both said that what we >really need is the ability for the kernel to deliver an event to >malloc()/free() when memory is trending toward scarcity. I still think this would be a good idea, and I can only assume that the absense of this feature is due to Jason Evans failing in his malloc-maintainers duty of bugging the VM people for this feature at every conceiveable opportunity :-) That being said, my experience with Varnish does indicate that intelligent use of VM from userland is close to a lost case, in no small part because of the lack of a good API. If you can spare a student of sufficient quality, it might be a good assignment to design a new VM-API, relative to the current reality of things like malware attacks, "no-execute" bits etc. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.