lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKohpokgT+PfczvpBV2zEzuGMvu0VY50L7EGtyxvLkY2C9z2hQ@mail.gmail.com>
Date:	Sun, 29 Mar 2015 17:31:32 +0530
From:	Viresh Kumar <viresh.kumar@...aro.org>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Johannes Weiner <hannes@...xchg.org>,
	Christoph Lameter <cl@...ux.com>,
	Linaro Kernel Mailman List <linaro-kernel@...ts.linaro.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	vinmenon@...eaurora.org, shashim@...eaurora.org,
	Michal Hocko <mhocko@...e.cz>, Mel Gorman <mgorman@...e.de>,
	dave@...olabs.net, Konstantin Khlebnikov <koct9i@...il.com>,
	Linux Memory Management List <linux-mm@...ck.org>,
	Suresh Siddha <suresh.b.siddha@...el.com>,
	Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [RFC] vmstat: Avoid waking up idle-cpu to service shepherd work

On 28 March 2015 at 19:14, Peter Zijlstra <peterz@...radead.org> wrote:
> Yeah, something like the below (at the very end) should ensure the thing
> is cacheline aligned, that should give us a fair few bits.

> ---
>  kernel/time/timer.c | 36 ++++++++----------------------------
>  1 file changed, 8 insertions(+), 28 deletions(-)
>
> diff --git a/kernel/time/timer.c b/kernel/time/timer.c
> index 2d3f5c504939..c8c45bf50b2e 100644
> --- a/kernel/time/timer.c
> +++ b/kernel/time/timer.c
> @@ -93,6 +93,7 @@ struct tvec_base {
>  struct tvec_base boot_tvec_bases;
>  EXPORT_SYMBOL(boot_tvec_bases);
>  static DEFINE_PER_CPU(struct tvec_base *, tvec_bases) = &boot_tvec_bases;
> +static DEFINE_PER_CPU(struct tvec_base, __tvec_bases);
>
>  /* Functions below help us manage 'deferrable' flag */
>  static inline unsigned int tbase_get_deferrable(struct tvec_base *base)
> @@ -1534,46 +1535,25 @@ EXPORT_SYMBOL(schedule_timeout_uninterruptible);
>
>  static int init_timers_cpu(int cpu)
>  {
> -       int j;
> -       struct tvec_base *base;
> +       struct tvec_base *base = per_cpu(tvec_bases, cpu);
>         static char tvec_base_done[NR_CPUS];
> +       int j;
>
>         if (!tvec_base_done[cpu]) {
>                 static char boot_done;
>
> -               if (boot_done) {
> -                       /*
> -                        * The APs use this path later in boot
> -                        */
> -                       base = kzalloc_node(sizeof(*base), GFP_KERNEL,
> -                                           cpu_to_node(cpu));
> -                       if (!base)
> -                               return -ENOMEM;
> -
> -                       /* Make sure tvec_base has TIMER_FLAG_MASK bits free */
> -                       if (WARN_ON(base != tbase_get_base(base))) {
> -                               kfree(base);
> -                               return -ENOMEM;
> -                       }
> -                       per_cpu(tvec_bases, cpu) = base;
> +               if (!boot_done) {
> +                       boot_done = 1; /* skip the boot cpu */
>                 } else {
> -                       /*
> -                        * This is for the boot CPU - we use compile-time
> -                        * static initialisation because per-cpu memory isn't
> -                        * ready yet and because the memory allocators are not
> -                        * initialised either.
> -                        */
> -                       boot_done = 1;
> -                       base = &boot_tvec_bases;
> +                       base = per_cpu_ptr(&__tvec_bases);
> +                       per_cpu(tvec_bases, cpu) = base;
>                 }
> +
>                 spin_lock_init(&base->lock);
>                 tvec_base_done[cpu] = 1;
>                 base->cpu = cpu;
> -       } else {
> -               base = per_cpu(tvec_bases, cpu);
>         }
>
> -
>         for (j = 0; j < TVN_SIZE; j++) {
>                 INIT_LIST_HEAD(base->tv5.vec + j);
>                 INIT_LIST_HEAD(base->tv4.vec + j);

Even after this with following diff gives me the same warning on blackfin..

diff --git a/include/linux/timer.h b/include/linux/timer.h
index 8c5a197e1587..58bc28d9cef2 100644
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -68,7 +68,7 @@ extern struct tvec_base boot_tvec_bases;
 #define TIMER_DEFERRABLE               0x1LU
 #define TIMER_IRQSAFE                  0x2LU

-#define TIMER_FLAG_MASK                        0x3LU
+#define TIMER_FLAG_MASK                        0x7LU

 #define __TIMER_INITIALIZER(_function, _expires, _data, _flags) { \
                .entry = { .prev = TIMER_ENTRY_STATIC },        \


---------x--------------------x----------------------

Warning:

config: blackfin-allyesconfig (attached as .config)
reproduce:
  wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
-O ~/bin/make.cross
  chmod +x ~/bin/make.cross
  git checkout ca713e393c6eceb54e803df204772a3d6e6c7981
  # save the attached .config to linux build tree
  make.cross ARCH=blackfin

All error/warnings:

   kernel/time/timer.c: In function 'init_timers':
>> kernel/time/timer.c:1648:2: error: call to '__compiletime_assert_1648' declared with attribute error: BUILD_BUG_ON failed: __alignof__(struct tvec_base) & TIMER_FLAG_MASK
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ