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: <20130312153609.GC32001@krava.brq.redhat.com>
Date:	Tue, 12 Mar 2013 16:36:09 +0100
From:	Jiri Olsa <jolsa@...hat.com>
To:	Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc:	linux-kernel@...r.kernel.org,
	Corey Ashford <cjashfor@...ux.vnet.ibm.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Ingo Molnar <mingo@...e.hu>,
	Namhyung Kim <namhyung@...nel.org>,
	Paul Mackerras <paulus@...ba.org>,
	Arnaldo Carvalho de Melo <acme@...hat.com>
Subject: Re: [PATCHv3] perf: Fix vmalloc ring buffer free function

On Tue, Mar 12, 2013 at 04:26:12PM +0100, Peter Zijlstra wrote:
> On Tue, 2013-03-12 at 14:52 +0100, Jiri Olsa wrote:
> > > @@ -373,7 +373,7 @@ struct ring_buffer *rb_alloc(int nr_pages, long watermark, int cpu, int flags)
> > >       rb->user_page = all_buf;
> > >       rb->data_pages[0] = all_buf + PAGE_SIZE;
> > >       rb->page_order = ilog2(nr_pages);
> > > -     rb->nr_pages = 1;
> > > +     rb->nr_pages = nr_pages;
> > >  
> > 
> > hum, and this ^^^ breaks perf_data_size(rb) ;)
> > 
> > static inline unsigned long perf_data_size(struct ring_buffer *rb)
> > {
> >         return rb->nr_pages << (PAGE_SHIFT + page_order(rb));
> > }
> 
> How so? 0 << n keeps being 0, right?
> 

you do 'rb->nr_pages = nr_pages' which was 1 before..
that will bump up the return value

should do '1 << x' but doing 'nr_pages << x' instead

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