From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933111AbbENNbW (ORCPT ); Thu, 14 May 2015 09:31:22 -0400 Received: from mail-la0-f46.google.com ([209.85.215.46]:36128 "EHLO mail-la0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750777AbbENNbU (ORCPT ); Thu, 14 May 2015 09:31:20 -0400 MIME-Version: 1.0 In-Reply-To: <5554844F.4070709@suse.cz> References: <1427474441-17708-1-git-send-email-vbabka@suse.cz> <1427474441-17708-4-git-send-email-vbabka@suse.cz> <55158EB5.5040301@yandex-team.ru> <5554844F.4070709@suse.cz> Date: Thu, 14 May 2015 16:31:17 +0300 Message-ID: Subject: Re: [PATCH v2 3/4] mm, shmem: Add shmem resident memory accounting From: Konstantin Khlebnikov To: Vlastimil Babka Cc: Konstantin Khlebnikov , "linux-mm@kvack.org" , Jerome Marchand , Linux Kernel Mailing List , Andrew Morton , linux-doc@vger.kernel.org, Hugh Dickins , Michal Hocko , "Kirill A. Shutemov" , Cyrill Gorcunov , Randy Dunlap , linux-s390@vger.kernel.org, Martin Schwidefsky , Heiko Carstens , Peter Zijlstra , Paul Mackerras , Arnaldo Carvalho de Melo , Oleg Nesterov , Linux API Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 14, 2015 at 2:17 PM, Vlastimil Babka wrote: > On 03/27/2015 06:09 PM, Konstantin Khlebnikov wrote: >> >> On 27.03.2015 19:40, Vlastimil Babka wrote: >>> >>> From: Jerome Marchand >>> >>> Currently looking at /proc//status or statm, there is no way to >>> distinguish shmem pages from pages mapped to a regular file (shmem >>> pages are mapped to /dev/zero), even though their implication in >>> actual memory use is quite different. >>> This patch adds MM_SHMEMPAGES counter to mm_rss_stat to account for >>> shmem pages instead of MM_FILEPAGES. >>> >>> Signed-off-by: Jerome Marchand >>> Signed-off-by: Vlastimil Babka >>> --- >> >> >> >>> --- a/include/linux/mm_types.h >>> +++ b/include/linux/mm_types.h >>> @@ -327,9 +327,12 @@ struct core_state { >>> }; >>> >>> enum { >>> - MM_FILEPAGES, >>> - MM_ANONPAGES, >>> - MM_SWAPENTS, >>> + MM_FILEPAGES, /* Resident file mapping pages */ >>> + MM_ANONPAGES, /* Resident anonymous pages */ >>> + MM_SWAPENTS, /* Anonymous swap entries */ >>> +#ifdef CONFIG_SHMEM >>> + MM_SHMEMPAGES, /* Resident shared memory pages */ >>> +#endif >> >> >> I prefer to keep that counter unconditionally: >> kernel has MM_SWAPENTS even without CONFIG_SWAP. > > > Hmm, so just for consistency? I don't see much reason to make life harder > for tiny systems, especially when it's not too much effort. Profit is vague, I guess slab anyway will round size to the next cacheline or power-of-two. That conditional (non)existence just adds unneeded code lines. > >> >>> NR_MM_COUNTERS >>> }; >>> >> >> -- >> 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 >> > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konstantin Khlebnikov Subject: Re: [PATCH v2 3/4] mm, shmem: Add shmem resident memory accounting Date: Thu, 14 May 2015 16:31:17 +0300 Message-ID: References: <1427474441-17708-1-git-send-email-vbabka@suse.cz> <1427474441-17708-4-git-send-email-vbabka@suse.cz> <55158EB5.5040301@yandex-team.ru> <5554844F.4070709@suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: In-Reply-To: <5554844F.4070709@suse.cz> Sender: owner-linux-mm@kvack.org List-Archive: List-Post: To: Vlastimil Babka Cc: Konstantin Khlebnikov , "linux-mm@kvack.org" , Jerome Marchand , Linux Kernel Mailing List , Andrew Morton , linux-doc@vger.kernel.org, Hugh Dickins , Michal Hocko , "Kirill A. Shutemov" , Cyrill Gorcunov , Randy Dunlap , linux-s390@vger.kernel.org, Martin Schwidefsky , Heiko Carstens , Peter Zijlstra , Paul Mackerras , Arnaldo Carvalho de Melo , Oleg Nesterov , Linux API List-ID: On Thu, May 14, 2015 at 2:17 PM, Vlastimil Babka wrote: > On 03/27/2015 06:09 PM, Konstantin Khlebnikov wrote: >> >> On 27.03.2015 19:40, Vlastimil Babka wrote: >>> >>> From: Jerome Marchand >>> >>> Currently looking at /proc//status or statm, there is no way to >>> distinguish shmem pages from pages mapped to a regular file (shmem >>> pages are mapped to /dev/zero), even though their implication in >>> actual memory use is quite different. >>> This patch adds MM_SHMEMPAGES counter to mm_rss_stat to account for >>> shmem pages instead of MM_FILEPAGES. >>> >>> Signed-off-by: Jerome Marchand >>> Signed-off-by: Vlastimil Babka >>> --- >> >> >> >>> --- a/include/linux/mm_types.h >>> +++ b/include/linux/mm_types.h >>> @@ -327,9 +327,12 @@ struct core_state { >>> }; >>> >>> enum { >>> - MM_FILEPAGES, >>> - MM_ANONPAGES, >>> - MM_SWAPENTS, >>> + MM_FILEPAGES, /* Resident file mapping pages */ >>> + MM_ANONPAGES, /* Resident anonymous pages */ >>> + MM_SWAPENTS, /* Anonymous swap entries */ >>> +#ifdef CONFIG_SHMEM >>> + MM_SHMEMPAGES, /* Resident shared memory pages */ >>> +#endif >> >> >> I prefer to keep that counter unconditionally: >> kernel has MM_SWAPENTS even without CONFIG_SWAP. > > > Hmm, so just for consistency? I don't see much reason to make life harder > for tiny systems, especially when it's not too much effort. Profit is vague, I guess slab anyway will round size to the next cacheline or power-of-two. That conditional (non)existence just adds unneeded code lines. > >> >>> NR_MM_COUNTERS >>> }; >>> >> >> -- >> 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 >> > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ -- 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