[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20190214033426.qbhlhjdv6qq75tf7@mail.google.com>
Date: Thu, 14 Feb 2019 03:34:28 +0000
From: Changbin Du <changbin.du@...il.com>
To: peterz@...radead.org, mingo@...hat.com, acme@...nel.org
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Mark Rutland <mark.rutland@....com>,
Julien Thierry <julien.thierry@....com>,
Jiri Olsa <jolsa@...hat.com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
stable@...r.kernel.org, linux-kernel@...r.kernel.org,
Changbin Du <changbin.du@...il.com>
Subject: Re: [PATCH] perf/core: Fix mmap failure caused by bad size check
Hi Peter, Ingo and Arnaldo,
Could you help review this and have this fix merged in next RC? The perf
is totaly broken now! Thanks.
On Tue, Feb 12, 2019 at 11:52:21PM +0800, Changbin Du wrote:
> Perf tool now is broken by commit 9dff0aa95a32 ("perf/core: Don't WARN()
> for impossible ring-buffer sizes"). The get_order() should be used but not
> the order_base_2(). This mistake makes mmap() on perf fd always fail.
>
> Fixes: 9dff0aa95a32 ("perf/core: Don't WARN() for impossible ring-buffer sizes")
> Signed-off-by: Changbin Du <changbin.du@...il.com>
> Cc: Mark Rutland <mark.rutland@....com>
> Cc: Julien Thierry <julien.thierry@....com>
> Cc: Linus Torvalds <torvalds@...ux-foundation.org>
> Cc: Jiri Olsa <jolsa@...hat.com>
> Cc: Peter Zijlstra <peterz@...radead.org>
> Cc: Ingo Molnar <mingo@...hat.com>
> Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
> Cc: <stable@...r.kernel.org>
> ---
> kernel/events/ring_buffer.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/events/ring_buffer.c b/kernel/events/ring_buffer.c
> index 309ef5a64af5..55faafca4a6e 100644
> --- a/kernel/events/ring_buffer.c
> +++ b/kernel/events/ring_buffer.c
> @@ -734,7 +734,7 @@ struct ring_buffer *rb_alloc(int nr_pages, long watermark, int cpu, int flags)
> size = sizeof(struct ring_buffer);
> size += nr_pages * sizeof(void *);
>
> - if (order_base_2(size) >= MAX_ORDER)
> + if (get_order(size) >= MAX_ORDER)
> goto fail;
>
> rb = kzalloc(size, GFP_KERNEL);
> --
> 2.19.1
>
--
Cheers,
Changbin Du
Powered by blists - more mailing lists