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 X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,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 AAF51C04AB6 for ; Fri, 31 May 2019 07:42:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 827512651F for ; Fri, 31 May 2019 07:42:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727040AbfEaHmP (ORCPT ); Fri, 31 May 2019 03:42:15 -0400 Received: from mx2.suse.de ([195.135.220.15]:41376 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726331AbfEaHmL (ORCPT ); Fri, 31 May 2019 03:42:11 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 2E6F0AE20; Fri, 31 May 2019 07:42:10 +0000 (UTC) From: Petr Mladek To: Jiri Kosina , Josh Poimboeuf , Miroslav Benes Cc: Joe Lawrence , Kamalesh Babulal , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, Petr Mladek Subject: [PATCH 3/3] livepatch: Use static buffer for debugging messages under rq lock Date: Fri, 31 May 2019 09:41:47 +0200 Message-Id: <20190531074147.27616-4-pmladek@suse.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190531074147.27616-1-pmladek@suse.com> References: <20190531074147.27616-1-pmladek@suse.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The err_buf array uses 128 bytes of stack space. Move it off the stack by making it static. It's safe to use a shared buffer because klp_try_switch_task() is called under klp_mutex. Signed-off-by: Petr Mladek Acked-by: Miroslav Benes Reviewed-by: Kamalesh Babulal --- kernel/livepatch/transition.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/livepatch/transition.c b/kernel/livepatch/transition.c index 1bf362df76e1..5c4f0c1f826e 100644 --- a/kernel/livepatch/transition.c +++ b/kernel/livepatch/transition.c @@ -280,11 +280,11 @@ static int klp_check_stack(struct task_struct *task, char *err_buf) */ static bool klp_try_switch_task(struct task_struct *task) { + static char err_buf[STACK_ERR_BUF_SIZE]; struct rq *rq; struct rq_flags flags; int ret; bool success = false; - char err_buf[STACK_ERR_BUF_SIZE]; err_buf[0] = '\0'; @@ -327,7 +327,6 @@ static bool klp_try_switch_task(struct task_struct *task) pr_debug("%s", err_buf); return success; - } /* -- 2.16.4