From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4A1B7C4741F for ; Fri, 6 Nov 2020 16:12:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 010BE22203 for ; Fri, 6 Nov 2020 16:11:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726831AbgKFQL7 (ORCPT ); Fri, 6 Nov 2020 11:11:59 -0500 Received: from mga11.intel.com ([192.55.52.93]:1190 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725875AbgKFQL6 (ORCPT ); Fri, 6 Nov 2020 11:11:58 -0500 IronPort-SDR: 2aTMCUxLpKwONbTH3J0/oZzQm4WxNQQgpO6KWfNZ6ttjTbEfXebrUOmrQEY4IWf0wPz3DTeRkE C4pClBBEnc8w== X-IronPort-AV: E=McAfee;i="6000,8403,9797"; a="166053886" X-IronPort-AV: E=Sophos;i="5.77,457,1596524400"; d="scan'208";a="166053886" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Nov 2020 08:11:58 -0800 IronPort-SDR: G8lMRuo9asDkmtRvxLPrTy7tjCVp3OtUm68LsMut1mjjWap9XcBsFTvo1KJ4kckNXx32pPNRkm wkqtwTWZ8hNQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,457,1596524400"; d="scan'208";a="307250011" Received: from linux.intel.com ([10.54.29.200]) by fmsmga007.fm.intel.com with ESMTP; 06 Nov 2020 08:11:58 -0800 Received: from [10.252.128.248] (kliang2-MOBL.ccr.corp.intel.com [10.252.128.248]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by linux.intel.com (Postfix) with ESMTPS id 3311958073D; Fri, 6 Nov 2020 08:11:57 -0800 (PST) Subject: Re: [RFC 1/2] perf/core: Enable sched_task callbacks if PMU has it To: Namhyung Kim Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Jiri Olsa , LKML , Stephane Eranian , Andi Kleen , Ian Rogers , Gabriel Marin References: <20201102145221.309001-1-namhyung@kernel.org> <20201102145221.309001-2-namhyung@kernel.org> <84bc6e54-eed8-5230-ad76-7c637613a3ec@linux.intel.com> From: "Liang, Kan" Message-ID: <4567fdf9-2420-d893-fdda-a2de276ab691@linux.intel.com> Date: Fri, 6 Nov 2020 11:11:55 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/5/2020 7:53 PM, Namhyung Kim wrote: > On Fri, Nov 6, 2020 at 4:01 AM Liang, Kan wrote: >> >> >> On 11/5/2020 10:45 AM, Namhyung Kim wrote: >>> Hello, >>> >>> On Thu, Nov 5, 2020 at 11:47 PM Liang, Kan wrote: >>>> >>>> >>>> On 11/2/2020 9:52 AM, Namhyung Kim wrote: >>>>> If an event associated with a PMU which has a sched_task callback, >>>>> it should be called regardless of cpu/task context. For example, >>>> >>>> I don't think it's necessary. We should call it when we have to. >>>> Otherwise, it just waste cycles. >>>> Shouldn't the patch 2 be enough? >>> I'm not sure, without this patch __perf_event_task_sched_in/out >>> cannot be called for per-cpu events (w/o cgroups) IMHO. >>> And I could not find any other place to check the >>> perf_sched_cb_usages. >>> >> Yes, it should a bug for large PEBS, and it should has always been there >> since the large PEBS was introduced. I just tried some older kernels >> (before recent change). Large PEBS is not flushed with per-cpu events. >> >> But from your description, it looks like the issue is only found after >> recent change. Could you please double check if the issue can also be >> reproduced before the recent change? > Yep, actually Gabriel reported this problem on v4.4 kernel. Thanks for the confirm. So large PEBS never works with per-cpu events. :( I will send a new patch set to address the issue. Thanks, Kan