lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <710edaf6-2562-0f53-15d6-dc50885b8e08@linux.intel.com>
Date:   Thu, 14 Nov 2019 08:46:51 -0500
From:   "Liang, Kan" <kan.liang@...ux.intel.com>
To:     Peter Zijlstra <peterz@...radead.org>,
        Ian Rogers <irogers@...gle.com>
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>,
        Sri Krishna chowdary <schowdary@...dia.com>,
        "Uladzislau Rezki (Sony)" <urezki@...il.com>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Changbin Du <changbin.du@...el.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>,
        linux-kernel@...r.kernel.org,
        Stephane Eranian <eranian@...gle.com>,
        Andi Kleen <ak@...ux.intel.com>
Subject: Re: [PATCH v3 10/10] perf/cgroup: Do not switch system-wide events in
 cgroup switch



On 11/14/2019 5:43 AM, Peter Zijlstra wrote:
> On Wed, Nov 13, 2019 at 04:30:42PM -0800, Ian Rogers wrote:
>> From: Kan Liang <kan.liang@...ux.intel.com>
>>
>> When counting system-wide events and cgroup events simultaneously, the
>> system-wide events are always scheduled out then back in during cgroup
>> switches, bringing extra overhead and possibly missing events. Switching
>> out system wide flexible events may be necessary if the scheduled in
>> task's cgroups have pinned events that need to be scheduled in at a higher
>> priority than the system wide flexible events.
> 
> I'm thinking this patch is actively broken. groups->index 'group' wide
> and therefore across cpu/cgroup boundaries.
> 
> There is no !cgroup to cgroup hierarchy as this patch seems to assume,
> specifically look at how the merge sort in visit_groups_merge() allows
> cgroup events to be picked before !cgroup events.


No, the patch intends to avoid switch !cgroup during cgroup context 
switch.

In perf_cgroup_switch(), when the cgroup is scheduled out, current 
implementation schedule out everything including !cgroup. I think it 
definitely breaks the semantics of !cgroup aka system-wide event.

The patch itself doesn't touch the merge sort in visit_groups_merge().
The perf_cgroup_skip_switch() just skips the !cgroup in schedule_in().
Because !cgroup wasn't scheduled out. We don't want to schedule !cgroup 
in again.
The cgroup events must be after !cgroup events, since !cgroup never be 
switched.

Thanks,
Kan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ