From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2FA7AC433DF for ; Fri, 3 Jul 2020 00:46:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EA651207D4 for ; Fri, 3 Jul 2020 00:46:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="dE01R1rg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EA651207D4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 5CF936B00D6; Thu, 2 Jul 2020 20:46:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 580E56B00D8; Thu, 2 Jul 2020 20:46:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 470E36B00DA; Thu, 2 Jul 2020 20:46:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0223.hostedemail.com [216.40.44.223]) by kanga.kvack.org (Postfix) with ESMTP id 30EC76B00D6 for ; Thu, 2 Jul 2020 20:46:27 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id E7E964DAB for ; Fri, 3 Jul 2020 00:46:26 +0000 (UTC) X-FDA: 76994923572.13.edge13_110296826e8d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id BC8F718140B70 for ; Fri, 3 Jul 2020 00:46:26 +0000 (UTC) X-HE-Tag: edge13_110296826e8d X-Filterd-Recvd-Size: 4981 Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by imf03.hostedemail.com (Postfix) with ESMTP for ; Fri, 3 Jul 2020 00:46:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593737185; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=9rqwmq1BXfatZyLmM0JFLeV+p7atwrIAzGXvJ0Y4ZPM=; b=dE01R1rgBuo79l3F7f7HauVu5kCVxCJ+VVX5pH8FHqf5RkYYsZDOnO3AQF8kCOUQ4R00Wl vycGJe10RrKM+hIjv985Sao5muErSum2Oo8LaQfHH1F5XzShVbbMLhCPGgkr5a6YTdmMHz d4k/AZwv5p+izCZOn3vjvj8Pr+k6U9E= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-197-AXmmcjqFOd-q7CfZg16imA-1; Thu, 02 Jul 2020 20:46:22 -0400 X-MC-Unique: AXmmcjqFOd-q7CfZg16imA-1 Received: by mail-qv1-f72.google.com with SMTP id m8so2038997qvv.10 for ; Thu, 02 Jul 2020 17:46:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=9rqwmq1BXfatZyLmM0JFLeV+p7atwrIAzGXvJ0Y4ZPM=; b=JwP0Uvdw2V35zPJse5Ig71fMsHpCuTbr5HpNG9KoOwZ5X1DiUllDmsk+Vt58liVESV 1rEopVw2wHDvg6VUp5XB4kn9rXg5CclHJf8yR/so/WWPn7Z0kwB223nJmDefQC1pwE5N +ZV4t+KL1w+dc8FUkpnMinXq2AICsYuVNsHFme4oenxENBf6wuUeDN9kgqtvC9oU9gBJ Px5AMHbtvtLnKu8S2wf3y0H3BwIQm4YinkvtLVrRW0sVUVRWs2VAL+Q5bOFshp8sFVjj fJpMCOFF69oR7DJLi6q7gkAnfQ/UYfejNLhOqkkC4127etVaN8EIGVpSL75fz51N3Y/b ceLw== X-Gm-Message-State: AOAM532/cfLfNFMDUEuFDSd7oAGJu51zIBRFSq7efFJEQACHnY5JQzU3 99/87YELFCeg+5MsM1wDJe7b0bu9RAZwkmrVbmgrCIJInTMc/WxGsMUhwWw0DychF2S8KLeeUAJ k1F5k97WJHb4= X-Received: by 2002:a37:9fc2:: with SMTP id i185mr31515438qke.481.1593737181622; Thu, 02 Jul 2020 17:46:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOZVt1rNwhhw6r5JjnkASIBSV0ZVmK0m+nybu6BuerB0f3qAECba+gztBqlgJIH0uHbePjfQ== X-Received: by 2002:a37:9fc2:: with SMTP id i185mr31515420qke.481.1593737181371; Thu, 02 Jul 2020 17:46:21 -0700 (PDT) Received: from xz-x1 ([2607:9880:19c0:32::2]) by smtp.gmail.com with ESMTPSA id p7sm9336307qki.61.2020.07.02.17.46.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jul 2020 17:46:20 -0700 (PDT) Date: Thu, 2 Jul 2020 20:46:18 -0400 From: Peter Xu To: Dave Hansen Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , John Hubbard , Michael Ellerman , Gerald Schaefer , Andrea Arcangeli , Linus Torvalds , Will Deacon , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H . Peter Anvin" Subject: Re: [PATCH v4 23/26] mm/x86: Use general page fault accounting Message-ID: <20200703004618.GA6677@xz-x1> References: <20200630204601.39591-1-peterx@redhat.com> MIME-Version: 1.0 In-Reply-To: Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=peterx@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Rspamd-Queue-Id: BC8F718140B70 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi, Dave, On Wed, Jul 01, 2020 at 08:35:40AM -0700, Dave Hansen wrote: > On 6/30/20 1:46 PM, Peter Xu wrote: > > Use the general page fault accounting by passing regs into handle_mm_fault(). > ... > > - /* > > - * Major/minor page fault accounting. If any of the events > > - * returned VM_FAULT_MAJOR, we account it as a major fault. > > - */ > > - if (major) { > > - tsk->maj_flt++; > > - perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, regs, address); > > - } else { > > - tsk->min_flt++; > > - perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, regs, address); > > - } > > - > > check_v8086_mode(regs, address, tsk); > > } > > I did a quick grep and it wasn't obvious to me how > PERF_COUNT_SW_PAGE_FAULTS_MIN/MAJ get bumped in the handle_mm_fault() path. > > Are you sure they get set? Sorry for missing the context. This patch is based on the 1st patch of the same series: https://lore.kernel.org/lkml/20200630204504.38516-1-peterx@redhat.com/ Both of them are set there. Thanks, -- Peter Xu