Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753471AbdHKQvV (ORCPT ); Fri, 11 Aug 2017 12:51:21 -0400 Received: from mail-it0-f65.google.com ([209.85.214.65]:36907 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752703AbdHKQvU (ORCPT ); Fri, 11 Aug 2017 12:51:20 -0400 From: Vince Weaver X-Google-Original-From: Vince Weaver Date: Fri, 11 Aug 2017 12:51:12 -0400 (EDT) X-X-Sender: vince@macbook-air To: Mark Rutland cc: linux-kernel@vger.kernel.org, Will Deacon , Peter Zijlstra , Ingo Molnar Subject: Re: perf: multiple mmap of fd behavior on x86/ARM In-Reply-To: <20170811162318.GA22445@leverpostej> Message-ID: References: <20170811100127.GB12985@leverpostej> <20170811162318.GA22445@leverpostej> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1870 Lines: 48 On Fri, 11 Aug 2017, Mark Rutland wrote: > IIRC, patches were sent back in 2014, but as I mentioned above, those > were far from suitable for upstream, even ignoring cases like > big.LITTLE. Said patches were never reworked and reposted. Here's the commit message in the perf_event_tests tree, having trouble finding the original e-mail that went with it. commit 2cc2e21e349243889ba59408527cc1a97dd0dc44 Author: Yogesh Tillu Date: Tue Mar 1 14:18:22 2016 +0530 Add support for RDPMC test with mmap way This test adds support for reading perf hw counter from userspace. Method (2) rdpmc_comparision_mmap: Test read perf hw counter in userspace using open/mmap syscall. It requires kernel with perf mmap patchset and echo 1 > /sys/bus/platform/drivers/armv8-pmu/rdpmc Above Method Tested On:(X86/ARM) It is tested with perf mmap patchset on kernel v4.5.0-rc5+ With above Tests, we can benchmark access of perf hw counters in userspace with syscall vs perf_event_mmap_page way. Signed-off-by: Yogesh Tillu > Just to check, how does x86 behave on each of those kernel releases? > > Many things have changed since v4.4. I'm fairly sure this test (well, the equivelent code in tests/record_sample/record_mmap that I based the test on) has been passing on all of my x86 test machines since ~3.10 or so, or else I would noticed. If I can get a custom kernel to boot on one of my machines I can start digging in and see if I can find where the EINVAL comes from. This isn't some key thing that needs to be fixed, I was just curious about the behavior difference between x86 and ARM. There are a few other minor x86/ARM diferences, especially realting to perf_event_open() error returns, that I had to special case in a few of my tests. Vince