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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8E58C4332F for ; Wed, 23 Nov 2022 08:55:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236743AbiKWIzk (ORCPT ); Wed, 23 Nov 2022 03:55:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236745AbiKWIzj (ORCPT ); Wed, 23 Nov 2022 03:55:39 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C644EA114 for ; Wed, 23 Nov 2022 00:55:38 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B6050B81EEE for ; Wed, 23 Nov 2022 08:55:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 13C7DC433D7; Wed, 23 Nov 2022 08:55:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1669193735; bh=mu0JIuaMcBKooKCGZBwNhXXR8axihi2WrmkchpTiRDM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0Pbe4wRKw6jKPnos/F+b3tX92wVTerkB3S4DEOslj7Afa1eSTXWTRh9j+odqWW8tB 0S1amW4WTTt9Fd/kZrpTvWu/TPbFCRMQt/Xq1c76Se0p1DYwTEkP1Oszf3rcm5Ce8r cTVQLXStxNefAI4oTmiHsT9ckPrIbCYizhpYcS5Y= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, mhiramat@kernel.org, mark.rutland@arm.com, Wang Wensheng , "Steven Rostedt (Google)" Subject: [PATCH 4.9 46/76] ftrace: Fix the possible incorrect kernel message Date: Wed, 23 Nov 2022 09:50:45 +0100 Message-Id: <20221123084548.256179413@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221123084546.742331901@linuxfoundation.org> References: <20221123084546.742331901@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Wang Wensheng commit 08948caebe93482db1adfd2154eba124f66d161d upstream. If the number of mcount entries is an integer multiple of ENTRIES_PER_PAGE, the page count showing on the console would be wrong. Link: https://lkml.kernel.org/r/20221109094434.84046-2-wangwensheng4@huawei.com Cc: Cc: Cc: stable@vger.kernel.org Fixes: 5821e1b74f0d0 ("function tracing: fix wrong pos computing when read buffer has been fulfilled") Signed-off-by: Wang Wensheng Signed-off-by: Steven Rostedt (Google) Signed-off-by: Greg Kroah-Hartman --- kernel/trace/ftrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -5177,7 +5177,7 @@ void __init ftrace_init(void) } pr_info("ftrace: allocating %ld entries in %ld pages\n", - count, count / ENTRIES_PER_PAGE + 1); + count, DIV_ROUND_UP(count, ENTRIES_PER_PAGE)); last_ftrace_enabled = ftrace_enabled = 1;