From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8AEAE1C29 for ; Wed, 23 Nov 2022 09:23:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F0EDAC433D6; Wed, 23 Nov 2022 09:23:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1669195435; bh=J4MDbTTuIXWgJ6NcQ5/gZug/0EAKuRdUgjJIwSYfRe0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YADmX2L4cEVq+iQ9abyVF6hx2s+PaMz9u7DeTAnKmUOojR1wDIzqnjeotM4pJ9TN9 bHnbacvUS8/nJxhtWgmIJBz1+9wUbEMoL7JNMUd+ytct9NP9lRXZdu5CL1OFH8l4GM ccOlE5nOzRUBh5iBw5NGF9ompLYUq1pIr5Ebx5/s= 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 5.10 083/149] ftrace: Optimize the allocation for mcount entries Date: Wed, 23 Nov 2022 09:51:06 +0100 Message-Id: <20221123084600.967766759@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221123084557.945845710@linuxfoundation.org> References: <20221123084557.945845710@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Wang Wensheng commit bcea02b096333dc74af987cb9685a4dbdd820840 upstream. If we can't allocate this size, try something smaller with half of the size. Its order should be decreased by one instead of divided by two. Link: https://lkml.kernel.org/r/20221109094434.84046-3-wangwensheng4@huawei.com Cc: Cc: Cc: stable@vger.kernel.org Fixes: a79008755497d ("ftrace: Allocate the mcount record pages as groups") 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 @@ -3178,7 +3178,7 @@ static int ftrace_allocate_records(struc /* if we can't allocate this size, try something smaller */ if (!order) return -ENOMEM; - order >>= 1; + order--; goto again; }