From patchwork Tue Sep 24 08:50:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenqiwu X-Patchwork-Id: 13810516 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 987F6CF9C71 for ; Tue, 24 Sep 2024 08:50:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2B77F6B00A0; Tue, 24 Sep 2024 04:50:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 267A76B00A2; Tue, 24 Sep 2024 04:50:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 12F996B00A6; Tue, 24 Sep 2024 04:50:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id E3A946B00A0 for ; Tue, 24 Sep 2024 04:50:17 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 3BE4A12185A for ; Tue, 24 Sep 2024 08:50:17 +0000 (UTC) X-FDA: 82599010074.09.786E1A0 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) by imf23.hostedemail.com (Postfix) with ESMTP id 6B46614000E for ; Tue, 24 Sep 2024 08:50:15 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="fp/tZ4mp"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf23.hostedemail.com: domain of qiwuchen55@gmail.com designates 209.85.214.176 as permitted sender) smtp.mailfrom=qiwuchen55@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727167719; a=rsa-sha256; cv=none; b=aIkVA7gFhrhWxEBmDsOrCE+cLgmJOPg7yogvTgDcxdpdnlPyBp248Oq8KRe2Fz21fofBom Y4aTOyZj4lIMXiTp49SAxEMxF0hQgqLiSHwEZ60pM5JTHke2gAohnp1nocPbdSpejedzqU m5RlQoRS5jwZB4tcZXzgfi8BAuSucoY= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="fp/tZ4mp"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf23.hostedemail.com: domain of qiwuchen55@gmail.com designates 209.85.214.176 as permitted sender) smtp.mailfrom=qiwuchen55@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1727167719; 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=65Pc8Ut35P5CoeN48Nr1lauZaLUVyWrHlrZcEoNxyNw=; b=WQInRqs5NtMpZug0JkDZizdUqyxtZrbvHd0w6H2lgDje/5WvLJybSRiApaFEtwKjGnE36Z OPmLiHZewNjBkVJP3yXm4qL6elSdXPeiLkF+VOdnO/mIwqp+aV/UpOCpqQ1LY6ik4W1WRx qrDmpei7N3C/kAIkLGJrV5/HseRmteE= Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-2055136b612so63421035ad.0 for ; Tue, 24 Sep 2024 01:50:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727167814; x=1727772614; darn=kvack.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=65Pc8Ut35P5CoeN48Nr1lauZaLUVyWrHlrZcEoNxyNw=; b=fp/tZ4mpQUXebAiWV5k2GHGa4ZpvaG+MQhNvScAFDElUqrUGgsIfcZro8Oc8xClocq vxV5UsCP5+Cb6ESDY3gwqeUDONj/+sq+64CMLGujbuVAGPO0nItLg7MLtzSHefh6TzrX 2lomOU3O/XP2SblOMxBHQQpdImZIZpgTqQTsPS7CvpGye9PPbYdp9qALWK8ZsPm5cD6s 5ImnYFdZy9jKuAlxvPHVq7i3MGzzgRacsn95SPAy5y+XGT8iIEMS7YrJ7BzXAfjnRF/d ugojOOX+6e0TDLg6rrVmLNL9H5/naFdoDaHD+le8Ww9kMbg4oi85oyUojN6+EYUHubKs BT9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727167814; x=1727772614; 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=65Pc8Ut35P5CoeN48Nr1lauZaLUVyWrHlrZcEoNxyNw=; b=buf9zkAOpwRaBwiXBQTFzA9/fIHdbmD5VUbk9Mm1i5y3E3xacWvDnqV66g4pgiUJ35 rhHbEey6HzTr7sKLWMyl8utpEvJXN398LLode/lBgdXW4E9cpH2ndjTYb+Snoe3C4egT Dkw9JHAguKnHHwTcOga3IPLnM/gWwba01RPAepozTEkwsC7M4djob4v3JMIAXVzjkzDc gOqz8hRNYsETfzY70fsleqkli/mL0uzdBxZeOrrrEOGYJBOa2YWo0X76hfytm2zNXoNd 4SFgZBcr5eB1UpV5Fp4tsqshTVLyoZq0DPY/fYTo6Dvg2u2xto6EeolUFHB3Od70qClc mQrQ== X-Gm-Message-State: AOJu0YyESB6YJJB+YpwiwVf5SKZzaEBLhJU6CPwfkJ/xbrRjmijIxl1L i8rqOyhsk6Ur5r0STx2xO0DZ64UGtzS4URIp/6+e1fP4OxhCOK2A X-Google-Smtp-Source: AGHT+IEtcWQy9IEmjRyQRPmH/aDZcOeRX/W8H+22tw++bZ/pMj39Un3yRPLk+sw6M9aqpFLjdv6yig== X-Received: by 2002:a17:903:22c3:b0:203:a279:a144 with SMTP id d9443c01a7336-208d9807ce7mr235608375ad.25.1727167814049; Tue, 24 Sep 2024 01:50:14 -0700 (PDT) Received: from localhost ([183.226.245.34]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20af16df873sm6757575ad.7.2024.09.24.01.50.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Sep 2024 01:50:13 -0700 (PDT) From: "qiwu.chen" X-Google-Original-From: "qiwu.chen" To: glider@google.com, elver@google.com, dvyukov@google.com, akpm@linux-foundation.org Cc: linux-mm@kvack.org, "qiwu.chen" Subject: [PATCH] mm: kfence: fix elapsed time for allocated/freed track Date: Tue, 24 Sep 2024 16:50:04 +0800 Message-Id: <20240924085004.75401-1-qiwu.chen@transsion.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 6B46614000E X-Stat-Signature: bn7sfaawy5oo1gt1ktq8u4pqbe5xmow5 X-Rspam-User: X-HE-Tag: 1727167815-322315 X-HE-Meta: U2FsdGVkX1/Xq3FNjG24cJ+4OhhjBuU1eYN3wtUyqnWSDVEo275K02ksSB2P94ep6lD3k27gUpBlNe7MnqRBnBs/dDHaJEZ17Dc/OOS6ycYThXxOw2an4xKu5CiTxOw03Sp3IwEyNMmHTDmu95H/GcjxX6YFqBNZ56HBXNOqGCKhijA00gXbue8iZkrNUxr/ZiAj0EidWsxu8VID5XH/SeEJMLKRdxjbgNjYcfxWOIS6sM+1QY9EUdHgHxpdCG/CoJMRHgH2O555zmUToiUxp+ChkzVPFDqciYkLLEYNcG0bSwguUELXRBGfIjF/ENaERt6/KeJVfhXza+wTW9hwdUkrLu8lOuz9i7eHW3m3DrgV2ZBcmUQtiZkR6OXFSYbpvzoTMdP7dF9T+4dPmGvSxcx1cpOaS64qRf43OTS6YTVk6brF6NBXd9Xp3OY4HR4jFAhnG39nxE52RhTIrr/OXuAMg5+/ZGGHTc3oXREz2YVJtkcUhlGyp2F+ItEQIVlul+7pGaLGrCo8w7xYRHQdz/ch3AGw4dxRSLkzk2kLMG/whiV6m4iv31//6p+dtOTNOlEwdkOy1gTm8p7dJ9/L1UDzdNsxgJan+qhR8waKJM/VLKPdx0sYwsyN+3X2kFw/eVFbDneW5gDSNZm6UaWwLJiXIRnlJy/9h199dL9ihANeO6+rDcWssEpvIt82xUNs6z5AvsjBeeuIvqyTx4hx80JCxyMuDyVSiCE4ZJ1VwJRMElpO+V06/3tVAnOu71K3sYW8F1vnmhFJjSbyx6ByKMWSO3yoQpWpdELZKZcpb/P/IsJS/3STjw9onTQMSwGmXqZzYqE0Y2VIyd2pFf+LP9JUpzsoJLsR5CJBEuxbpUmYtG2n1t9qCKb1NukMLArTZbdlh0OQVHH71kzsBNT0SSJwBCKdispkAxortGnULekk/X1VBf4Tj6wkchizjE4CB4B9I6Yo8rHVpCq4JAI SVgcJ6AK a99A/sgkLT/GeF6DG5Ikh7/+t4cK33Dv9lyGRKJcXsgk3Nu88Yejiq6KhRD0yZw6PB+zSAgm8i4oI1iZheGGzRNXHTSUN/31q9snkZmiqJXrYCijCrJaIFx9Bk2Xew0pR59sJQFf3HcEXdEknX8p1WOXSiAPquSKoY24cPXtfoWgpXiLafkPndQYNczoxQopmAn4dzYnpawklGTODml248P394Vp5+u8ggWslQ/W3wYSVxaaaSt/BSJc6XQ9oD4JD0NTjpNvvMILKZgh+0xwMoT4sr0zfvvVbz0LNSwYJ41a9IRd9bnXM5QzSlDCcc4fCVlWpA42SU0Prh3M5auGhwaXMsW6NgB4u8HZ1UKY4iCGgPRgLO5n/brFfTQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000480, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Fix elapsed time for the allocated/freed track introduced by commit 62e73fd85d7bf. Fixes: 62e73fd85d7bf ("mm: kfence: print the elapsed time for allocated/freed track") Signed-off-by: qiwu.chen Reviewed-by: Marco Elver --- mm/kfence/report.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/kfence/report.c b/mm/kfence/report.c index 451991a3a8f2..6370c5207d1a 100644 --- a/mm/kfence/report.c +++ b/mm/kfence/report.c @@ -109,7 +109,7 @@ static void kfence_print_stack(struct seq_file *seq, const struct kfence_metadat const struct kfence_track *track = show_alloc ? &meta->alloc_track : &meta->free_track; u64 ts_sec = track->ts_nsec; unsigned long rem_nsec = do_div(ts_sec, NSEC_PER_SEC); - u64 interval_nsec = local_clock() - meta->alloc_track.ts_nsec; + u64 interval_nsec = local_clock() - track->ts_nsec; unsigned long rem_interval_nsec = do_div(interval_nsec, NSEC_PER_SEC); /* Timestamp matches printk timestamp format. */