Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp6006625ybh; Wed, 7 Aug 2019 15:28:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqyRf3HtPfSvNTMHuOLfLvGHhseWMRl0kAzyVrxPH0cfeL9LBXApPdIBeeHfTNJ3Xp76FzTC X-Received: by 2002:a17:90a:8d0c:: with SMTP id c12mr662331pjo.140.1565216907969; Wed, 07 Aug 2019 15:28:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565216907; cv=none; d=google.com; s=arc-20160816; b=kCU5cZd7hHR3XtU6abbOAmBfAFTPKnZU4DONac3PMnGPfI1ZEgyCPFiS3DH1L8f0i/ ayhew+/NifoakVvnJD0RsShZx5DsqGwfnCwRTOjxf5oyXbkDGGpgFuJhh9U/+TRKf/ht EvtNGQ2wURZNvSc+4EpGrIj2+cembQ9PsDgpTsMJhWvYQLEBoWJ57Y9l0rmsz6BWBoq+ HBOvVMIsOj+G5VQh4pAQiRtRXwMdsQFMz/Rj9hl9TUSk5+Bc1yKPjgqNi+lwTR5JDFML WH3ui/eo4BhAXhHCVUszdP26oZRmFCTXnguldcW04lmz5Hs8CVgqZeg1n5MoABjcw9tZ LfBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=1Q9xUnJ2KF33doUljMy7M+UWuL4xJSUZXd+LksPlnAg=; b=AF3f8XmlSwMBUZDBW+TfJwBkQfljImM0KhFVrA0EkQn3SLWomzGc8tjAqxI8FQ6xgZ wOE3xvDmjE3OIzpR38zGQggXjZJAHjmTg0bSMcv7wymjMsfZDm+7+Mm8ZOFuDirhTii1 DrVibcIyBc3R/LQ+LQ+ToxskWe5rvTgawW9azA1kd2XE6sTfbJwrgRemSCiQL2V9srpT FKV2wibEMmGHVEb5dwyCUQAV4hP7KUT7/XQpEnhCa1Nv4ajHr1jZdVwisc2PhK1iCiyF BrCagNUkw3UQR7L6syReOUcPboYk4956SUkJst/0zAgbC462HdR2ZTBlz1J1fSvCd0JZ OgHg== 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 t6si50881930pfe.231.2019.08.07.15.28.13; Wed, 07 Aug 2019 15:28:27 -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 S2389492AbfHGW13 (ORCPT + 99 others); Wed, 7 Aug 2019 18:27:29 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:51819 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388848AbfHGW12 (ORCPT ); Wed, 7 Aug 2019 18:27:28 -0400 Received: from [5.158.153.52] (helo=g2noscherz.tec.linutronix.de.) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1hvUOg-0007mg-R5; Thu, 08 Aug 2019 00:27:08 +0200 From: John Ogness To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , Petr Mladek , Sergey Senozhatsky , Steven Rostedt , Linus Torvalds , Greg Kroah-Hartman , Andrea Parri , Thomas Gleixner , Sergey Senozhatsky , Brendan Higgins Subject: [RFC PATCH v4 5/9] printk-rb: remove extra data buffer size allocation Date: Thu, 8 Aug 2019 00:32:30 +0206 Message-Id: <20190807222634.1723-6-john.ogness@linutronix.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190807222634.1723-1-john.ogness@linutronix.de> References: <20190807222634.1723-1-john.ogness@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The buffer for the raw data storage included extra space at the end for a long. This was meant to guarantee space for the ID of a wrapping datablock. However, since datablocks are padded and the dataring is implemented such that no datablock can end at exactly the end of the data buffer: DATA_WRAPS(begin) != DATA_WRAPS(next) there will always be space available for the ID of a wrapping datablock. Signed-off-by: John Ogness --- kernel/printk/ringbuffer.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/printk/ringbuffer.h b/kernel/printk/ringbuffer.h index 462b4d3a3ee2..698d2328ea9e 100644 --- a/kernel/printk/ringbuffer.h +++ b/kernel/printk/ringbuffer.h @@ -175,8 +175,7 @@ struct dr_desc *prb_getdesc(unsigned long id, void *arg); * * descriptor 1 will be the next descriptor */ #define DECLARE_PRINTKRB(name, avgdatabits, descbits) \ -char _##name##_data[(1 << ((avgdatabits) + (descbits))) + \ - sizeof(long)] \ +char _##name##_data[1 << ((avgdatabits) + (descbits))] \ __aligned(__alignof__(long)); \ struct prb_desc _##name##_descs[1 << (descbits)] = { \ { \ -- 2.20.1