From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C13D3C64E90 for ; Mon, 30 Nov 2020 12:04:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 32DBB206D8 for ; Mon, 30 Nov 2020 12:04:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 32DBB206D8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7B1E36B0036; Mon, 30 Nov 2020 07:04:08 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 711238D0002; Mon, 30 Nov 2020 07:04:08 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 53BCA8D0001; Mon, 30 Nov 2020 07:04:08 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0222.hostedemail.com [216.40.44.222]) by kanga.kvack.org (Postfix) with ESMTP id 356996B0036 for ; Mon, 30 Nov 2020 07:04:08 -0500 (EST) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id F29D8181AEF2A for ; Mon, 30 Nov 2020 12:04:07 +0000 (UTC) X-FDA: 77540951334.05.event45_0814d22273a1 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin05.hostedemail.com (Postfix) with ESMTP id CDA0E18032813 for ; Mon, 30 Nov 2020 12:04:07 +0000 (UTC) X-HE-Tag: event45_0814d22273a1 X-Filterd-Recvd-Size: 4645 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf01.hostedemail.com (Postfix) with ESMTP for ; Mon, 30 Nov 2020 12:04:07 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 07553AE8C; Mon, 30 Nov 2020 12:04:06 +0000 (UTC) Subject: Re: [PATCH] mm/page_owner: Record timestamp and pid To: Souptick Joarder Cc: Georgi Djakov , Andrew Morton , Linux-MM , linux-kernel@vger.kernel.org, sudaraja@codeaurora.org, pratikp@codeaurora.org, lmark@codeaurora.org References: <20201112184106.733-1-georgi.djakov@linaro.org> <20201112111436.c5deeadd3578877fc0b844a1@linux-foundation.org> <02f682e2-0e9b-76a8-04fa-487891e18bdf@suse.cz> <3ef3d770-d74b-5588-6672-f092c1526461@linaro.org> From: Vlastimil Babka Message-ID: <43993267-7644-3553-8d1f-53f2f39909a6@suse.cz> Date: Mon, 30 Nov 2020 13:04:05 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 11/27/20 8:23 PM, Souptick Joarder wrote: > On Sat, Nov 28, 2020 at 12:36 AM Vlastimil Babka wrote: >> >> On 11/27/20 7:57 PM, Georgi Djakov wrote: >> > Hi Vlastimil, >> > >> > Thanks for the comment! >> > >> > On 11/27/20 19:52, Vlastimil Babka wrote: >> >> On 11/12/20 8:14 PM, Andrew Morton wrote: >> >>> On Thu, 12 Nov 2020 20:41:06 +0200 Georgi Djakov >> >>> wrote: >> >>> >> >>>> From: Liam Mark >> >>>> >> >>>> Collect the time for each allocation recorded in page owner so that >> >>>> allocation "surges" can be measured. >> >>>> >> >>>> Record the pid for each allocation recorded in page owner so that >> >>>> the source of allocation "surges" can be better identified. >> >>> >> >>> Please provide a description of why this is considered useful. What >> >>> has it been used for, what problems has it been used to solve? >> >> >> >> Worth noting that on x86_64 it doubles the size of struct page_owner >> >> from 16 bytes to 32, so it better be justified: >> > >> > Well, that's true. But for debug options there is almost always some penalty. >> > The timestamp and pid information is very useful for me (and others, i believe) >> > when doing memory analysis. On a crash for example, we can get this information >> > from kdump (or RAM-dump) and look into it to catch memory allocation problems >> > more easily. >> >> Right. Btw, you should add printing the info to __dump_page_owner(). >> >> > If you find the above argument not strong enough, how about a separate config >> > option for this? Maybe something like CONFIG_PAGE_OWNER_EXTENDED, which could >> > be enabled in addition to CONFIG_PAGE_OWNER? >> >> It might be strong enough if it's mentioned in changelog, and also what exactly >> the space tradeoff is :) > > Just a thought ... putting it inside CONFIG_PAGE_OWNER_DEBUG might be > better if it is used > purely for debugging purposes. I don't think we need to introduce new config just yet, until someone makes the case for it. Even then, it could be instead doable as an extension to "page_owner=on" boot option. I mean let's add those fields, but improve the changelog. >> >> You can also mention that SLUB object tracking has also pid+timestamp. >> >> > Thanks, >> > Georgi >> > >> >> >> >> struct page_owner { >> >> short unsigned int order; /* 0 2 */ >> >> short int last_migrate_reason; /* 2 2 */ >> >> gfp_t gfp_mask; /* 4 4 */ >> >> depot_stack_handle_t handle; /* 8 4 */ >> >> depot_stack_handle_t free_handle; /* 12 4 */ >> >> u64 ts_nsec; /* 16 8 */ >> >> int pid; /* 24 4 */ >> >> >> >> /* size: 32, cachelines: 1, members: 7 */ >> >> /* padding: 4 */ >> >> /* last cacheline: 32 bytes */ >> >> }; >> >> >> > >> >> >