From owner-freebsd-hackers@FreeBSD.ORG Tue Jan 7 00:51:15 2014 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C5BD68FB; Tue, 7 Jan 2014 00:51:15 +0000 (UTC) Received: from mail-ee0-x22d.google.com (mail-ee0-x22d.google.com [IPv6:2a00:1450:4013:c00::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E1F201E51; Tue, 7 Jan 2014 00:51:14 +0000 (UTC) Received: by mail-ee0-f45.google.com with SMTP id d49so8134661eek.32 for ; Mon, 06 Jan 2014 16:51:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=BdWKlxaOo5K/xSI5/LaSYD3PDKYCFs1xm2eQpAB4udg=; b=HeEI00CFOPWtPAmpXCHiD1AcMOwNlbssOiQiXvcOZq52pmqQF1+RJ2MsxqFOyaFCPE DzBw9mIfVGxiylGAYljvgKV92RES3r9J0D+Zd385lmFM9J5SbjCEs0iyRJLfk0tTl9YA PzoiLPBGSEvvb/gveSsqG6f0kXHCW/vSKL4/YQJ6Su5DoeS+2YHIm2vYbWKNOYKjm1l8 79DbEbRp/SPXSOW/AqkCNaU6jB++pZECG5s67xM1DewMC82fL3GA7F/5SXNrwBHPWtij eu+b8DZ5/a/kvZlwg4dkQeURGmhcqq1Dxp4n8JnZqKU2CO45APZ3pYWFNz6lUjo+5ddo Cdeg== X-Received: by 10.15.24.142 with SMTP id j14mr38148671eeu.52.1389055873259; Mon, 06 Jan 2014 16:51:13 -0800 (PST) Received: from mavbook.mavhome.dp.ua ([134.249.139.101]) by mx.google.com with ESMTPSA id a51sm175388935eeh.8.2014.01.06.16.51.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 06 Jan 2014 16:51:11 -0800 (PST) Sender: Alexander Motin Message-ID: <52CB4F7D.2080909@FreeBSD.org> Date: Tue, 07 Jan 2014 02:51:09 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: hackers@freebsd.org Subject: UMA caches draining Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jan 2014 00:51:15 -0000 Hi. I have some questions about memory allocation. At this moment our UMA never returns freed memory back to the system until it is explicitly asked by pageout daemon via uma_reclaim() call, that happens only when system is quite low on memory. How does that coexist with buffer cache and other consumers? Will, for example, buffer cache allocate buffers and be functional when most of system's memory uselessly consumed by UMA caches? Is there some design how that supposed to work? I've made an experimental patch for UMA (http://people.freebsd.org/~mav/drain_unused.patch) to make it every 20 seconds return back to the system cached memory, unused for the last 20 seconds. Algorithm is quite simple and patch seems like working, but I am not sure whether I am approaching problem from the right side. Any thoughts? -- Alexander Motin