From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Subject: Re: computing drop-able caches To: "Khalid Mughal (khalidm)" , Rik van Riel , Johannes Weiner References: <56AAA77D.7090000@cisco.com> <20160128235815.GA5953@cmpxchg.org> <56AABA79.3030103@cisco.com> <56AAC085.9060509@cisco.com> <20160129015534.GA6401@cmpxchg.org> <56ABEAA7.1020706@redhat.com> Cc: Alexander Viro , Michal Hocko , Andrew Morton , "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "xe-kernel@external.cisco.com" From: Daniel Walker Message-ID: <56BB7BC7.4040403@cisco.com> Date: Wed, 10 Feb 2016 10:04:55 -0800 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: On 02/08/2016 12:57 PM, Khalid Mughal (khalidm) wrote: > How do we explain the discrepancy between MemAvaiable and MemFree count > after we drop cache? In following output, which one represents correct > data? > > [Linux_0:/]$ cat /proc/meminfo > MemTotal: 3977836 kB > MemFree: 747832 kB > MemAvailable: 1441736 kB > Buffers: 123976 kB > Cached: 1210272 kB > Active: 2496932 kB > Inactive: 585364 kB > Active(anon): 2243932 kB > Inactive(anon): 142676 kB > Active(file): 253000 kB > Inactive(file): 442688 kB > Dirty: 44 kB > AnonPages: 1748088 kB > Mapped: 406512 kB > Shmem: 638564 kB > Slab: 65656 kB > SReclaimable: 30120 kB > SUnreclaim: 35536 kB > KernelStack: 5920 kB > PageTables: 19040 kB > CommitLimit: 1988916 kB > Committed_AS: 3765252 kB > > [Linux_0:/]$ echo 3 > /proc/sys/vm/drop_caches > [Linux_0:/]$ cat /proc/meminfo > MemTotal: 3977836 kB > MemFree: 1095012 kB > MemAvailable: 1434148 kB I suspect MemAvailable takes into account more than just the droppable caches. For instance, reclaimable slab is included, but I don't think drop_caches drops that part. Daniel -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753473AbcBJSE6 (ORCPT ); Wed, 10 Feb 2016 13:04:58 -0500 Received: from rcdn-iport-2.cisco.com ([173.37.86.73]:28100 "EHLO rcdn-iport-2.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751470AbcBJSE4 (ORCPT ); Wed, 10 Feb 2016 13:04:56 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0AbBQCvertW/4UNJK1egzqKG7EvgWaGD?= =?us-ascii?q?QKBPDoSAQEBAQEBAYEKhEIBAQQ4QAEQCxgJDAoPCQMCAQIBRQYBDAgBAYgXwGY?= =?us-ascii?q?BAQEBAQEBAQEBAQEBAQEBAQEBARYLhgeEN4Rxg3sBBI4biF2NUYkihVKOPycJM?= =?us-ascii?q?oQFiRwBAQE?= X-IronPort-AV: E=Sophos;i="5.22,426,1449532800"; d="scan'208";a="74825259" Subject: Re: computing drop-able caches To: "Khalid Mughal (khalidm)" , Rik van Riel , Johannes Weiner References: <56AAA77D.7090000@cisco.com> <20160128235815.GA5953@cmpxchg.org> <56AABA79.3030103@cisco.com> <56AAC085.9060509@cisco.com> <20160129015534.GA6401@cmpxchg.org> <56ABEAA7.1020706@redhat.com> Cc: Alexander Viro , Michal Hocko , Andrew Morton , "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "xe-kernel@external.cisco.com" From: Daniel Walker Message-ID: <56BB7BC7.4040403@cisco.com> Date: Wed, 10 Feb 2016 10:04:55 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; 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 On 02/08/2016 12:57 PM, Khalid Mughal (khalidm) wrote: > How do we explain the discrepancy between MemAvaiable and MemFree count > after we drop cache? In following output, which one represents correct > data? > > [Linux_0:/]$ cat /proc/meminfo > MemTotal: 3977836 kB > MemFree: 747832 kB > MemAvailable: 1441736 kB > Buffers: 123976 kB > Cached: 1210272 kB > Active: 2496932 kB > Inactive: 585364 kB > Active(anon): 2243932 kB > Inactive(anon): 142676 kB > Active(file): 253000 kB > Inactive(file): 442688 kB > Dirty: 44 kB > AnonPages: 1748088 kB > Mapped: 406512 kB > Shmem: 638564 kB > Slab: 65656 kB > SReclaimable: 30120 kB > SUnreclaim: 35536 kB > KernelStack: 5920 kB > PageTables: 19040 kB > CommitLimit: 1988916 kB > Committed_AS: 3765252 kB > > [Linux_0:/]$ echo 3 > /proc/sys/vm/drop_caches > [Linux_0:/]$ cat /proc/meminfo > MemTotal: 3977836 kB > MemFree: 1095012 kB > MemAvailable: 1434148 kB I suspect MemAvailable takes into account more than just the droppable caches. For instance, reclaimable slab is included, but I don't think drop_caches drops that part. Daniel