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=-9.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 7B91FC433DF for ; Tue, 30 Jun 2020 20:51:27 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3DC6720702 for ; Tue, 30 Jun 2020 20:51:27 +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="VifhG8tw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3DC6720702 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 D47176B0005; Tue, 30 Jun 2020 16:51:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CF8EF6B0083; Tue, 30 Jun 2020 16:51:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BE6646B0085; Tue, 30 Jun 2020 16:51:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0147.hostedemail.com [216.40.44.147]) by kanga.kvack.org (Postfix) with ESMTP id A63426B0005 for ; Tue, 30 Jun 2020 16:51:26 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 6B41E181AC9CC for ; Tue, 30 Jun 2020 20:51:26 +0000 (UTC) X-FDA: 76987073772.23.stem87_32037be26e7b Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin23.hostedemail.com (Postfix) with ESMTP id 3FCBF37606 for ; Tue, 30 Jun 2020 20:51:26 +0000 (UTC) X-HE-Tag: stem87_32037be26e7b X-Filterd-Recvd-Size: 4859 Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by imf01.hostedemail.com (Postfix) with ESMTP for ; Tue, 30 Jun 2020 20:51:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593550285; 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=7ODhBJEySE25lLdIL36bUDM3v/f2DyEns/dEg5PpJb4=; b=VifhG8twFoZrnpjBYYX8cKhuqVWrIwSmQYKs+SYNo4w81X8zYKQsKXhvvLLxsha8zXauCl Ka3jhFvyHsoso5n4LRDOisxwPj4dLozmr2ekwHGIfmtTOk47EpfJwTeB799eKY4bnwV4i3 FuQmxoVrTeW5LDKrJCtSoV9W/CTcejI= Received: from mail-vk1-f197.google.com (mail-vk1-f197.google.com [209.85.221.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-514-mc7-22IwN1-exq4Xb0KxqA-1; Tue, 30 Jun 2020 16:51:23 -0400 X-MC-Unique: mc7-22IwN1-exq4Xb0KxqA-1 Received: by mail-vk1-f197.google.com with SMTP id n129so3558971vkn.0 for ; Tue, 30 Jun 2020 13:51:23 -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=7ODhBJEySE25lLdIL36bUDM3v/f2DyEns/dEg5PpJb4=; b=MHXFtykCBQztpdFaPl8QpuNzIy/w0Unxd3z9DtVjL7TYfE1DVxdZ61b33FDX/XNBpT ShVVDGRxfa+pl43S9YOBpK0QXp8KmaTvBwbteO32HUsZ+AYO8MCl3UNCjiVWDbHL3ngC CJG1dcNuKSobM9nIrJNDWmwywA6/W9GxMcCUK1rllVwBmTnUl9xrqTZ148FN9lnX6Hgr /86m0S7uq3uvIxr6DzgQ1j10p5mr+JwI7F+Sh01zGWgBxCM9sG22L8Uh8MHgGnVOybRh mzPrucp7uoB1ttEhACHnyX1Yh8Cp5uFOCeESeAIcTvGVIIfYsX/T5p9DOdLSn8mku52C XBtQ== X-Gm-Message-State: AOAM531MEIgdqPzwZ/6wGVZe9vtG8zNfoUQPeyNQJOBnN/DmJuhbKds3 AGrE/VcEaBhVdghtooLhFSUqQKtjO36od0ILKtQyk46Q8w14x/T9yHmuZoMoEU+UXryE6H5TPpA G9hLSdCmYC7Q= X-Received: by 2002:a0c:a306:: with SMTP id u6mr8860906qvu.88.1593549920886; Tue, 30 Jun 2020 13:45:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4ZC/3hV5sZ3jrFOaj/HrUvlBV2LSVm33S24f5OpZpmLOt/vUUR0YiRw9Ypkc2T/z0QGSYbg== X-Received: by 2002:a0c:a306:: with SMTP id u6mr8860803qvu.88.1593549919465; Tue, 30 Jun 2020 13:45:19 -0700 (PDT) Received: from xz-x1.redhat.com ([2607:9880:19c0:32::2]) by smtp.gmail.com with ESMTPSA id y16sm4443907qty.1.2020.06.30.13.45.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jun 2020 13:45:18 -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 , Guo Ren , linux-csky@vger.kernel.org Subject: [PATCH v4 06/26] mm/csky: Use general page fault accounting Date: Tue, 30 Jun 2020 16:45:17 -0400 Message-Id: <20200630204517.38760-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 Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 3FCBF37606 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 Content-Transfer-Encoding: quoted-printable 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_faul= t(). It naturally solve the issue of multiple page fault accounting when page = fault retry happened. CC: Guo Ren CC: linux-csky@vger.kernel.org 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, u= nsigned long write, * the fault. */ fault =3D 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; =20 --=20 2.26.2