Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp551662ybi; Fri, 31 May 2019 05:39:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqzK8zVSJ+n/nMVHZh5m/zpb+cgZXAqrmQEYMJrPOrTk3IMbXDyIPgR3sEL1VYpIzWqqJk0T X-Received: by 2002:a17:902:347:: with SMTP id 65mr9455812pld.232.1559306360833; Fri, 31 May 2019 05:39:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559306360; cv=none; d=google.com; s=arc-20160816; b=gBlW+L0m/Qu540hCgLVahNMgZVS4vWsoqV2MpAEXSWDf41TnRoPb8mk7spfVu8q8tt /w/urYXoNClH7LfwGFEsS187s3V2SlEYlNGmZVS35xtKsWlLnXGAERbLKOtmAVvYA6q7 +plH5OPweAc+bi9lnAzvjTkxbk+CHDweqrcBYD7xqcFJaFUuGZCNHN3vQo8CzhgXxJO9 BxkOMOscLzOPvSfxtcgYxq5ZYghQNdddIWlVQCLgPR2eA9O+1ZMSRAP3hAAH+5Fue0kd DMvCeJxUrA0O/zltVdXuIu32E/Nz5tHAfcQ/kgvlA7+vj0aR51z9EX2Olv7ab0b469qy 0RTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=pAJWFs+y4kvvAy5+0q5D/thUSWcyl0hPa5xy0Acr6Jk=; b=Wk28IOgKRjCd34NChuI82XsnG0TzRHO8togfPFHfKuty3HKF98y4CxlgOjp0c6qbB2 tqCKk6KF2eZtdaEv0Oq0px5CUOezvFRhRsy8sZkB5mPxCniDfNUyLgWsznsEYJ88rOSq 81WMVuYLz9jRiex4DBRJK4AJ4Ho5Alld0i2sV9Ncsy0/ARChHm0qn7f9IVOz99Rw9/VW EcQdrdwM5uaabht4zYzMZ1PNx3KF5XC2vD1x+AGyYYnz5A9q+8pKcHOWW8YPMH/hdL15 yJ4kpmWKktWDSCBRX6uU/N4lXX/rKLtyQ7N6kCLR8WMigvJBp2Fi+cz5tCv0jnTrIqtS QKmg== 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 t141si6714305pfc.236.2019.05.31.05.39.03; Fri, 31 May 2019 05:39:20 -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 S1727107AbfEaMhy (ORCPT + 99 others); Fri, 31 May 2019 08:37:54 -0400 Received: from mx2.suse.de ([195.135.220.15]:35664 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726233AbfEaMhy (ORCPT ); Fri, 31 May 2019 08:37:54 -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 2DA53AD9C; Fri, 31 May 2019 12:37:53 +0000 (UTC) Date: Fri, 31 May 2019 14:37:52 +0200 (CEST) From: Miroslav Benes To: Petr Mladek cc: Jiri Kosina , Josh Poimboeuf , Joe Lawrence , Kamalesh Babulal , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/3] livepatch: Use static buffer for debugging messages under rq lock In-Reply-To: <20190531074147.27616-4-pmladek@suse.com> Message-ID: References: <20190531074147.27616-1-pmladek@suse.com> <20190531074147.27616-4-pmladek@suse.com> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 31 May 2019, Petr Mladek wrote: > 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; > - > } This could go in separately as it is not connected to the rest of the series. Miroslav