From patchwork Tue Jun 30 20:45:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 11634783 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 02E88138C for ; Tue, 30 Jun 2020 20:46:03 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BA03320663 for ; Tue, 30 Jun 2020 20:46:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="cJc9BQYb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BA03320663 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 497B66B0068; Tue, 30 Jun 2020 16:45:59 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 46EBF6B006E; Tue, 30 Jun 2020 16:45:59 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 336DA6B0070; Tue, 30 Jun 2020 16:45:59 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0051.hostedemail.com [216.40.44.51]) by kanga.kvack.org (Postfix) with ESMTP id 518156B0068 for ; Tue, 30 Jun 2020 16:45:58 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 1719F8248068 for ; Tue, 30 Jun 2020 20:45:58 +0000 (UTC) X-FDA: 76987059996.10.girls34_3808f7726e7a Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin10.hostedemail.com (Postfix) with ESMTP id E215116A0B9 for ; Tue, 30 Jun 2020 20:45:57 +0000 (UTC) X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,peterx@redhat.com,,RULES_HIT:30003:30054,0,RBL:207.211.31.81:@redhat.com:.lbl8.mailshell.net-62.18.0.100 66.10.201.10;04ygaxs9dpb14zq9r4du7fgxufqwdycek6b1jh48nik7db3sn3s4m5zfi5qyqhn.1zuzg7qzqi7cuasjqeaeynhcg6csxt1zi3617gdou3cksyqbrptzz8towask3mm.w-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:ft,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: girls34_3808f7726e7a X-Filterd-Recvd-Size: 4991 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by imf03.hostedemail.com (Postfix) with ESMTP for ; Tue, 30 Jun 2020 20:45:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593549956; 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: content-transfer-encoding:content-transfer-encoding; bh=sstMP5NBLNFJ42p1Ptb1NInEyGUfT5YQOxqtWfaqyuo=; b=cJc9BQYblcIX6LMbsz7kNsu721DR77xJMYr8IUKwDrkwubxi2FByqEIyBMRLuwVI2CZqe+ s6HT26EsbSZ4+X/VXkC1O7Hwk3+2h3HUb/oKnRRd8Jtu7mnZV+GfYHzfg+HqBbukB3EsoQ sCFqsNGgDxSgL2Yzk4zYaSzVpZPk2M0= 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-105-syc54eqJPIqQPsh0StHQPQ-1; Tue, 30 Jun 2020 16:45:55 -0400 X-MC-Unique: syc54eqJPIqQPsh0StHQPQ-1 Received: by mail-qv1-f72.google.com with SMTP id j4so14638576qvt.20 for ; Tue, 30 Jun 2020 13:45:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=sstMP5NBLNFJ42p1Ptb1NInEyGUfT5YQOxqtWfaqyuo=; b=MmdE+6ZLuz42z0SR7x1vRj0ymBvrFP8nzOjt0CEh+jC4mDGsMVYxrr4uc1hFQOaxq+ Pjkjt5ATGFgCsWEvp6o5M2joK3OW4m8pNlB7qI4MtA2vMoTsk6gg3CGFkV1v88oFs0au 8RPWqGZ9VmJc+s7cSV8knDbrXKtbL6Wi+lNSsECro9UMHzvFQRczGCYGRTumW5Zn9LJQ USEF9FBd00XulYfiGYh6MfMrYjv8ILy90LVU6FQKwqTqCCqN1bgKUo2AxdJIs8OwKy/h PtEzLrj23kQ17lhxn6Xd94yIkcok6zvzVjLzLVdd4X/j4fRpgR//09Bo65OhBHnN5nL1 Qi3g== X-Gm-Message-State: AOAM532v5VpBx5P6hMCaGWp54nqTcrurMSRNcvOijX33EAd/ssUEp4Im gLRO2vpvY3KxIOlBhiUSvTOP/xNQ8MxxaaBHXcNfuauxFvyFHllcti1Eq1Y9bdCmH17NLceb9f5 J1Y0/dI9tY7Y= X-Received: by 2002:a37:6801:: with SMTP id d1mr20922050qkc.109.1593549954016; Tue, 30 Jun 2020 13:45:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyL8+s36Fr/X9eM/aUs84kdpIh/dAND6uY8M4fv2gdc1FLMJbdbBR7ydewQl2OxPf7/WxSloA== X-Received: by 2002:a37:6801:: with SMTP id d1mr20922017qkc.109.1593549953621; Tue, 30 Jun 2020 13:45:53 -0700 (PDT) Received: from xz-x1.redhat.com ([2607:9880:19c0:32::2]) by smtp.gmail.com with ESMTPSA id g5sm4383436qta.46.2020.06.30.13.45.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jun 2020 13:45:52 -0700 (PDT) From: Peter Xu To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Andrew Morton , peterx@redhat.com, John Hubbard , Michael Ellerman , Gerald Schaefer , Andrea Arcangeli , Linus Torvalds , Will Deacon , Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org Subject: [PATCH v4 19/26] mm/sh: Use general page fault accounting Date: Tue, 30 Jun 2020 16:45:51 -0400 Message-Id: <20200630204551.39391-1-peterx@redhat.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 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 X-Rspamd-Queue-Id: E215116A0B9 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 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: Use the general page fault accounting by passing regs into handle_mm_fault(). It naturally solve the issue of multiple page fault accounting when page fault retry happened. CC: Yoshinori Sato CC: Rich Felker CC: linux-sh@vger.kernel.org Signed-off-by: Peter Xu --- arch/sh/mm/fault.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/arch/sh/mm/fault.c b/arch/sh/mm/fault.c index 3c0a11827f7e..482668a2f6d3 100644 --- a/arch/sh/mm/fault.c +++ b/arch/sh/mm/fault.c @@ -482,22 +482,13 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs, * make sure we exit gracefully rather than endlessly redo * the fault. */ - fault = handle_mm_fault(vma, address, flags, NULL); + fault = handle_mm_fault(vma, address, flags, regs); if (unlikely(fault & (VM_FAULT_RETRY | VM_FAULT_ERROR))) if (mm_fault_error(regs, error_code, address, fault)) return; if (flags & FAULT_FLAG_ALLOW_RETRY) { - if (fault & VM_FAULT_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); - } if (fault & VM_FAULT_RETRY) { flags |= FAULT_FLAG_TRIED;