Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1716410ybg; Wed, 23 Oct 2019 21:59:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqxT1ABvQZop2EoG3cvTILoCyvZhYr4YurniKnne2lOpeD903BzP4aEeO5BHrUqzDvkscVVY X-Received: by 2002:a17:907:3301:: with SMTP id ym1mr36708159ejb.106.1571893175686; Wed, 23 Oct 2019 21:59:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571893175; cv=none; d=google.com; s=arc-20160816; b=Z5BT00YWzu1tG730Y62bQ4ZiWSnO3xbwcw5fhquTWZaJVuPpBYgYwlMA/nr7h0G0Et a9OHOtevjKT2iXW8RFOUZpWVCLWrRiYMctEaPFDh2fPC4NXSMsr/YalBX5Fd9VGQ/GFN JVKme/KfGl0Hn/n3Y0FsGNKO1IIKxWTRwPkU+o8a7maeasnvnjO5KxB7Mvfr2a32ii69 N2PmcGrXI1Xtw8tBrDVITJyd8JaulxSPBzGir7oeJblnY5Nn+hRIxJE6VJCE22jg0Iy6 n8w7345cGr4PCIbNKHPG635DL8ZjK5RVlX3hjFptCvZuPtWCRKfRIm5Wdr6+MGU8idpi jJ8Q== 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; bh=YiS0cerYCIiVMA5WVjTZh2HXHttAk39sYz0Qhued9es=; b=nVI6iXOxYmrmf7zHUYgLr8NZDT7bevEX/zI91nHX2DsOTBPniXVHE2YbIVJDf3IJlu f8hUD+cStN7wZ3psfVQjLzVwCPQ1VMjaBoFx1E26VSSbTBYuNEhXNZc/o6w7WGCUL2Ds 03lmo5fVKrrGHRRiQizz3tXvdWZEzVmCPl9bTobO0mK7DAe2nT7+wDtnws22f0yzJkaC pQ/gRSQYzRNJKj//XeNHGe8toQYMqnbDnB1ZqhHtH4/QTk4qIr/MCy9w42n/hDmPH9Gp zh/sQ0IiQirsHPMhmnaVEFTNdGZ5Hpfk7q0rrgpAomhIYJg4ZNRaNI25s8rwzn/i2mKJ kavw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b="3Ma/9YRa"; 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 b25si14756540ejb.49.2019.10.23.21.58.50; Wed, 23 Oct 2019 21:59:35 -0700 (PDT) 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=merlin.20170209 header.b="3Ma/9YRa"; 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 S2392469AbfJWP3f (ORCPT + 99 others); Wed, 23 Oct 2019 11:29:35 -0400 Received: from merlin.infradead.org ([205.233.59.134]:49462 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732725AbfJWP3f (ORCPT ); Wed, 23 Oct 2019 11:29:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.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=YiS0cerYCIiVMA5WVjTZh2HXHttAk39sYz0Qhued9es=; b=3Ma/9YRaysm2dYKupiYEzEzgZ /O+BE/YlpCB4tt4q9LIIVQo16Px0sRy7IXgVNV4KOPqzrlHLPLGgcHNm9zjmnoE2XahHKk/NspESH RRP0gZjYKVHcgNQcnlb96YKCPC8yyr5vciPrbSJgBlLhCWFFywmcFf0zBJ2x2uQZSfv8ZgGsd/8no PZni7BOrKWNN1Y18/ShVoWZcejy3igAl29216Jmg+T3fgJWR/mdjU22T/7KHUIv4fWxeBJqjfnHCI 1G7UPmDuibql+pLbrGPj8v7jkSOc0BuzKPjkHp0O1t8CvgbSAWesyGzRfBK+ikM3+K97R3wynyRxp gkr36L+Vw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1iNIZd-0007qY-Qg; Wed, 23 Oct 2019 15:29:22 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 48431300C3C; Wed, 23 Oct 2019 17:28:22 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 445DC2B1ADEC7; Wed, 23 Oct 2019 17:29:20 +0200 (CEST) Date: Wed, 23 Oct 2019 17:29:20 +0200 From: Peter Zijlstra To: Stephane Eranian Cc: LKML , mingo@elte.hu, Arnaldo Carvalho de Melo , Jiri Olsa , "Liang, Kan" , Song Liu , Ian Rogers Subject: Re: [PATCH] perf/core: fix multiplexing event scheduling issue Message-ID: <20191023152920.GG19358@hirez.programming.kicks-ass.net> References: <20191018002746.149200-1-eranian@google.com> <20191021100558.GC1800@hirez.programming.kicks-ass.net> <20191023093757.GR1817@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191023093757.GR1817@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 23, 2019 at 11:37:57AM +0200, Peter Zijlstra wrote: > Further, since we set it on reschedule, I propose you change the above > like: > > if (ctx->rotate_necessary) { > int type = get_event_type(event); > /* > * comment.. > */ > if (type & EVENT_PINNED) > type |= EVENT_FLEXIBLE; > + /* > + * Will be reset by ctx_resched()'s flexible_sched_in(). > + */ > + ctx->rotate_necessary = 0; > ctx_resched(cpuctx, cpuctx->task_ctx, type); > } n/m, that is already done through ctx_sched_out().