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.2 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 CAD49C3E8C5 for ; Fri, 27 Nov 2020 19:06:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3FD38221F1 for ; Fri, 27 Nov 2020 19:06:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3FD38221F1 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 AAFE76B0036; Fri, 27 Nov 2020 14:06:40 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A84E46B005C; Fri, 27 Nov 2020 14:06:40 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 99BB86B0068; Fri, 27 Nov 2020 14:06:40 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0208.hostedemail.com [216.40.44.208]) by kanga.kvack.org (Postfix) with ESMTP id 83E6F6B0036 for ; Fri, 27 Nov 2020 14:06:40 -0500 (EST) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 4F2E51EF1 for ; Fri, 27 Nov 2020 19:06:40 +0000 (UTC) X-FDA: 77531129760.07.dirt99_030192a2738a Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin07.hostedemail.com (Postfix) with ESMTP id 3657818062973 for ; Fri, 27 Nov 2020 19:06:40 +0000 (UTC) X-HE-Tag: dirt99_030192a2738a X-Filterd-Recvd-Size: 4077 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf36.hostedemail.com (Postfix) with ESMTP for ; Fri, 27 Nov 2020 19:06:39 +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 7D4F5AC0C; Fri, 27 Nov 2020 19:06:38 +0000 (UTC) Subject: Re: [PATCH] mm/page_owner: Record timestamp and pid To: Georgi Djakov , Andrew Morton Cc: linux-mm@kvack.org, 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: Date: Fri, 27 Nov 2020 20:06:38 +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: <3ef3d770-d74b-5588-6672-f092c1526461@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable 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 7:57 PM, Georgi Djakov wrote: > Hi Vlastimil, >=20 > Thanks for the comment! >=20 > 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 =20 >>> 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.=C2=A0 = What >>> has it been used for, what problems has it been used to solve? >>=20 >> Worth noting that on x86_64 it doubles the size of struct page_owner >> from 16 bytes to 32, so it better be justified: >=20 > Well, that's true. But for debug options there is almost always some pe= nalty. > 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 inf= ormation > from kdump (or RAM-dump) and look into it to catch memory allocation pr= oblems > 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 e= xactly=20 the space tradeoff is :) You can also mention that SLUB object tracking has also pid+timestamp. > Thanks, > Georgi >=20 >>=20 >> struct page_owner { >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 short unsigned int=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 order;=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /*=C2=A0=C2= =A0=C2=A0=C2=A0 0=C2=A0=C2=A0=C2=A0=C2=A0 2 */ >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 short int=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 last_migrate_reason;=C2=A0 /*=C2=A0=C2=A0=C2=A0=C2=A0 2=C2=A0=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