[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAP-5=fVj42gS8oQAG+jp3A+VJQcAHTexaO_4mNvLhdopf6B8vg@mail.gmail.com>
Date: Fri, 15 Nov 2019 17:19:48 -0800
From: Ian Rogers <irogers@...gle.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...hat.com>,
Namhyung Kim <namhyung@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Masahiro Yamada <yamada.masahiro@...ionext.com>,
Kees Cook <keescook@...omium.org>,
Catalin Marinas <catalin.marinas@....com>,
Petr Mladek <pmladek@...e.com>,
Mauro Carvalho Chehab <mchehab+samsung@...nel.org>,
Qian Cai <cai@....pw>, Joe Lawrence <joe.lawrence@...hat.com>,
Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>,
"Uladzislau Rezki (Sony)" <urezki@...il.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Ard Biesheuvel <ardb@...nel.org>,
"David S. Miller" <davem@...emloft.net>,
Kent Overstreet <kent.overstreet@...il.com>,
Gary Hook <Gary.Hook@....com>, Arnd Bergmann <arnd@...db.de>,
Kan Liang <kan.liang@...ux.intel.com>,
LKML <linux-kernel@...r.kernel.org>,
Stephane Eranian <eranian@...gle.com>,
Andi Kleen <ak@...ux.intel.com>
Subject: Re: [PATCH v3 04/10] perf: Add per perf_cpu_context min_heap storage
On Thu, Nov 14, 2019 at 1:51 AM Peter Zijlstra <peterz@...radead.org> wrote:
>
> On Wed, Nov 13, 2019 at 04:30:36PM -0800, Ian Rogers wrote:
> > + if (cpuctx) {
> > + event_heap = (struct min_max_heap){
> > + .data = cpuctx->itr_storage,
> > + .size = 0,
>
> C guarantees that unnamed fields get to be 0
Agreed, this is kept here to aid readability. Do you feel strongly
about not having this? It appears to be kept elsewhere for clarity
too:
$ grep -r "\..*= 0," arch/ kernel/ tools/|wc -l
2528
> > + .cap = cpuctx->itr_storage_cap,
> > + };
> > + } else {
> > + event_heap = (struct min_max_heap){
> > + .data = itrs,
> > + .size = 0,
>
> idem.
>
> > + .cap = ARRAY_SIZE(itrs),
> > + };
> > + /* Events not within a CPU context may be on any CPU. */
> > + __heap_add(&event_heap, perf_event_groups_first(groups, -1));
> > +
>
> suprious whitespace
Done.
> > + }
> > + evt = event_heap.data;
> > +
> > __heap_add(&event_heap, perf_event_groups_first(groups, cpu));
Powered by blists - more mailing lists