From patchwork Thu Apr 1 21:24:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Trofimovich X-Patchwork-Id: 12179587 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=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 A7641C433B4 for ; Thu, 1 Apr 2021 21:24:54 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 35272610F7 for ; Thu, 1 Apr 2021 21:24:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 35272610F7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gentoo.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id BC8B76B00C1; Thu, 1 Apr 2021 17:24:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B7AF66B00C3; Thu, 1 Apr 2021 17:24:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9F32B6B00C4; Thu, 1 Apr 2021 17:24:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0230.hostedemail.com [216.40.44.230]) by kanga.kvack.org (Postfix) with ESMTP id 7ECEA6B00C1 for ; Thu, 1 Apr 2021 17:24:53 -0400 (EDT) Received: from smtpin32.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 44890181D028C for ; Thu, 1 Apr 2021 21:24:53 +0000 (UTC) X-FDA: 77985078066.32.696ECFD Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by imf10.hostedemail.com (Postfix) with ESMTP id 90C2B40002C1 for ; Thu, 1 Apr 2021 21:24:51 +0000 (UTC) Received: by sf.home (Postfix, from userid 1000) id 4C2B85A22061; Thu, 1 Apr 2021 22:24:47 +0100 (BST) From: Sergei Trofimovich To: Andrew Morton Cc: linux-kernel@vger.kernel.org, Sergei Trofimovich , linux-mm@kvack.org Subject: [PATCH] mm: page_owner: fetch backtrace only for tracked pages Date: Thu, 1 Apr 2021 22:24:45 +0100 Message-Id: <20210401212445.3534721-1-slyfox@gentoo.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 90C2B40002C1 X-Stat-Signature: rcsocdfzsr9y6gd4y4qitfhgn13q8313 Received-SPF: none (gentoo.org>: No applicable sender policy available) receiver=imf10; identity=mailfrom; envelope-from=""; helo=smtp.gentoo.org; client-ip=140.211.166.183 X-HE-DKIM-Result: none/none X-HE-Tag: 1617312291-746459 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: Very minor optimization. CC: Andrew Morton CC: linux-mm@kvack.org Signed-off-by: Sergei Trofimovich Acked-by: Vlastimil Babka --- mm/page_owner.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/page_owner.c b/mm/page_owner.c index 63e4ecaba97b..7147fd34a948 100644 --- a/mm/page_owner.c +++ b/mm/page_owner.c @@ -140,14 +140,14 @@ void __reset_page_owner(struct page *page, unsigned int order) { int i; struct page_ext *page_ext; - depot_stack_handle_t handle = 0; + depot_stack_handle_t handle; struct page_owner *page_owner; - handle = save_stack(GFP_NOWAIT | __GFP_NOWARN); - page_ext = lookup_page_ext(page); if (unlikely(!page_ext)) return; + + handle = save_stack(GFP_NOWAIT | __GFP_NOWARN); for (i = 0; i < (1 << order); i++) { __clear_bit(PAGE_EXT_OWNER_ALLOCATED, &page_ext->flags); page_owner = get_page_owner(page_ext);