Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751032AbdGNSGA (ORCPT ); Fri, 14 Jul 2017 14:06:00 -0400 Received: from mail-it0-f52.google.com ([209.85.214.52]:36351 "EHLO mail-it0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750786AbdGNSF7 (ORCPT ); Fri, 14 Jul 2017 14:05:59 -0400 From: Vince Weaver X-Google-Original-From: Vince Weaver Date: Fri, 14 Jul 2017 14:05:51 -0400 (EDT) X-X-Sender: vince@macbook-air To: linux-kernel@vger.kernel.org cc: Alexander Shishkin , Ingo Molnar , Peter Zijlstra , Stephane Eranian Subject: perf: bisected sampling bug in Linux 4.11-rc1 Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2424 Lines: 61 I was tracking down some regressions in my perf_event_test testsuite. Some of the tests broke in the 4.11-rc1 timeframe. I've bisected one of them, this report is about tests/overflow/simul_oneshot_group_overflow This test creates an event group containing two sampling events, set to overflow to a signal handler (which disables and then refreshes the event). On a good kernel you get the following: Event perf::instructions with period 1000000 Event perf::instructions with period 2000000 fd 3 overflows: 946 (perf::instructions/1000000) fd 4 overflows: 473 (perf::instructions/2000000) Ending counts: Count 0: 946379875 Count 1: 946365218 With the broken kernels you get: Event perf::instructions with period 1000000 Event perf::instructions with period 2000000 fd 3 overflows: 938 (perf::instructions/1000000) fd 4 overflows: 318 (perf::instructions/2000000) Ending counts: Count 0: 946373080 Count 1: 653373058 487f05e18aa4efacee6357480f293a5afe6593b5 is the first bad commit commit 487f05e18aa4efacee6357480f293a5afe6593b5 Author: Alexander Shishkin Date: Thu Jan 19 18:43:30 2017 +0200 perf/core: Optimize event rescheduling on active contexts When new events are added to an active context, we go and reschedule all cpu groups and all task groups in order to preserve the priority (cpu pinned, task pinned, cpu flexible, task flexible), but in reality we only need to reschedule groups of the same priority as that of the events being added, and below. This patch changes the behavior so that only groups that need to be rescheduled are rescheduled. Reported-by: Adrian Hunter Signed-off-by: Alexander Shishkin Signed-off-by: Peter Zijlstra (Intel) Cc: Arnaldo Carvalho de Melo Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Vince Weaver Cc: vince@deater.net Link: http://lkml.kernel.org/r/20170119164330.22887-3-alexander.shishkin@linux.intel.com Signed-off-by: Ingo Molnar