From patchwork Sat Jan 21 16:50:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hyeonggon Yoo <42.hyeyoo@gmail.com> X-Patchwork-Id: 13111169 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF0D3C004D4 for ; Sat, 21 Jan 2023 16:51:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B918E6B0072; Sat, 21 Jan 2023 11:51:23 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B41BE6B0073; Sat, 21 Jan 2023 11:51:23 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A09426B0074; Sat, 21 Jan 2023 11:51:23 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 8F4816B0072 for ; Sat, 21 Jan 2023 11:51:23 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 6663516058F for ; Sat, 21 Jan 2023 16:51:23 +0000 (UTC) X-FDA: 80379396846.01.F1A28D3 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by imf24.hostedemail.com (Postfix) with ESMTP id AE62D180003 for ; Sat, 21 Jan 2023 16:51:21 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="WEs/T877"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf24.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.214.174 as permitted sender) smtp.mailfrom=42.hyeyoo@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674319881; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=GZovHyG/JpUH+pY/fH2R14bs5kwFX52yjY42y0LexOA=; b=s+q+1WwjHXi3/tp4k1EfQiFK1kcsEkJTMPwV707aQqWsAGBcFQR+cxXA0mGmLtxZe0QayW gbRVzQG+UI8N49hLDM73uxWhQAFRebJ6FtVR2Fe0r5ntGGNt9UtCUGpbBlhssmZW4Qgvxm U9k0BfNPhBSc8dgAsTntN7FfMHtO7is= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="WEs/T877"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf24.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.214.174 as permitted sender) smtp.mailfrom=42.hyeyoo@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674319881; a=rsa-sha256; cv=none; b=WQ8E81mzuTtJhE3WjWOqyxJgG5AjvWYAbx/BAiu9+H1zmNlKmkde9j59xm5KQdYkzAMI5V uDftbgEfdpL+ui7fUgSMtoHSCCoRZL/Dj232nAV6g0dIx9GmmWtX/J2UzETDFPsPYpNVsM bH9tXnEWeMCI0jhUJyaf8bBDi8QIh/c= Received: by mail-pl1-f174.google.com with SMTP id k13so7943469plg.0 for ; Sat, 21 Jan 2023 08:51:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=GZovHyG/JpUH+pY/fH2R14bs5kwFX52yjY42y0LexOA=; b=WEs/T877kJvvj+Xt2ox/4hyjxSXspRn2vIszadiqsRFo6SRyPJuwdWNteiH0fCBTvj OjpRaVZPNwxHILhB1oOeBtQ/XWbvdCMnZaqHHx1l7EyFpGRfGcCIFgTkGH30esw50mn0 hRiazeumVwpD+RvVw+lhece0xaHuTvY+DdeTwrtwzXevrFFF+CsnPx0wDvYW9DplUdER iXsZaY7PYYwqnqBc13qeHVv4BpCWSFT5HXbK2jno4qUvx8Uk3/8b7FfxlpWmjJID2SRw NY7zlxlXS+eJ2GFdj2I8hJLCBD8AxoUMU1Rzr38XEHC9cxLe7G+CVeLwox6LrM2U+mNJ rGeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=GZovHyG/JpUH+pY/fH2R14bs5kwFX52yjY42y0LexOA=; b=PfhekAsV/PPLqApsNAWYswCWOwM4Zrf6lJqZRrT28ICoZq/hNoGnajolKHDpP3GYFQ yokvVoFEAp13AOoQIA4Ne3ojFTbpmVGrjpibI4oLaZUaVW3L3/+UkBhcg2RHVgZFVfKr bGx6xgOv7sBxmfghHNlodmHKy5DniXkuHA3M7xdgiByKPcDt7IJs1V4HC6mUaBmj/xRw Q/uCRvEO+YhbDGnbUqXXiHykTqYhj7XjuGLdsKFACLkQgPrIJXDx7AW3fVhN27StMM9Z 6TfepX+FqemXgFAhk7XUnyDRwNh59wHGsWYOvDpw4VkuPrq48XBYLlWEp8OOAiX9FLhE pJjQ== X-Gm-Message-State: AFqh2krk4S+qJ9I30ZonqwUzRenEYNassr7eaIgv61zwIR03sc4yuTDr FRyakCr4HisSMSTYddAyGVw= X-Google-Smtp-Source: AMrXdXtCS8p6EsQhK+/R5Q8h5CQtyDZ/9gAZRA+IzHhIqIfzJqxZO9uUJcK0+ZWK5IiyFVLtdu9FKA== X-Received: by 2002:a17:902:cec7:b0:191:3993:801e with SMTP id d7-20020a170902cec700b001913993801emr24925006plg.56.1674319880444; Sat, 21 Jan 2023 08:51:20 -0800 (PST) Received: from hyeyoo.. ([114.29.91.56]) by smtp.gmail.com with ESMTPSA id b11-20020a170902650b00b00194cf9d5fbcsm5113166plk.167.2023.01.21.08.51.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Jan 2023 08:51:19 -0800 (PST) From: Hyeonggon Yoo <42.hyeyoo@gmail.com> To: Andrew Morton Cc: Mike Rapoport , David Rientjes , Joonsoo Kim , Vlastimil Babka , Michal Hocko , David Hildenbrand , Hyeonggon Yoo <42.hyeyoo@gmail.com>, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH mm-unstable] mm/page_owner: record single timestamp value for high order allocations Date: Sun, 22 Jan 2023 01:50:54 +0900 Message-Id: <20230121165054.520507-1-42.hyeyoo@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Rspamd-Queue-Id: AE62D180003 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: iom1ob1fzsg4wfx1xznuki6za13nq75w X-HE-Tag: 1674319881-608946 X-HE-Meta: U2FsdGVkX1+pwui72RXuMhaUosoYq1eT4Ds66+OrgjHFES+Cpnu1L9vOp5weDm6Mqfr6UWrE+PnNNxbSKWnhdNzITEHk6Mwwj8zdWoi8KpEp1GWXnLa4fTnU2figg/BUv3+VHxb5twni0EPHxqfl6DQd3oUdgkiQdtCpmIWt8nyXDYPy817kdsWi9MQEoEisKHB+tQ27HKoABZTkPTvREChwM1w6dKcOGmuUpeBxxokYwK7Wr+uSUhTsY5QsBJj4k39ziY+eXXHslhzJIFkKs0UooEoahgix6CvcSqDVIXE6hqqc7AI17wr8DC7oet1Rvd3QpGznFwUGa9+uHcF2LhR1AGle1OWDvImkvwUz/NYtvi0e9z7A9N8RspmSIyhExArwM/FA3MhMBWiulm56wrP8ujUYOTnBFep6PaZjaDpytMwq/gVjZe8QzSEsWzrH1QkZZpGb0WyIVn7lXGkGMh8n1uqjoakuQnd9m9YgeaT/VzeZykIUUtFN9frqCYeUfbjW7HxQs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ter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: When allocating a high-order page, separate allocation timestamp is recorded for each sub-page resulting in different timestamp values between them. This behavior is not consistent with the behavior when recording free timestamp and caused confusion when analyzing memory dumps. Record single timestamp for the entire allocation, aligning with the behavior for free timestamps. Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Acked-by: Vlastimil Babka --- mm/page_owner.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/page_owner.c b/mm/page_owner.c index f0553bedb39d..80dc8f4050fa 100644 --- a/mm/page_owner.c +++ b/mm/page_owner.c @@ -163,6 +163,7 @@ static inline void __set_page_owner_handle(struct page_ext *page_ext, { struct page_owner *page_owner; int i; + u64 ts_nsec = local_clock(); for (i = 0; i < (1 << order); i++) { page_owner = get_page_owner(page_ext); @@ -172,7 +173,7 @@ static inline void __set_page_owner_handle(struct page_ext *page_ext, page_owner->last_migrate_reason = -1; page_owner->pid = current->pid; page_owner->tgid = current->tgid; - page_owner->ts_nsec = local_clock(); + page_owner->ts_nsec = ts_nsec; strscpy(page_owner->comm, current->comm, sizeof(page_owner->comm)); __set_bit(PAGE_EXT_OWNER, &page_ext->flags);