Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1635008pxu; Fri, 27 Nov 2020 11:30:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJx7BXtZdIch/1NaGgEya+KJBwfo5LSsTvJMgwZeF0E82DL4S0xE6pmh7/33uSboNmFiTYHT X-Received: by 2002:a17:906:4482:: with SMTP id y2mr9410030ejo.342.1606505444881; Fri, 27 Nov 2020 11:30:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606505444; cv=none; d=google.com; s=arc-20160816; b=Zern6Gs3GLc5NEUE1gQIh6/e4aSjYVm9ebXvDxkCkvS+XaRvWS531OH6jVRbs0HrJ5 vAd3x35GGpHt5WsDnskFkbjPGbl00txe5lMSOHfxlnp7pu3uJ0AplQz/bciaGgfoFfW0 UI9ZtUedmXtR2hkRqxk61UNssKwGsvd2BIs3M5HXl0oaDXA6bI75Dz7ngBVhQDTTsoIK t880sh9G7yTa6oUH7zgvTv4QJSYvpwss4TsqvBDP9tLQeuLhK9daPflwtAsMPSJd9Xs4 06Q9oriGk8OKxLBdLN/BISr5964yU13MpvDKb91NwzDgTJ/14lOfkWUH8fQ/OY/ZIAck oNOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:date:message-id:subject:from:references:cc :to:dkim-signature; bh=/aqzWfKAyZcFADuzDmYKakUb1PJhvmbjruHjYS0Occc=; b=ImcDtlTpDUM15ko3YQ9aabdxYQHYrd42w84aGRc7XopczY8lO+Sqhm6WTl4Rw8Qlcf Jrlqxa6dJ5F473ouGGTu9WvPkJ//EBvbroErHUr9saqP8Ndu3CyrrUUbdewPsu9D9wj3 F2JygTlN/sKiNuIqtrTQCmIC7SUyT48OkBwj+mFD8KzuHlNo2fCrN4HOPDNVt8uUwXwq WKZLpnO3N1zjIaVQxOJQUov40gtC+Pu5mMLjhp++Su3Dytmjjcm4wsGfkZxf/Sw4aiKW sRF2E0e58sCpoL8B8ASWe4XG4ThqKlOKPkQn1rOw/2WWeZzQ39Q8/tLYgWVwr1Jqtx7S nIuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ih8vraZG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g8si5509726edq.97.2020.11.27.11.30.22; Fri, 27 Nov 2020 11:30:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ih8vraZG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729783AbgK0S7O (ORCPT + 99 others); Fri, 27 Nov 2020 13:59:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729695AbgK0S5t (ORCPT ); Fri, 27 Nov 2020 13:57:49 -0500 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFF29C0613D1 for ; Fri, 27 Nov 2020 10:57:43 -0800 (PST) Received: by mail-wr1-x441.google.com with SMTP id 64so6567260wra.11 for ; Fri, 27 Nov 2020 10:57:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=to:cc:references:from:subject:message-id:date:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=/aqzWfKAyZcFADuzDmYKakUb1PJhvmbjruHjYS0Occc=; b=ih8vraZG1vXAUFx2hRFOZ5rIXLALstaSd60XXbEPnNEObAiJpUoNcFNLws29clecY/ 6L2SgdyOSVIRG5ZIn/nHDAwEjwn2xE37bkPDpzoCPwXj108q4OukQ4lwjpxDI0y9v+ao 1MJTLrDRE5zLzFRfPaPrt29PzXThuIAfFHfCywcCmPVg7IeFuu0XPIwArUXcHe5rk1NY mAYaW6ilg/ErRdbLbKvQuZOdrHeMUNfKh+q8NWwp71m3zyveas/5ijnzC3JI4lMgXz0J wkCl9r5027lWbRqKFQREty2dSE/SnHjy9kRbN/o9kqsW+5hOZ6uzAzHuTx6B8sLfUPh3 rqwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:references:from:subject:message-id:date :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=/aqzWfKAyZcFADuzDmYKakUb1PJhvmbjruHjYS0Occc=; b=pVnSqujhdJUDs6LbxN0XN9fmz/zYMnuFNveq4psinF2vdmLZTOYF+C5Li16tspWpXE mkw/S14WTPRUOGULZoI5qZzj0z8ijqclur/S/r0HxbC21cDj8mJNeAgI3jDp8sLd/eQG y6X7GMWQwxNTM7MvB+uE0ZOlQ3ULZf+8XEaCjzc+DV8l2HPSkm4IyvMX8XueVYIaCJ0r spj8sKVdDT/meI4k2vCHz2si60M1lB1rcfuuwUuiSawoUakpuyoN+9AL7gvrPeaelm3v JurhqZ2JrPkAu4+/O4TungWbXjrr/XjEuK0XmPKwDvObvOukK6Z8cHLzqLjuE7OfjN/I ejjw== X-Gm-Message-State: AOAM530Yu9hxbCGoBdCO/E7vEbU4SUIqm6perz8/W66FQG3fJ2xnW0e8 A0IyFLrQxkA/adXhZrp8qjFiYQ== X-Received: by 2002:adf:a54d:: with SMTP id j13mr12679404wrb.132.1606503462658; Fri, 27 Nov 2020 10:57:42 -0800 (PST) Received: from [10.44.66.8] ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id h4sm15769103wrq.3.2020.11.27.10.57.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 27 Nov 2020 10:57:41 -0800 (PST) To: Vlastimil Babka , 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> From: Georgi Djakov Subject: Re: [PATCH] mm/page_owner: Record timestamp and pid Message-ID: <3ef3d770-d74b-5588-6672-f092c1526461@linaro.org> Date: Fri, 27 Nov 2020 20:57:43 +0200 MIME-Version: 1.0 In-Reply-To: <02f682e2-0e9b-76a8-04fa-487891e18bdf@suse.cz> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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? 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 */ > }; >