From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751559AbcBPApn (ORCPT ); Mon, 15 Feb 2016 19:45:43 -0500 Received: from imap.thunk.org ([74.207.234.97]:35892 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750922AbcBPApl (ORCPT ); Mon, 15 Feb 2016 19:45:41 -0500 Date: Mon, 15 Feb 2016 19:45:31 -0500 From: "Theodore Ts'o" To: Daniel Walker Cc: Dave Chinner , Alexander Viro , Khalid Mughal , xe-kernel@external.cisco.com, dave.hansen@intel.com, hannes@cmpxchg.org, riel@redhat.com, Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, "Nag Avadhanam (nag)" Subject: Re: [PATCH] kernel: fs: drop_caches: add dds drop_caches_count Message-ID: <20160216004531.GA28260@thunk.org> Mail-Followup-To: Theodore Ts'o , Daniel Walker , Dave Chinner , Alexander Viro , Khalid Mughal , xe-kernel@external.cisco.com, dave.hansen@intel.com, hannes@cmpxchg.org, riel@redhat.com, Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, "Nag Avadhanam (nag)" References: <1455308080-27238-1-git-send-email-danielwa@cisco.com> <20160214211856.GT19486@dastard> <56C216CA.7000703@cisco.com> <20160215230511.GU19486@dastard> <56C264BF.3090100@cisco.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <56C264BF.3090100@cisco.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on imap.thunk.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 15, 2016 at 03:52:31PM -0800, Daniel Walker wrote: > >>We need it to determine accurately what the free memory in the > >>system is. If you know where we can get this information already > >>please tell, we aren't aware of it. For instance /proc/meminfo isn't > >>accurate enough. > > Approximate point-in-time indication is an accurate characterization > of what we are doing. This is good enough for us. NO matter what we > do, we are never going to be able to address the "time of check to > time of use” window. But, this approximation works reasonably well > for our use case. Why do you need such accuracy, and what do you consider "good enough". Having something which iterates over all of the inodes in the system is something that really shouldn't be in a general production kernel At the very least it should only be accessible by root (so now only a careless system administrator can DOS attack the system) but the Dave's original question still stands. Why do you need a certain level of accuracy regarding how much memory is available after dropping all of the caches? What problem are you trying to solve/avoid? It may be that you are going about things completely the wrong way, which is why understanding the higher order problem you are trying to solve might be helpful in finding something which is safer, architecturally cleaner, and something that could go into the upstream kernel. Cheers, - Ted