Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3737183yba; Tue, 7 May 2019 06:21:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqx5ouhH7+NqTPnpmgHMV3xJ7vw/bRCD3EtfvJ7aMqWeQ9ZAP6QMa9CfrEb9qU+WtvqSm+2Z X-Received: by 2002:a63:5d46:: with SMTP id o6mr39135104pgm.217.1557235309149; Tue, 07 May 2019 06:21:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557235309; cv=none; d=google.com; s=arc-20160816; b=HqKefxnOGsGZHFTY1RVZFggLZ9EuQHSb6FqUAeiqueLwqnD/5p1jptfK5AtxzVfKkp 5HnC2Iv5roWOGZYuGO6LlNn/U7V+a9Zdd8AJR8ZERspZdVTZW9TBI/J+omt5ZryDmfBR 1xQguZIhKwi9QZ77X4wBqUxBPRvAuQkBr8f5EP2Jm0WyS7o5bryfcLYOMLUH+t7P/3M/ CCGTFjXD6mLnaabLuQnvVp7CgEI9sfxzBDGMswCHO7LinkLhgHOH+R+Esh3DLOlZtGS/ wjewB+WYy/hRj7aUSbTFmrvV0KOfGOICzX0pr4uyaiypWwyZhSSlFUxdt2HP0j1QT9cu f9XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=139t8v01+LxNRuF3CpW3eiht2OWtZur2itbO8+JzyRg=; b=SGCl1QtatloqdkLKVHuzIIMDAMxa0W8AGIM4nGU0w75tdsUJX8IxlaF1sxlKEB9tmp fZUUoJd6F5IBujFjxW1ftKMyajqTerznRzMSx/PoZi0flQbeNZZcJjPQ2XFhZvkuILOb 3FeUjPjH87hpw2gf2qosgGhgxCky76IfJ2YbQmhRY0C9d60BDKEymQl4MyRiu0yxXxQG thr89TlKODocfS7sIEO5cKncmu6HDt0oovKn9WYyZBc4Qig6a8TsT5P/5INGkLlsalUp J1SCQC8CKPI0/dneiavPVVm3KJ4BIgCAludJUGDYpMiet52Ba5CoWPNCy0pkBH8NiNUh vJ/Q== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k3si20596469pgm.264.2019.05.07.06.21.32; Tue, 07 May 2019 06:21:49 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726688AbfEGNTQ (ORCPT + 99 others); Tue, 7 May 2019 09:19:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42890 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726426AbfEGNTQ (ORCPT ); Tue, 7 May 2019 09:19:16 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 231CE307D91F; Tue, 7 May 2019 13:19:16 +0000 (UTC) Received: from treble (ovpn-123-166.rdu2.redhat.com [10.10.123.166]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0519660C4E; Tue, 7 May 2019 13:19:09 +0000 (UTC) Date: Tue, 7 May 2019 08:19:07 -0500 From: Josh Poimboeuf To: Petr Mladek Cc: Jiri Kosina , Miroslav Benes , Joe Lawrence , Kamalesh Babulal , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/2] livepatch: Use static buffer for debugging messages under rq lock Message-ID: <20190507131907.ep5g2hi4hp2lvy3d@treble> References: <20190430091049.30413-1-pmladek@suse.com> <20190430091049.30413-3-pmladek@suse.com> <20190507004319.oxxncicid6pxg352@treble> <20190507115029.54qxbsd4vsouwvjo@pathway.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190507115029.54qxbsd4vsouwvjo@pathway.suse.cz> User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Tue, 07 May 2019 13:19:16 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 07, 2019 at 01:50:29PM +0200, Petr Mladek wrote: > On Mon 2019-05-06 19:43:19, Josh Poimboeuf wrote: > > 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). > > Exactly. I thought that it was obvious. But I am infected by printk > code where line buffers are 1k and nobody wants them on the stack. > > 128bytes in klp_try_switch_task() context are acceptable but > it is still rather big buffer. > > OK, what about the following commit message? > > "klp_try_switch_task() is called under klp_mutex. The buffer for > debugging messages might be static to reduce stack usage." It's better to use imperative language. It would also be good to reverse the order of the wording by starting with the problem. Something like: 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. -- Josh