[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1402694907.27369.3.camel@buesod1.americas.hpqcorp.net>
Date: Fri, 13 Jun 2014 14:28:27 -0700
From: Davidlohr Bueso <davidlohr@...com>
To: "Luis R. Rodriguez" <mcgrof@...not-panic.com>
Cc: hpa@...ux.intel.com, Andrew Morton <akpm@...ux-foundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Michal Hocko <mhocko@...e.cz>, Petr Mladek <pmladek@...e.cz>,
Joe Perches <joe@...ches.com>,
Arun KS <arunks.linux@...il.com>,
Kees Cook <keescook@...omium.org>,
Chris Metcalf <cmetcalf@...era.com>
Subject: Re: [PATCH v3] printk: allow increasing the ring buffer depending
on the number of CPUs
On Fri, 2014-06-13 at 13:44 -0700, Luis R. Rodriguez wrote:
> On Fri, Jun 13, 2014 at 1:36 PM, Davidlohr Bueso <davidlohr@...com> 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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists