Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752352AbdHIN0B (ORCPT ); Wed, 9 Aug 2017 09:26:01 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:34238 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752050AbdHIN0A (ORCPT ); Wed, 9 Aug 2017 09:26:00 -0400 Subject: Re: [PATCH 13/16] perf: Add a speculative page fault sw events To: Michael Ellerman , paulmck@linux.vnet.ibm.com, peterz@infradead.org, akpm@linux-foundation.org, kirill@shutemov.name, ak@linux.intel.com, mhocko@kernel.org, dave@stgolabs.net, jack@suse.cz, Matthew Wilcox , benh@kernel.crashing.org, paulus@samba.org, Thomas Gleixner , Ingo Molnar , hpa@zytor.com, Will Deacon Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, haren@linux.vnet.ibm.com, khandual@linux.vnet.ibm.com, npiggin@gmail.com, bsingharora@gmail.com, Tim Chen , linuxppc-dev@lists.ozlabs.org, x86@kernel.org References: <1502202949-8138-1-git-send-email-ldufour@linux.vnet.ibm.com> <1502202949-8138-14-git-send-email-ldufour@linux.vnet.ibm.com> <87lgmsnalk.fsf@concordia.ellerman.id.au> From: Laurent Dufour Date: Wed, 9 Aug 2017 15:25:48 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <87lgmsnalk.fsf@concordia.ellerman.id.au> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 17080913-0040-0000-0000-000003CE8E83 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17080913-0041-0000-0000-000025CDD766 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-08-09_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1706020000 definitions=main-1708090208 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1103 Lines: 34 On 09/08/2017 15:18, Michael Ellerman wrote: > Laurent Dufour writes: > >> Add new software events to count succeeded and failed speculative page >> faults. >> >> Signed-off-by: Laurent Dufour >> --- >> include/uapi/linux/perf_event.h | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h >> index b1c0b187acfe..fbfb03dff334 100644 >> --- a/include/uapi/linux/perf_event.h >> +++ b/include/uapi/linux/perf_event.h >> @@ -111,6 +111,8 @@ enum perf_sw_ids { >> PERF_COUNT_SW_EMULATION_FAULTS = 8, >> PERF_COUNT_SW_DUMMY = 9, >> PERF_COUNT_SW_BPF_OUTPUT = 10, >> + PERF_COUNT_SW_SPF_DONE = 11, >> + PERF_COUNT_SW_SPF_FAILED = 12, > > Can't you calculate: > > PERF_COUNT_SW_SPF_FAILED = PERF_COUNT_SW_PAGE_FAULTS - PERF_COUNT_SW_SPF_DONE > > ie. do you need a separate event for it? Unfortunately not, because PERF_COUNT_SW_PAGE_FAULTS counts also page faults from the kernel space, while SPF is only concerning user space page faults. Cheers, Laurent.