[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191210152939.GN2844@hirez.programming.kicks-ass.net>
Date: Tue, 10 Dec 2019 16:29:39 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@...hat.com>,
Ingo Molnar <mingo@...hat.com>, linux-kernel@...r.kernel.org,
Jiri Olsa <jolsa@...nel.org>,
Vince Weaver <vincent.weaver@...ne.edu>
Subject: Re: [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
>
Powered by blists - more mailing lists