lkml.org 
[lkml]   [2019]   [May]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 2/2] livepatch: Use static buffer for debugging messages under rq lock
On Tue, Apr 30, 2019 at 11:10:49AM +0200, Petr Mladek wrote:
> klp_try_switch_task() is called under klp_mutex. The buffer for
> debugging messages might be static.

The patch description is missing a "why" (presumably to reduce stack
usage).

>
> Signed-off-by: Petr Mladek <pmladek@suse.com>
> ---
> 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 8e0274075e75..d66086fd6d75 100644
> --- a/kernel/livepatch/transition.c
> +++ b/kernel/livepatch/transition.c
> @@ -304,11 +304,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';
>
> @@ -351,7 +351,6 @@ static bool klp_try_switch_task(struct task_struct *task)
> pr_debug("%s", err_buf);
>
> return success;
> -
> }
>
> /*
> --
> 2.16.4
>

--
Josh

\
 
 \ /
  Last update: 2019-05-07 02:43    [W:0.155 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site