Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp768319imm; Wed, 17 Oct 2018 08:03:42 -0700 (PDT) X-Google-Smtp-Source: ACcGV636tetBsc2kM66aSAu1yz3fm/z7qm6PC/LwFIOoY6scs4qJhe0SEQYBh1nAMzJR4oZprA4R X-Received: by 2002:a63:700e:: with SMTP id l14-v6mr24035801pgc.359.1539788622773; Wed, 17 Oct 2018 08:03:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539788622; cv=none; d=google.com; s=arc-20160816; b=L7TNESksXdPlQEW4HUsZrQcim8waVPtcwTJYyJ7tLq4Nk2u5N+fcxp9/BvzSDPHcKA Aglk0tJ0BbkcZlUQaV/ZFJrnOuDcqzXdAOr77N+SBautQlRzvuytlBVmhclQAhuv67Z+ V6gHUjAdXOBissgy4niwbZ/EwPvWSpRAzifP6Ea2NEDqnZgjQwFHx+piGA1SxC64MNWJ sKms+m5+H1TS6G5T/WBKkZjF0FSRZNBP3uLDeZb7MmLrJNviw+X+j+dcqfedu5PZqIze SMsQqOu+rfdCeyHu6aW9uBap6WjbrhGt0l+H4n2Vcmwd8UhrWunDuNN4pb5vv9Bn9Yuo OYiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=babtF8KigLRyVyjuZc3FlAqyRRUmWG+AedJc13f+p90=; b=Mo7gDByXFtmHCmHPFZNxFHuBJkwvbRj4JuDYfsK4dTPcpoL4HIyN1DLsnvzLpm/p3P xPixCMdr7GKGX5CmGLxamygpP9vT6N2PxoBbgmjCYRjjPsuk2yPH2jFyd5dbuc4Be80L BXyP7UsI0vwMqoTME0EW9lSVKnUka3WyGYE1EOchHQZR8A8RGlxUZ2I6QVzu+CT74Mkt PhS9li8AtgE+iWwhDeAfoh6Hf7hie9JN1VlrqRJLGlcBkDTQhk1fxFKV5q1xpsYpF7Q6 SlRcFANV8ZxPcK3SYsyx+8xlZCcBonioTbi2KEqJJ3HB8XZqmM8vrW91XbOBLFQtaCGr q4Mw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n77-v6si18892724pfi.67.2018.10.17.08.03.25; Wed, 17 Oct 2018 08:03:42 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727719AbeJQW5i (ORCPT + 99 others); Wed, 17 Oct 2018 18:57:38 -0400 Received: from mga18.intel.com ([134.134.136.126]:41696 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727047AbeJQW5i (ORCPT ); Wed, 17 Oct 2018 18:57:38 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Oct 2018 08:01:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,392,1534834800"; d="scan'208";a="96035872" Received: from um.fi.intel.com (HELO localhost) ([10.237.72.212]) by fmsmga002.fm.intel.com with ESMTP; 17 Oct 2018 08:01:29 -0700 From: Alexander Shishkin To: Alexey Budankov , Peter Zijlstra , mingo@kernel.org Cc: linux-kernel@vger.kernel.org, acme@kernel.org, jolsa@redhat.com, songliubraving@fb.com, eranian@google.com, tglx@linutronix.de, mark.rutland@arm.com, megha.dey@intel.com, frederic@kernel.org Subject: Re: [RFC][PATCH] perf: Rewrite core context handling In-Reply-To: References: <20181010104559.GO5728@hirez.programming.kicks-ass.net> Date: Wed, 17 Oct 2018 18:01:28 +0300 Message-ID: <871s8o62if.fsf@ashishki-desk.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Alexey Budankov writes: > Since it reduces to single cpu context (and single task context) at all times, > ideally, it would probably be coded as simple as this: > > perf_rotate_context() > { > cpu = this_cpu_ptr(&cpu_context) > for_every_pmu(pmu, cpu) > for_every_event_ctx(event_ctx, pmu) > rotate(event_ctx, pmu) > } > > so rotate(event_ctx, pmu) would operate on common events objects semantics > and memory layout, and PMU specific code handle SW/HW programming differences. Ok, what's event_ctx and how does that simplify things? Regards, -- Alex