Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp259858ybi; Fri, 31 May 2019 00:44:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqy7Fz8VcOmRsvz+8acOVnMax+R9oAnZBWNMjST0G3XrYbJrUE1T2ncCGY8hN0x/RSlJQPSl X-Received: by 2002:a17:902:4381:: with SMTP id j1mr7546790pld.286.1559288686906; Fri, 31 May 2019 00:44:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559288686; cv=none; d=google.com; s=arc-20160816; b=0x6Rl7Y4Ous5dH+IyWh8wn+wl8tHkV2GthX6tJLzBrd1XY5iFgc25kZ6GJGKFSD8Bz ItrWEvbH8KYpc4VD5YyZZjrGOiJ/FKQnD3r3xduv1X8yhPLzVanCLDjyriVOqStlQBwY C0mJAhFMd8owFF15es7Mb2GGtCHLo4l1HA/9BJanquRCtY7Zi6gWlXKEuYt1oY+m0zWu na9y1mn9a+ekGgwQhnENlYZr6KxW73m94DPSlVOsZFZk2Rh67VEiZqUJGs98R7rTKaTT Lx6+71Zsmwu8+hVUKnnPzWaAN9xQS4dI3k9R3YciL1nG9NhQ8rQrw9mouk+fyO8XmdHh gpeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=vRGf47G2LYOlkSixUVI2QFw+/zXAz29UHKaY7XGu/g0=; b=JkYS5aJcK7NeMNtRJm/X9X5POtbF6dxI9r9TttinTOyUUXqobzl9tRxrgR93CObXVY 7eyg8ZLXlIC8+h0qHlJ2+4/0/yTHzBf/n7VVtimvBwAYL2t2QuOuDoFLIKIbcp/xip8X b64XVtk0XRzmFhoKQ0wn8FsxisCRUK397XJr2baO1kBok3PoOvyIHsZUAIuCNSQc3M7V mxJcR/oOm1yDvGnV1RDWbZ304GYfv+yRt81DToP3Doq0Mh92c+ujD4YC1VaMAB293VEE 89FvD/PJa/nyKcAExnDGu9Ij5ZToVGCtuileMAN04oFsILN2ck9LLU/Qzc5dNtlbfFsW 7I2w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v21si5417464pfm.18.2019.05.31.00.44.30; Fri, 31 May 2019 00:44:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727032AbfEaHmP (ORCPT + 99 others); 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