Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp610453ybt; Fri, 19 Jun 2020 09:17:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxoRcLm6mevwGD7gx5f9Hj0bzn0aCYwltA1hUrgzqUpHV9wo0d9jt/8dOxsofaAQlJc668W X-Received: by 2002:a17:907:72ca:: with SMTP id du10mr4358086ejc.78.1592583437956; Fri, 19 Jun 2020 09:17:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592583437; cv=none; d=google.com; s=arc-20160816; b=LL6MB597et6Szxohemt4tTsHAqijbPXnWIoywFfgvSjoxNAOyT17le/saSuN9PFNTe OXeLR0sdFl47AlWkIJND/9UXOtqCjxczzTh4AyzLh5yLZDFRnhJZgj4sF1SVuS1PLGZf msWRnREiMuoOR9zuJK0ph48eBrjtrP9tcMxBKD06jzv65eBK4vwctEN78py/KzqPbU65 Ol9y7eRLCvsmiKZN2N3ICpp7aquj1XnKzDnkS9OMNe/wNpN3vCRMF7jc0olTd0Ga6ueR IolOx7j4XPcW5Aei+wzfxo3j7knp+BdDvSuSDJUB/cag+dW4fSriGans4YmhsUlJnJoG WRPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+T4PahBLwp+qMqIXI+a8sKJL/5YpPnDyt5GJ45wieOk=; b=U+62Jkb+j2y7FB6o1XdDgRU6bFY7hd+jrNCs7Ceut+75/gNltHRXIVohopywZRy6OY +yhAfB/+v8oknCxY236N4SAn3jhKcfckBFSmWkz0886pp92NfxiSKd5KJ9xbl6GX8Ntl Cb0oZdM3mBPSKF6/iGoDhaMGqz+13apRM8JTOWBPH8WauzA9AypcYoxku+ITXeMMPSEO CEcG/tvsa4IqwcnjvlBlqKymPLPTxQUZzG3sTeCEn2zxKs0ingYNSzUn/evNRU9i65mR jzM8WGSN+qbTsMRRN2e16QGGstITz5Rlgey4Wz+B0vlkrDfytxevLpFgJEdyp20IMxh/ 746g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZLEZhxQj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y3si3829726edq.381.2020.06.19.09.16.56; Fri, 19 Jun 2020 09:17:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZLEZhxQj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405577AbgFSQOC (ORCPT + 99 others); Fri, 19 Jun 2020 12:14:02 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:59066 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2394387AbgFSQNq (ORCPT ); Fri, 19 Jun 2020 12:13:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592583225; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+T4PahBLwp+qMqIXI+a8sKJL/5YpPnDyt5GJ45wieOk=; b=ZLEZhxQjyhdyv2ydo0hQqKOJSBFOiE3UI++1ZNHnlv+0GZocK2lbSo8EikGb4ms7GD9dIW vO/jahuqQspheRue9u7hYUYW+Xqs3cr7Jjwqc7KJ2aXMN413fBlEnQz7QGGYxeYSxLXR3R eqTNgpvfpZvEE0YOgHfovXa6m8f8aFM= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-98-4vX0biJMPI6U8HjMZAgInw-1; Fri, 19 Jun 2020 12:13:44 -0400 X-MC-Unique: 4vX0biJMPI6U8HjMZAgInw-1 Received: by mail-qt1-f200.google.com with SMTP id z26so1327099qto.15 for ; Fri, 19 Jun 2020 09:13:44 -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=+T4PahBLwp+qMqIXI+a8sKJL/5YpPnDyt5GJ45wieOk=; b=o2cV7izhM3WcD/rW+w6tccHCBICsIh4WP8kBiFN5aaHhF3GAxhAYrNciJ79p4E3FyR S9KzhIb3HUdsFnbhps7tWWehGXxwzQH3wjyF8XUoHKOOeKyiJbJ8JIqHF4bpMVvjbNAi xh2w9Bzn6YVVxIDyHOgCq54fyowek9+YRvjn4pjO+mqz6sGWJvxifjqP/VVxljHSyYoa /nQOp/JLgXiqleBEbfKTThy1WdRHFrpbFuBDsLbGTjnbW6JWFY5zFdAw11fvBipwsbEr /Yz7RoXd+8HxNa4VPRAuux76QOVcXmppdnTsih6eEM7eBnHfbjZ2hTkQc4CFUikH0IHM d+qw== X-Gm-Message-State: AOAM532SZMT+o/f+lo2nmW5ch9GcIaiWCBwkmsRd9LlQO9OLgG7JJvZW aUzhFCyQnmHIZsO2nWUQloU4IetUg4a1F06ahMpkAG3WVDIPqlM97ZRd5jKkpugdGossci3vGp7 i08HHVQNHYO7Xi6VPAae+oHb2 X-Received: by 2002:a37:4ac6:: with SMTP id x189mr4077372qka.323.1592583223459; Fri, 19 Jun 2020 09:13:43 -0700 (PDT) X-Received: by 2002:a37:4ac6:: with SMTP id x189mr4077348qka.323.1592583223233; Fri, 19 Jun 2020 09:13:43 -0700 (PDT) Received: from xz-x1.redhat.com ([2607:9880:19c0:32::2]) by smtp.gmail.com with ESMTPSA id k26sm7453496qtk.55.2020.06.19.09.13.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jun 2020 09:13:42 -0700 (PDT) From: Peter Xu To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Peter Xu , Gerald Schaefer , Andrew Morton , Andrea Arcangeli , Will Deacon , Michael Ellerman , Linus Torvalds , "David S . Miller" , sparclinux@vger.kernel.org Subject: [PATCH 20/26] mm/sparc32: Use general page fault accounting Date: Fri, 19 Jun 2020 12:13:41 -0400 Message-Id: <20200619161341.9762-1-peterx@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200619160538.8641-1-peterx@redhat.com> References: <20200619160538.8641-1-peterx@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: David S. Miller CC: sparclinux@vger.kernel.org Signed-off-by: Peter Xu --- arch/sparc/mm/fault_32.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/arch/sparc/mm/fault_32.c b/arch/sparc/mm/fault_32.c index 61524d284706..542bf034962f 100644 --- a/arch/sparc/mm/fault_32.c +++ b/arch/sparc/mm/fault_32.c @@ -235,7 +235,7 @@ asmlinkage void do_sparc_fault(struct pt_regs *regs, int text_fault, int write, * 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 (fault_signal_pending(fault, regs)) return; @@ -251,15 +251,6 @@ asmlinkage void do_sparc_fault(struct pt_regs *regs, int text_fault, int write, } if (flags & FAULT_FLAG_ALLOW_RETRY) { - if (fault & VM_FAULT_MAJOR) { - current->maj_flt++; - perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, - 1, regs, address); - } else { - current->min_flt++; - perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, - 1, regs, address); - } if (fault & VM_FAULT_RETRY) { flags |= FAULT_FLAG_TRIED; -- 2.26.2