Received: by 10.223.164.202 with SMTP id h10csp1815209wrb; Fri, 24 Nov 2017 01:45:53 -0800 (PST) X-Google-Smtp-Source: AGs4zMbGU+LABPrVdoaKWPcqsYpFqtUPFIH0szfuHo/BErbG5+J3FG5S4iw0iqAwKIrn5v1izi4B X-Received: by 10.84.133.15 with SMTP id 15mr27733299plf.367.1511516753852; Fri, 24 Nov 2017 01:45:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511516753; cv=none; d=google.com; s=arc-20160816; b=t4bYcPe4Nt/mlvD6yDKRRG+szvybjVybv0Q96G16lEF4prb7lhjPSuu7/faqpWo+PC 5+OmVPJXOArfg1TY05QqBnuOHY+AmtPIeY7cZn12w2HGvBotVSknBOPUiKtLaC2NRMz3 ecx9wKV/ldCBAUNKnjsEKOzvvXNGhLpL6YnusfsgDPSmpf/oq5wlTC8s8NFBa3EKrDWA 8e0kHa9tYervzApJ+OpeZltOkQTr/XtFSjRKFoH9NtMZo7OdWUGhmP+Z2XquhLcvKNct Oew//xNe1cBII7Cm+i9BY2aKAbsdUgeMizSwNiTELswrF7Dz5PnAbMy+OFLnw8zadiJK JM3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:dlp-filter:cms-type :content-transfer-encoding:date:message-id:in-reply-to:cc:to:from :reply-to:subject:mime-version:dkim-signature:dkim-filter :arc-authentication-results; bh=+ngCADccFz5akjvg+44OPTFekQTpIKawF5HYtDFXm5U=; b=aoJBhki+dj61NEjhC729MMJnEyspWjI2RQjHOEuhv+rPY/k2yXGmZVe1GIB+B9flRS D4htTfsC9TcQwGFAue01Fbs1HTtwOk5Rr81LyH5P2/Ai4aUXqt9RYucyjwimm5ucsuF5 Z/iuOIWLNUqoJ6NI3bCuikwAaqzArWxB800sP18c/ZtatfBqvUO/ohQulLVl94qd1X3T I1vbn4lteE/Ogc8k60/cEF3KntHYbWzrwLu3JXOqWg03ZmObP5iHMq6PiN2fXbBYFAvE uYkxiB5uXkzAUwOCN0KIrWDOd7yQz3wtZrXawoC48z3B7Rx1X6Pz7Eh1xL4qMEGYGYXG Amvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=a3JDsclN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 62si6608717ply.31.2017.11.24.01.45.42; Fri, 24 Nov 2017 01:45:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=a3JDsclN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753378AbdKXJnr (ORCPT + 76 others); Fri, 24 Nov 2017 04:43:47 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:12902 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753192AbdKXJnm (ORCPT ); Fri, 24 Nov 2017 04:43:42 -0500 Received: from epcas5p3.samsung.com (unknown [182.195.41.41]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20171124094340epoutp02d3a22c2cfd76313c21db9fbc5024f719~5-FupwGJ-1311413114epoutp02I for ; Fri, 24 Nov 2017 09:43:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20171124094340epoutp02d3a22c2cfd76313c21db9fbc5024f719~5-FupwGJ-1311413114epoutp02I DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1511516620; bh=+ngCADccFz5akjvg+44OPTFekQTpIKawF5HYtDFXm5U=; h=Subject:Reply-To:From:To:CC:In-Reply-To:Date:References:From; b=a3JDsclNn6266smZZewjBstmjfO3DjMJnar3bHTyR06zb7AUQSSAv1HlnYpfxz9yV /cET1kk/3+9ZPNMQhRYAOfTPJkloNfLXk1ugZk4aSZ0VFDv65hTJAThQDNdHJhN+fF bhUP0LLh2HRguOIFnjfCkXDkZpNkvy4eMJnNzEFo= Received: from epsmges5p1new.samsung.com (unknown [182.195.40.74]) by epcas5p2.samsung.com (KnoxPortal) with ESMTP id 20171124094340epcas5p2b8f26f0d3edc287d6694f968468f61a3~5-FuIQCq50125201252epcas5p2k; Fri, 24 Nov 2017 09:43:40 +0000 (GMT) X-AuditID: b6c32a49-915ff7000000117d-cb-5a17e9cb0fcb Received: from epcas5p3.samsung.com ( [182.195.41.41]) by epsmges5p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 26.79.04477.BC9E71A5; Fri, 24 Nov 2017 18:43:39 +0900 (KST) Mime-Version: 1.0 Subject: Re: [PATCH 1/1] stackdepot: interface to check entries and size of stackdepot. Reply-To: maninder1.s@samsung.com From: Maninder Singh To: Michal Hocko CC: "kstewart@linuxfoundation.org" , "gregkh@linuxfoundation.org" , "jkosina@suse.cz" , "pombredanne@nexb.com" , "jpoimboe@redhat.com" , "akpm@linux-foundation.org" , "vbabka@suse.cz" , "guptap@codeaurora.org" , "vinmenon@codeaurora.org" , AMIT SAHRAWAT , PANKAJ MISHRA , Lalit Mohan Tripathi , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , Vaneet Narang X-Priority: 3 X-Content-Kind-Code: NORMAL In-Reply-To: <20171123162835.6prpgrz3qkdexx56@dhcp22.suse.cz> X-Drm-Type: Y,confirm X-EPWebmail-Msg-Type: personal X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N Message-ID: <20171124094108epcms5p396558828a365a876d61205b0fdb501fd@epcms5p3> Date: Fri, 24 Nov 2017 09:41:08 +0000 X-CMS-MailID: 20171124094108epcms5p396558828a365a876d61205b0fdb501fd Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: REQ_APPROVE X-MTR: 20171124094108epcms5p396558828a365a876d61205b0fdb501fd CMS-TYPE: 105P X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrCJsWRmVeSWpSXmKPExsWy7bCmpu7pl+JRBtNPmVtc3J1qMWf9GjaL 5sXr2Sy+PVzBZrF7zmIWiwM/TzBa9MxpYrToX2xmcXnXHDaLe2v+s1q8/raM2eLem61MFv9/ n2O1OHRyLqPF7MY+Rov1Ww+wOwh4XO7rZfLYtKqTzWPTp0nsHidm/Gbx2D93DbvH8p0mHu/3 XWXz6NuyitHjzIIj7B6fN8kFcEWl2mSkJqakFimk5iXnp2TmpdsqeQfHO8ebmhkY6hpaWpgr KeQl5qbaKrn4BOi6ZeYAfaKkUJaYUwoUCkgsLlbSt7Mpyi8tSVXIyC8usVWKNjQ00jM0MNcz MjLSMzGNtTIyBSpJSM14tM244DB/xe/V81gbGJfxdDFyckgImEic7rjD2sXIxSEksJtRYlLP JqYuRg4OXgFBib87hEFqhAUiJY7MfM8IYgsJKEpcmLGGEaREWMBA4tdWDZAwm4CexKpde1hA bBEBFYn1fXfYQUYyCzxklXh6/wgzxC5eiRntT1kgbGmJ7cu3gs3kFLCV2HL3DStEXFTiTwNM jZzEtK9rmGHi74/NZ4SwRSRa752FigtKPPi5GyouI7F6cy8LyGIJgW5GiWuH/zFDOMsZJRof noaqMpc4f3I+WDevgK/E6ffP2EFsFgFVib2v90NNdZG4N28SmM0sIC+x/e0cZpCPmQU0Jdbv 0ocokZWYemodE4RtKzGldwsbRDmfRO/vJ0wwD++YB2OrSrTc3MAK8/znjx9ZJjAqz0IE9Swk y2YhLFvAyLyKUTK1oDg3PbXYtMAwL7Vcrzgxt7g0L10vOT93EyM4RWt57mCcdc7nEKMAB6MS D2/BI7EoIdbEsuLK3EOMEhzMSiK88k+BQrwpiZVVqUX58UWlOanFhxhNgd6eyCwlmpwPzB95 JfGGJpYGJmZm5oYGBpYmSuK8x3aWRgoJpCeWpGanphakFsH0MXFwSjUwrjuccaFzyp/nJne8 8i+EhtZMaN3+yeKx3AeRilMRf/5nPnO69GPJrH9l9lI8T08tXCzzKFp9779bTcUsF7Isf62I 0jgdO/Wc6sL0yz5dMy7Jhy1/PK8lhO38enGGxwo8JgoB+789UF3w4IPTqhiWmx6aBZWTo7u+ 3027X/Zo97r5SzxdVx7tnK/EUpyRaKjFXFScCADh6g5a5wMAAA== DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20171122105142epcas5p173b7205da12e1fc72e16ec74c49db665 X-RootMTR: 20171122105142epcas5p173b7205da12e1fc72e16ec74c49db665 References: <20171123162835.6prpgrz3qkdexx56@dhcp22.suse.cz> <1511347661-38083-1-git-send-email-maninder1.s@samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Michal, > On Wed 22-11-17 16:17:41, Maninder Singh wrote: > > This patch provides interface to check all the stack enteries > > saved in stackdepot so far as well as memory consumed by stackdepot. > > > > 1) Take current depot_index and offset to calculate end address for one > > iteration of (/sys/kernel/debug/depot_stack/depot_entries). > > > > 2) Fill end marker in every slab to point its end, and then use it while > > traversing all the slabs of stackdepot. > > > > "debugfs code inspired from page_onwer's way of printing BT" > > > > checked on ARM and x86_64. > > $cat /sys/kernel/debug/depot_stack/depot_size > > Memory consumed by Stackdepot:208 KB > > > > $ cat /sys/kernel/debug/depot_stack/depot_entries > > stack count 1 backtrace > > init_page_owner+0x1e/0x210 > > start_kernel+0x310/0x3cd > > secondary_startup_64+0xa5/0xb0 > > 0xffffffffffffffff > > Why do we need this? Who is goging to use this information and what for? > I haven't looked at the code but just the diffstat looks like this > should better have a _very_ good justification to be considered for > merging. To be honest with you I have hard time imagine how this can be > useful other than debugging stack depot... This interface can be used for multiple reasons as: 1) For debugging stackdepot for sure. 2) For checking all the unique allocation paths in system. 3) To check if any invalid stack is coming which is increasing stackdepot memory. (https://lkml.org/lkml/2017/10/11/353) Althoutgh this needs to be taken care in ARM as replied by maintainer, but with help of this interface it was quite easy to check and we added workaround for saving memory. 4) At some point of time to check current memory consumed by stackdepot. 5) To check number of entries in stackdepot to decide stackdepot hash size for different systems. For fewer entries hash table size can be reduced from 4MB. Thanks Maninder Singh From 1584874989254914530@xxx Thu Nov 23 16:29:31 +0000 2017 X-GM-THRID: 1584763196629983480 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread