Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1382999pxb; Fri, 6 Nov 2020 08:16:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJx2tc03uC0HR55rj8aqYZ92zOHKpNs/S9YWMPCek4XKsEH1dzfMbE1M2R87OvD+qOC74xWT X-Received: by 2002:aa7:c90a:: with SMTP id b10mr2723345edt.266.1604679366299; Fri, 06 Nov 2020 08:16:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604679366; cv=none; d=google.com; s=arc-20160816; b=FMLLg23IN2GQ4AU/kJQ3t8Kwk2qkXwjudJFpkLxEFOLu7rVwqEzI5Qv6P7CODX4ml9 oSqJg+kraoAP1SbiSR/1ZWtvTypyVYaLDhi8lKPrPSScAz5nbYLpyeGX0F3Vys6AyqRv +lk0PobZryKzTKH5raSalqE7UGC5aPkoJINc8g7k0eS6wcC16A/f7Ey9v0q6Q2dEMaX5 ONToO6VJOkwt6Iv1B1jR71X7Y1DdPM6lC0WQ53hL4FqYD14mNG8QSosXuaHAv3VpkcFZ iVM3Y9xQ76YHp2+hWhdMx/G4rHTRmecDBNZdr5DnKdwU0ON/0kjZizptlqcrZOHgBtNo 81rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:ironport-sdr:ironport-sdr; bh=tsZ5e8pMhn5tvp44iXt9wVXu6W3sCYdVMCPGLv9zrkU=; b=yo/sfh6usda+gBOgnpmXzrBfwVXpEIPpC/oeD7AESTC1l9uD3oNJM/boPmTQWzas8c zXIU7CGyox/cHMPBFLH+s4PD/zvKD6ypbr+ct7rv1lYG407PZz5SpIWEX8WQAsO2i1b3 RCByg4oYNbBtRnAO0q0r/iBg1W6Z6gKAcsUqeDcd7simgxoDIC3q908B6oufWle3YjwK 3149kQ+zzhwcjbcgc6J/QIBJhu6p6SGA6RDGOLPIC/sIHXgBX0BIXFcWSlMyWZrNc0+B 0AzrZYNIdJd2slxIT34lEAz+xXutn/nqhf8qVpsBU2Na671ANgpcp+cl/p2LqXD3fuga pjGA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z5si1305749edl.605.2020.11.06.08.15.43; Fri, 06 Nov 2020 08:16:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726507AbgKFQL6 (ORCPT + 99 others); Fri, 6 Nov 2020 11:11:58 -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