From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751240AbcA1Xm7 (ORCPT ); Thu, 28 Jan 2016 18:42:59 -0500 Received: from alln-iport-6.cisco.com ([173.37.142.93]:52143 "EHLO alln-iport-6.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750920AbcA1Xm4 (ORCPT ); Thu, 28 Jan 2016 18:42:56 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0D3AQDZpqpW/4UNJK1egzeKFrFEAQ2BY?= =?us-ascii?q?odZOBQBAQEBAQEBgQqEaxVANgIFFgsCCwMCAQIBSwEMCAEBiBexFo8YAQEBAQE?= =?us-ascii?q?BBAEBAQEBGwtwhRKLaYE6BY4YiFaNS4kfhVKOPR4BAUKECxuJKwEBAQ?= X-IronPort-AV: E=Sophos;i="5.22,360,1449532800"; d="scan'208";a="232501082" To: Alexander Viro , Johannes Weiner , Michal Hocko , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, "Khalid Mughal (khalidm)" , "xe-kernel@external.cisco.com" From: Daniel Walker Subject: computing drop-able caches Message-ID: <56AAA77D.7090000@cisco.com> Date: Thu, 28 Jan 2016 15:42:53 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Auto-Response-Suppress: DR, OOF, AutoReply Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, My colleague Khalid and I are working on a patch which will provide a /proc file to output the size of the drop-able page cache. One way to implement this is to use the current drop_caches /proc routine, but instead of actually droping the caches just add up the amount. Here's a quote Khalid, "Currently there is no way to figure out the droppable pagecache size from the meminfo output. The MemFree size can shrink during normal system operation, when some of the memory pages get cached and is reflected in "Cached" field. Similarly for file operations some of the buffer memory gets cached and it is reflected in "Buffers" field. The kernel automatically reclaims all this cached & buffered memory, when it is needed elsewhere on the system. The only way to manually reclaim this memory is by writing 1 to /proc/sys/vm/drop_caches. " So my impression is that the drop-able cache is spread over two fields in meminfo. Alright, the question is does this info live someplace else that we don't know about? Or someplace in the kernel where it could be added to meminfo trivially ? The point of the whole exercise is to get a better idea of free memory for our employer. Does it make sense to do this for computing free memory? Any comments welcome.. Daniel