Re: [PATCHES/RFC] Re: A concern about overflow ring buffer mode

From: Arnaldo Carvalho de Melo
Date: Mon Oct 29 2018 - 13:56:44 EST


Em Mon, Oct 29, 2018 at 10:43:21AM -0700, David Miller escreveu:
> From: "Liang, Kan" <kan.liang@xxxxxxxxxxxxxxx>
> Date: Mon, 29 Oct 2018 11:11:25 -0400
>
> > The processing time for each perf_top__mmap_read_idx() should not that
> > long. We may check it after each perf_top__mmap_read_idx(). Also
> > change the ui_warning to one-time warning. The patch as below can do
> > that (not test).
>
> You cannot make ui__*() calls from the event processing thread.
>
> I tried to make this point strongly over the weekend.
>
> It hangs the event thread, because the ui call waits for a keypress
> but the display thread will eat them up and the event thread thus
> hangs in select().
>
> So, once more, all ui calls must be avoided in event processing code.
>
> Said another way, it is not legal to call UI interfaces from any
> code that could be called by the event thread.

Right, that global in fact needs to be set in the event processing and
checked in the display thread, start it with 0, switch to 1 and then to
2 to say it was processed just once, etc.

- Arnaldo