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: <1336573788.14207.208.camel@gandalf.stny.rr.com>
Date:	Wed, 09 May 2012 10:29:48 -0400
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Vaibhav Nagarnaik <vnagarnaik@...gle.com>
Cc:	Frederic Weisbecker <fweisbec@...il.com>,
	Ingo Molnar <mingo@...hat.com>,
	Laurent Chavey <chavey@...gle.com>,
	Justin Teravest <teravest@...gle.com>,
	David Sharp <dhsharp@...gle.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v7 1/3] trace: Make removal of ring buffer pages atomic

On Tue, 2012-05-08 at 22:00 -0700, Vaibhav Nagarnaik wrote:
> On Tue, May 8, 2012 at 8:38 PM, Steven Rostedt <rostedt@...dmis.org> wrote:
> > BTW, why the two loops and not just:
> >
> >                for_each_buffer_cpu(buffer, cpu) {
> >                        cpu_buffer = buffer->buffers[cpu];
> >                        if (!cpu_buffer->nr_pages_to_update)
> >                                continue;
> >
> >                        if (cpu_online(cpu))
> >                                schedule_work_on(cpu, &cpu_buffer->update_pages_work);
> >                        else
> >                                rb_update_pages(cpu_buffer);
> >                }
> >
> > ??
> >
> >
> >>
> >>               /* wait for all the updates to complete */
> >>               for_each_buffer_cpu(buffer, cpu) {
> >>                       cpu_buffer = buffer->buffers[cpu];
> >> -                     if (cpu_buffer->nr_pages_to_update) {
> >> -                             update_pages_handler(cpu_buffer);
> >> -                     }
> >> +                     if (!cpu_buffer->nr_pages_to_update||
> >
> >                              !cpu_buffer->nr_pages_to_update ||
> 
> This schedules work for all online CPUs and the offline CPUs resizing
> (if any) can occur concurrently. It might not be too much of big deal
> to just make it one loop.

This is far from a hot path. In fact, it's quite slow. Lets not uglify
code just to optimize something that's not time critical.

Please combine these two into a single loop. The wait for completion is
fine as a separate loop.

Thanks,

-- Steve

--
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