From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754577AbcBPIoW (ORCPT ); Tue, 16 Feb 2016 03:44:22 -0500 Received: from mx2.parallels.com ([199.115.105.18]:60222 "EHLO mx2.parallels.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754556AbcBPIoH (ORCPT ); Tue, 16 Feb 2016 03:44:07 -0500 Date: Tue, 16 Feb 2016 11:43:46 +0300 From: Vladimir Davydov To: "Nag Avadhanam (nag)" CC: "Theodore Ts'o" , "Daniel Walker (danielwa)" , Dave Chinner , Alexander Viro , "Khalid Mughal (khalidm)" , "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" Subject: Re: [PATCH] kernel: fs: drop_caches: add dds drop_caches_count Message-ID: <20160216084346.GA8511@esperanza> References: <1455308080-27238-1-git-send-email-danielwa@cisco.com> <20160214211856.GT19486@dastard> <56C216CA.7000703@cisco.com> <20160215230511.GU19486@dastard> <56C264BF.3090100@cisco.com> <20160216004531.GA28260@thunk.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: US-EXCH2.sw.swsoft.com (10.255.249.46) To US-EXCH.sw.swsoft.com (10.255.249.47) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 16, 2016 at 02:58:04AM +0000, Nag Avadhanam (nag) wrote: > We have a class of platforms that are essentially swap-less embedded > systems that have limited memory resources (2GB and less). > > There is a need to implement early alerts (before the OOM killer kicks in) > based on the current memory usage so admins can take appropriate steps (do > not initiate provisioning operations but support existing services, > de-provision certain services, etc. based on the extent of memory usage in > the system) . > > There is also a general need to let end users know the available memory so > they can determine if they can enable new services (helps in planning). > > These two depend upon knowing approximate (accurate within few 10s of MB) > memory usage within the system. We want to alert admins before system > exhibits any thrashing behaviors. Have you considered using /proc/kpageflags for counting such pages? It should already export all information about memory pages you might need, e.g. which pages are mapped, which are anonymous, which are inactive, basically all page flags and even more. Moreover, you can even determine the set of pages that are really read/written by processes - see /sys/kernel/mm/page_idle/bitmap. On such a small machine scanning the whole pfn range should be pretty cheap, so you might find this API acceptable. Thanks, Vladimir From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Tue, 16 Feb 2016 11:43:46 +0300 From: Vladimir Davydov To: "Nag Avadhanam (nag)" CC: Theodore Ts'o , "Daniel Walker (danielwa)" , Dave Chinner , Alexander Viro , "Khalid Mughal (khalidm)" , "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" Subject: Re: [PATCH] kernel: fs: drop_caches: add dds drop_caches_count Message-ID: <20160216084346.GA8511@esperanza> References: <1455308080-27238-1-git-send-email-danielwa@cisco.com> <20160214211856.GT19486@dastard> <56C216CA.7000703@cisco.com> <20160215230511.GU19486@dastard> <56C264BF.3090100@cisco.com> <20160216004531.GA28260@thunk.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org List-ID: On Tue, Feb 16, 2016 at 02:58:04AM +0000, Nag Avadhanam (nag) wrote: > We have a class of platforms that are essentially swap-less embedded > systems that have limited memory resources (2GB and less). > > There is a need to implement early alerts (before the OOM killer kicks in) > based on the current memory usage so admins can take appropriate steps (do > not initiate provisioning operations but support existing services, > de-provision certain services, etc. based on the extent of memory usage in > the system) . > > There is also a general need to let end users know the available memory so > they can determine if they can enable new services (helps in planning). > > These two depend upon knowing approximate (accurate within few 10s of MB) > memory usage within the system. We want to alert admins before system > exhibits any thrashing behaviors. Have you considered using /proc/kpageflags for counting such pages? It should already export all information about memory pages you might need, e.g. which pages are mapped, which are anonymous, which are inactive, basically all page flags and even more. Moreover, you can even determine the set of pages that are really read/written by processes - see /sys/kernel/mm/page_idle/bitmap. On such a small machine scanning the whole pfn range should be pretty cheap, so you might find this API acceptable. Thanks, Vladimir -- 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