From patchwork Tue Jul 7 22:50:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 11650395 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 0B1D5739 for ; Tue, 7 Jul 2020 22:50:49 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CBD932075B for ; Tue, 7 Jul 2020 22:50:48 +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="BJSEXJu9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CBD932075B 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 EAB296B00B0; Tue, 7 Jul 2020 18:50:39 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id E5E1F6B00B1; Tue, 7 Jul 2020 18:50:39 -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 C875D6B00B2; Tue, 7 Jul 2020 18:50:39 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0175.hostedemail.com [216.40.44.175]) by kanga.kvack.org (Postfix) with ESMTP id 8D1496B00B0 for ; Tue, 7 Jul 2020 18:50:39 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 56AC51EE6 for ; Tue, 7 Jul 2020 22:50:39 +0000 (UTC) X-FDA: 77012775798.23.board17_520c62626eb8 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin23.hostedemail.com (Postfix) with ESMTP id 3385037608 for ; Tue, 7 Jul 2020 22:50:39 +0000 (UTC) X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,peterx@redhat.com,,RULES_HIT:30003:30054,0,RBL:205.139.110.61:@redhat.com:.lbl8.mailshell.net-66.10.201.10 62.18.0.100;04yfb3u6te6qqmz5r11cjocsxwatyopf55h3jr74wubu8j1xn7ohgws49zbtirs.h8b46kex55hs6dpxo7iaxxqbkhw7cbc7t5gpzonpeh9juzh8rysjeuopecomhyi.n-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:neutral,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: board17_520c62626eb8 X-Filterd-Recvd-Size: 5135 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by imf27.hostedemail.com (Postfix) with ESMTP for ; Tue, 7 Jul 2020 22:50:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594162238; 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: in-reply-to:in-reply-to:references:references; bh=Jxvjf7Q+v/mOPCYZqZl27IogKSwgytmGoijHqe+1Kyo=; b=BJSEXJu9uzdeH8zUAHHHmcPRP/1F2zt/RwgVQiRMxt6cEJZMIwmfxKGar/97DRFus7xnmX 6OAEPeo2C1Q4e9jEhslRWI/V6a57X6JOqGP4FaLAJnGQ89tnuEy0VbqAEzoP4yZNwJx4ay ms1MLzPYsHGICiAzOBSXOZ1z1IhpVMQ= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-372-4dTwQpLSODKxQ-YNNT8n2A-1; Tue, 07 Jul 2020 18:50:34 -0400 X-MC-Unique: 4dTwQpLSODKxQ-YNNT8n2A-1 Received: by mail-qk1-f198.google.com with SMTP id i145so10757469qke.2 for ; Tue, 07 Jul 2020 15:50:34 -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:in-reply-to :references:mime-version:content-transfer-encoding; bh=Jxvjf7Q+v/mOPCYZqZl27IogKSwgytmGoijHqe+1Kyo=; b=bjndU17mmSDBMVOe6RN1Zwu5C6RSeq2dEdl+9emQiurTvmX5ekkhCzyUhw0+MqSPMB xrh37e8feWcdXT+abm58/3HHzbT89xbl9RelXXv2Xj741kODStr4vOfvEHYeLmOs1xvy m8F62QoOUIfdydU8p9461dbULe2GB9sVCOfiCLybX2I1YLTzDQpIPJiMQmUKNlqJTU/s bmFGQ472rofrf7b68f9kFIMhEdSQSJhAaJd4QDAfTLOSwOoin9qk0R+G/ayKyIYls4PM XSqohLdooG81RLMHN2wfYkxaSzXyLMz71jSvtVerUz3q2jzjkzolJuXrzqSFg8Z06rXR UV6w== X-Gm-Message-State: AOAM53270RWqROlagWJ4HYl5s+AQJy/XGFVhSkRrK/dc2mM9PhnhCSFK sVeMUU85mrIKL7EulECL4KoIgeBRveU8OGy8xYM9jwNP+L4aMvasumRZCLlpRYe1C0wY2dAn+X/ ls3el0VSCDZ8= X-Received: by 2002:ac8:16b2:: with SMTP id r47mr57607215qtj.273.1594162234487; Tue, 07 Jul 2020 15:50:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEUX4FOONaw2ZO8mmmd3zmBYLqC03cLLhe3ytu7deLkE6Bv0g/Xef2K2OGzTk+bX724w5ibw== X-Received: by 2002:ac8:16b2:: with SMTP id r47mr57607196qtj.273.1594162234214; Tue, 07 Jul 2020 15:50:34 -0700 (PDT) Received: from xz-x1.redhat.com ([2607:9880:19c0:32::2]) by smtp.gmail.com with ESMTPSA id j16sm26267642qtp.92.2020.07.07.15.50.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jul 2020 15:50:33 -0700 (PDT) From: Peter Xu To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Gerald Schaefer , Linus Torvalds , peterx@redhat.com, Andrew Morton , Will Deacon , Andrea Arcangeli , David Rientjes , John Hubbard , Michael Ellerman , Guo Ren , linux-csky@vger.kernel.org Subject: [PATCH v5 06/25] mm/csky: Use general page fault accounting Date: Tue, 7 Jul 2020 18:50:02 -0400 Message-Id: <20200707225021.200906-7-peterx@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200707225021.200906-1-peterx@redhat.com> References: <20200707225021.200906-1-peterx@redhat.com> 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: 3385037608 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: 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: Guo Ren CC: linux-csky@vger.kernel.org Acked-by: Guo Ren Signed-off-by: Peter Xu --- arch/csky/mm/fault.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/arch/csky/mm/fault.c b/arch/csky/mm/fault.c index 7137e2e8dc57..c3f580714ee4 100644 --- a/arch/csky/mm/fault.c +++ b/arch/csky/mm/fault.c @@ -151,7 +151,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long write, * the fault. */ fault = handle_mm_fault(vma, address, write ? FAULT_FLAG_WRITE : 0, - NULL); + regs); if (unlikely(fault & VM_FAULT_ERROR)) { if (fault & VM_FAULT_OOM) goto out_of_memory; @@ -161,16 +161,6 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long write, goto bad_area; BUG(); } - 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); - } - mmap_read_unlock(mm); return;