From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934392AbcHJTgv (ORCPT ); Wed, 10 Aug 2016 15:36:51 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:57708 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S938919AbcHJTgo (ORCPT ); Wed, 10 Aug 2016 15:36:44 -0400 X-AuditID: b6c32a16-f79066d00000256b-c8-57ab2b8751e8 From: PINTU KUMAR To: "'Pavel Machek'" , koct9i@gmail.com Cc: "'Minchan Kim'" , linux-kernel@vger.kernel.org, linux-mm@kvack.org, jaejoon.seo@samsung.com, jy0.jeon@samsung.com, vishnu.ps@samsung.com, chulspro.kim@samsung.com In-reply-to: <20160805205018.GE7999@amd> Subject: RE: [linux-mm] Drastic increase in application memory usage with Kernel version upgrade Date: Wed, 10 Aug 2016 18:56:02 +0530 Message-id: <006e01d1f30a$bfc7f430$3f57dc90$@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-index: AQIXVAHQaum/ZHq6w8tgVkUeUnFZygHaOt8xAcd6opkBobdAEwGAZwgIn4FI/bA= Content-language: en-us X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrLJsWRmVeSWpSXmKPExsWy7bCmmG679upwg6l/VCxeHpzNbvF20UpW i8VbbC1Wdj5gtbi8aw6bxb01/1ktln19z25x99RRNospfXcZHTg9ds66y+6xaVUnm8emT5PY Pfq2rGL0WLH6O7vH501yAWxRqTYZqYkpqUUKqXnJ+SmZeem2St7B8c7xpmYGhrqGlhbmSgp5 ibmptkouPgG6bpk5QEcpKZQl5pQChQISi4uV9O1sivJLS1IVMvKLS2yVog0NjfQMDcz1jIyM 9ExMY62MTIFKElIzDh45wlpwX6bi0CShBsZnYl2MnBwSAiYSM79vZ4SwxSQu3FvP1sXIxSEk sJRRouvjL0YI5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+ec1FpAEm4CmxNVbC8GKRAQsJTqONDODFDELXGKUuPDoBxNIQkjg M6PEzVVJIDangIbE0j3fwZqFBRIkLky+CmazCKhKXH13mbGLkYODF2jQlTlBIGFeAUGJkzOf sICEmQX0JNo2MoKEmQXkJba/ncMMcZuCxI6zrxkhTvCTeHK1C6pGXOLl0SPsExgFZyGZNAth 0iwkk2Yh6VjAyLKKUSy1oDg3Pbe4wMBQrzgxt7g0L10vOT93EyMwSrcdVhLbwdi2wusQowAH oxIPr4fc6nAh1sSy4srcQ4wSHMxKIrzFmkAh3pTEyqrUovz4otKc1OJDjKZAf05klhJNzgcm kLySeEMTUwsLCxNLY2NjCxMlcV7Bu3XhQgLpiSWp2ampBalFMH1MHJxSDYyJgdb8vpNc8lP4 ueIOVvwJ2Br6OfySlcGrm4a2d5/yXjf/5fIv1u6Ws3Xa3D4f/RyF+7bR0daxcttWpiZuZ992 3cia63vm6xDPHVu67ayr+XMdX7/Jy8v1l+xjTfoUo9hgm2vpyxNRq6sy1XXG8lV55aEHrRlN pJofXrjUHKTwd9MzqT9+SizFGYmGWsxFxYkACFvU0OgCAAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20160810132630epcas3p4f7f44b184ba9957c42833980620a835a X-Msg-Generator: CA X-Sender-IP: 182.195.34.22 X-Local-Sender: =?UTF-8?B?UElOVFUgQUdBUldBTBtTUkktQmFuZ2Fsb3JlLUtlcm5lbCAm?= =?UTF-8?B?IEJTUBvsgrzshLHsoITsnpAbUHJpbmNpcGFsIEVuZ2luZWVy?= X-Global-Sender: =?UTF-8?B?UElOVFUgS1VNQVIbU1JJLUJhbmdhbG9yZS1LZXJuZWwgJiBC?= =?UTF-8?B?U1AbU2Ftc3VuZyBFbGVjdHJvbmljcxtQcmluY2lwYWwgRW5naW5lZXI=?= X-Sender-Code: =?UTF-8?B?QzEwG1NXQUhRG0MxMElEMDFJRDAxMDYxNg==?= CMS-TYPE: 103P DLP-Filter: Pass X-CFilter-Loop: Reflected X-HopCount: 7 X-CMS-RootMailID: 20160805045709epcas3p1dc6f12f2fa3031112c4da5379e33b5e9 X-RootMTR: 20160805045709epcas3p1dc6f12f2fa3031112c4da5379e33b5e9 References: <01a001d1eed5$c50726c0$4f157440$@samsung.com> <20160805082015.GA28235@bbox> <01c101d1ef28$50706ad0$f1514070$@samsung.com> <20160805205018.GE7999@amd> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, > -----Original Message----- > From: Pavel Machek [mailto:pavel@ucw.cz] > Sent: Saturday, August 06, 2016 2:20 AM > To: PINTU KUMAR > Cc: 'Minchan Kim'; linux-kernel@vger.kernel.org; linux-mm@kvack.org; > jaejoon.seo@samsung.com; jy0.jeon@samsung.com; vishnu.ps@samsung.com > Subject: Re: [linux-mm] Drastic increase in application memory usage with Kernel > version upgrade > > On Fri 2016-08-05 20:17:36, PINTU KUMAR wrote: > > Hi, > > > > On Fri, Aug 05, 2016 at 10:26:37AM +0530, PINTU KUMAR wrote: > > > > Hi All, > > > > > > > > For one of our ARM embedded product, we recently updated the > > > > Kernel version from 3.4 to 3.18 and we noticed that the same > > > > application memory usage (PSS value) gone up by ~10% and for > > > > some cases it even crossed ~50%. There is no change in platform > > > > part. All platform component was built with ARM 32-bit toolchain. > > > > However, the Kernel is changed from 32-bit to 64-bit. > > > > > > > > Is upgrading Kernel version and moving from 32-bit to 64-bit is > > > > such a risk? > > > > After the upgrade, what can we do further to reduce the > > > > application memory usage ? > > > > Is there any other factor that will help us to improve without > > > > major modifications in platform ? > > > > > > > > As a proof, we did a small experiment on our Ubuntu-32 bit machine. > > > > We upgraded Ubuntu Kernel version from 3.13 to 4.01 and we > > > > observed the following: > > > > ------------------------------------------------------------------ > > > > |UBUNTU-32 bit |Kernel 3.13 |Kernel 4.03 |DIFF | > > > > |CALCULATOR PSS |6057 KB |6466 KB |409 KB | > > > > ------------------------------------------------------------------ > > > > So, just by upgrading the Kernel version: PSS value for calculator > > > > is increased by 409KB. > > > > > > > > If anybody knows any in-sight about it please point out more > > > > details about the root cause. > > > > > > One of culprit is [8c6e50b0290c, mm: introduce vm_ops->map_pages()]. > > Ok. Thank you for your reply. > > So, if I revert this patch, will the memory usage be decreased for the > > processes with Kernel 3.18 ? > > I guess you should try it... > Thanks for the reply and confirmation. Our exact kernel version is: 3.18.14 And, we already have this patch: /* mm: do not call do_fault_around for non-linear fault Ingo Korb reported that "repeated mapping of the same file on tmpfs using remap_file_pages sometimes triggers a BUG at mm/filemap.c:202 when the process exits". He bisected the bug to d7c1755179b8 ("mm: implement ->map_pages for shmem/tmpfs"), although the bug was actually added by commit 8c6e50b0290c ("mm: introduce vm_ops->map_pages()"). */ So, I guess, reverting this patch (8c6e50b0290c), is not required ? But, still we have memory usage issue. > You may want to try the same kernel version, once in 32-bit and once in 64-bit > version. And you may consider moving to recent kernel. > Sorry, but moving to higher kernel version is not possible as of now. As it involves other BSP changes. We can only upgrades the relevant patches. However, as I said earlier, we even found the difference on Ubuntu 32-bit after moving from Kernel-3.13 to 4.0. So, I guess, this problem exists even in higher kernel version too. > Yes, 64-bit kernel will increase memory usage _of kernel_, but... > Ok, But ? Will it be major culprit ? Or higher kernel version is major culprit ? > > Pavel > -- > (english) http://www.livejournal.com/~pavelmachek > (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html