Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753903AbaFMV2k (ORCPT ); Fri, 13 Jun 2014 17:28:40 -0400 Received: from g2t2352.austin.hp.com ([15.217.128.51]:24844 "EHLO g2t2352.austin.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751262AbaFMV2j (ORCPT ); Fri, 13 Jun 2014 17:28:39 -0400 Message-ID: <1402694907.27369.3.camel@buesod1.americas.hpqcorp.net> Subject: Re: [PATCH v3] printk: allow increasing the ring buffer depending on the number of CPUs From: Davidlohr Bueso To: "Luis R. Rodriguez" Cc: hpa@linux.intel.com, Andrew Morton , "linux-kernel@vger.kernel.org" , Michal Hocko , Petr Mladek , Joe Perches , Arun KS , Kees Cook , Chris Metcalf Date: Fri, 13 Jun 2014 14:28:27 -0700 In-Reply-To: References: <1402684097-5731-1-git-send-email-mcgrof@do-not-panic.com> <1402691813.27369.0.camel@buesod1.americas.hpqcorp.net> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.6.4 (3.6.4-3.fc18) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2014-06-13 at 13:44 -0700, Luis R. Rodriguez wrote: > On Fri, Jun 13, 2014 at 1:36 PM, Davidlohr Bueso wrote: > > On Fri, 2014-06-13 at 11:28 -0700, Luis R. Rodriguez wrote: > >> diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c > >> index 7228258..3f3356b 100644 > >> --- a/kernel/printk/printk.c > >> +++ b/kernel/printk/printk.c > >> @@ -246,6 +246,7 @@ static u32 clear_idx; > >> #define LOG_ALIGN __alignof__(struct printk_log) > >> #endif > >> #define __LOG_BUF_LEN (1 << CONFIG_LOG_BUF_SHIFT) > >> +#define __LOG_CPU_MIN_BUF_LEN (1 << CONFIG_LOG_CPU_MIN_BUF_SHIFT) > >> static char __log_buf[__LOG_BUF_LEN] __aligned(LOG_ALIGN); > >> static char *log_buf = __log_buf; > >> static u32 log_buf_len = __LOG_BUF_LEN; > >> @@ -752,6 +753,17 @@ void __init setup_log_buf(int early) > >> unsigned long flags; > >> char *new_log_buf; > >> int free; > >> + int cpu_extra = (num_possible_cpus() - 1) * __LOG_CPU_MIN_BUF_LEN; > > > > I think you forgot to drop the - 1 here. > > Actually that was on purpose as I had noticed in your suggestion on > the other thread to fix the minimum number of CPUs required for this > patch to be > 64 rather than >= 64 (with the defaults of 18 for log > shift, and 12 for min cpu log shift). Minor difference, but it was > intentional. Even though we do require SMP now the -1 can take effect, > and it seems safer for now to only require this for > 64 CPU > configurations for the defaults set. I'm happy to remove that as well, > but bumping the CPU configuration mark for this to > 64 might be > better for starters unless we do know for sure we also need this for > 64. Ah, ok I had missed that. Makes sense now. Thanks, Davidlohr -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/