lkml.org 
[lkml]   [2019]   [Dec]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] perf/x86/intel/bts: Remove a silly warning
On Thu, Dec 05, 2019 at 05:28:52PM +0300, Alexander Shishkin wrote:
> There is no comment or record anywhere that would explain the train of
> thought that went into this warning, it probably tried to make sure that
> the high order allocations indeed happened in the ring buffer code.
>

> --- a/arch/x86/events/intel/bts.c
> +++ b/arch/x86/events/intel/bts.c
> @@ -83,8 +83,6 @@ bts_buffer_setup_aux(struct perf_event *event, void **pages,
> /* count all the high order buffers */
> for (pg = 0, nbuf = 0; pg < nr_pages;) {
> page = virt_to_page(pages[pg]);
> - if (WARN_ON_ONCE(!PagePrivate(page) && nr_pages > 1))
> - return NULL;
> pg += 1 << page_private(page);

I'm thinking that because ^^^^ uses page_private(), it wants to make
sure PagePrivate().

I haven't checked the current rules, but using page_private() without
PagePrivate() seems dodgy.

Also consider:

+ __nr_pages = PagePrivate(page) ? 1 << page_private(page) : 1;

> nbuf++;
> }
> --
> 2.24.0
>

\
 
 \ /
  Last update: 2019-12-10 16:30    [W:0.336 / U:0.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site