Received: by 10.223.185.116 with SMTP id b49csp237152wrg; Sat, 10 Feb 2018 06:10:12 -0800 (PST) X-Google-Smtp-Source: AH8x224W8STpjzNBFFpqrB7wG3hrwlxmGVKCLzgrp60yPQQ8gmkBOdHTTdow0P+wR7ExJ29TEVfm X-Received: by 10.101.82.134 with SMTP id y6mr5276538pgp.101.1518271812507; Sat, 10 Feb 2018 06:10:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518271812; cv=none; d=google.com; s=arc-20160816; b=ui2H0+YQKjg2ppFbhAa3AmWZOKLACl5kPme2N/sfAEIYbKQpaezdQPQCUMUJGx/omw swHlOEDNS787Lhjf3ItxJNBo4N8Hvc6HYsa0zsTad1r2tgm7fUMUjONZVhU/UIEqrhFi iCpAgtkt38AT2EED3Xi0eIkP+ktOjiWlmUfXwAG6RgSRnvj76U/KcH/Wv+JRLYAohBNP TGC0iu7LS/Azw1YZ0BeM3XqJGoD9pTPcjLhU3krC2xmoJ3islJJ5hjdppMnz49KL+Lj1 4FPJoX+mM/+IsOxy9L+F9uR6Rn0S5IC3w1uWx8xH/1TzhO+zyhzPe1YFZKWDugkZBNy+ wEdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=t2dq50NJ7GFB046sMA8FnAGrECIBlKPHUWdZPfzHqJQ=; b=F+WbyO9s8XUMMo4V197W32PPdhbgPqcjjQkmzLLKTzxpLyRE64u9zh+UVhN4nFylFK NfU0vm4/V5jJ5zoBSZTA1pniZ3ZGmXAY2j5mtveBjFsA+3jyOQK8PAfusc+cIfBsXaef 53RcGOJH3ds0OUeILBTjOfwr7RK7EdBf+z8XYIghdty2Gdi2uLLpvXoIWcAL5z4gwYzh OWfaiwO5CRHxLTUlqAfVxn1Wa+IyQGs/f5ZuAlyYwZ5sU52j6hj+5WRKtDwgfwVsS8v4 bWInSl8FXrhg3KaptReYl7gj17YWVYNsTpqiYEuxc+w1v00G7PX4L4hkHRYn+r4f1L4/ DaEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=L9DYSoMB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q11si1155778pgc.165.2018.02.10.06.09.58; Sat, 10 Feb 2018 06:10:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=L9DYSoMB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751952AbeBJOJU (ORCPT + 99 others); Sat, 10 Feb 2018 09:09:20 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:45699 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750835AbeBJOJT (ORCPT ); Sat, 10 Feb 2018 09:09:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=t2dq50NJ7GFB046sMA8FnAGrECIBlKPHUWdZPfzHqJQ=; b=L9DYSoMB8ykWbDz1ksjpQsmuT OrMF7NPF0we5m4ycb/dCpQYIBNZhwi9LKBMwjzUv375iastS5s1uy8TG4SPHpE5f9iNc5NwFGdLwY vXrXtE+6YAIqdvkLMRHbhkpwwbAPa9E96Kn83b2QwlQfp/FBWZRxVOToVp4DGmm2DLBMgcTmAJJkk kb79GyFoOZBHDVdSaC7x2cd2lwxxQo6bz+Uq+faze/6k9EIurMgPMpEJyBgypWSfs4IR3deAHn9CL cA4gDZYatCwS+0Cg3itiO5mlmpZy7CqcPGwMWp0RC2JY4CPpzU/3pLhE9r0YNwHRIoqTvhd3QTlHI zYHmi3eXw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.89 #1 (Red Hat Linux)) id 1ekVq5-0007Z8-Rj; Sat, 10 Feb 2018 14:09:14 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id B344420587683; Sat, 10 Feb 2018 15:09:10 +0100 (CET) Date: Sat, 10 Feb 2018 15:09:10 +0100 From: Peter Zijlstra To: "Liang, Kan" Cc: mingo@redhat.com, linux-kernel@vger.kernel.org, acme@kernel.org, tglx@linutronix.de, jolsa@redhat.com, eranian@google.com, ak@linux.intel.com Subject: Re: [PATCH V3 1/5] perf/x86/intel: fix event update for auto-reload Message-ID: <20180210140910.GQ25201@hirez.programming.kicks-ass.net> References: <1517243373-355481-1-git-send-email-kan.liang@linux.intel.com> <1517243373-355481-2-git-send-email-kan.liang@linux.intel.com> <20180206150648.GK2249@hirez.programming.kicks-ass.net> <20180209140905.GG25181@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 09, 2018 at 10:49:35AM -0500, Liang, Kan wrote: > > > On 2/9/2018 9:09 AM, Peter Zijlstra wrote: > > On Tue, Feb 06, 2018 at 12:58:23PM -0500, Liang, Kan wrote: > > > > > > > > > > With the exception of handling 'empty' buffers, I ended up with the > > > > below. Please try again. > > > > > > > > > > There are two small errors. After fixing them, the patch works well. > > > > Well, it still doesn't do A, two read()s without PEBS record in between. > > So that needs fixing. What 3/5 does, call x86_perf_event_update() after > > drain_pebs() is actively wrong after this patch. > > > > As my understanding, for case A, drain_pebs() will return immediately. It > cannot reach the patch. > Because there is no PEBS record ready. So the ds->pebs_index should be the > same as ds->pebs_buffer_base. Right, so fix that. > 3/5 is to handle case A. 3/5 is terminatlly broken, you should not call x86_perf_event_update() on a auto-reload event _ever_ after my patch.