Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp50112ybt; Tue, 30 Jun 2020 14:34:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFGHo3G07/L+HellArJGDD/qgrgsRKZgSMe2tpx594vCfKmS8UC3SV3J7YTSaGN2szkl6H X-Received: by 2002:a50:ee8a:: with SMTP id f10mr5710347edr.383.1593552480680; Tue, 30 Jun 2020 14:28:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593552480; cv=none; d=google.com; s=arc-20160816; b=BR1juNN9OMsTidUQuMECStKbV1AuDjOX4GGNglDTNWq/RerEvdE4eIwojK+jrogd6j qjbvpyfNXcXIOI9pPg2UjhIIdv271CzB6nbrIk8pEGq5aqR9paCeWZbZ2QrFFb5W/FFC uFgLqY1NO48QX8BsE9zlpwlxrofneOoimd4M6OyETH1f9WI4ljOb0TAJKYNoDXmUwXsY MZQILCrRTPUPQXhLRKqxBG0G7WJ6xNL99WEl0R/EUTIaoSE52Wu/HeKqEHlkGSg3NHSj Rl6FdeW+gKb28xCUZXt/FrdH30hxFXDChW7WiKnzrKW7socIvpIdXEMj6mGnQjyMbQs8 xgkw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=QmKrOvMWqrUVt7J9PTTUHlaMQYpm2NLJh4q6ELyuhdM=; b=Y/fsaLj840TaKIbNhC/YLf0lIp+6r1ohmW8IBzaFyRJtWypKUmkwHR85VAh4JQwv7M hxCNzoDCqUlBq7A4uqCRfm+5Sax3yRVvOg11QEXhr/y5Rs5Sp4aX4HdjL+Hv7U601Kou NlbfohfzkdIXM47UZGZQL0onUkBDNHNfrGG5nv6K1pglRhwlmrRs7B0tcl+He4H6lXO3 96RcqDCDzllh11/7n/PwlwICdYdGXUCgoSGAYOEtmwKzIBwLzn5x9b9nd3Y7CG30csCV EkAM6BgUVeuAFYyinlVMcku6rJJhf6esQ2EKBwnn2zHWRM6c+HTS+SBnXb+QgeOvfL4Q NF+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JwiSXOsQ; 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 g11si2602550edk.96.2020.06.30.14.27.37; Tue, 30 Jun 2020 14:28:00 -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=JwiSXOsQ; 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 S1730360AbgF3UqF (ORCPT + 99 others); Tue, 30 Jun 2020 16:46:05 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:30751 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726330AbgF3Up4 (ORCPT ); Tue, 30 Jun 2020 16:45:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593549955; 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; bh=QmKrOvMWqrUVt7J9PTTUHlaMQYpm2NLJh4q6ELyuhdM=; b=JwiSXOsQYqjAgYWc0LQIvWC9Ik1Yzc7W3Mxp48IOFDEuSXLYEHxLbJ309jv9um1YUOm3cD tNrirYLdClplwYR2pMhmzCg62q5jCQ9TNNCVwoURC34d7dfXHowxSX4rVv5e++pb3pAfGv oSCMXG7DKOcyDlLp6OK9IZlI5VxPREQ= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-190-rn6iRG4gN5-bbQrdzKijWg-1; Tue, 30 Jun 2020 16:45:51 -0400 X-MC-Unique: rn6iRG4gN5-bbQrdzKijWg-1 Received: by mail-qt1-f198.google.com with SMTP id s30so15264359qts.18 for ; Tue, 30 Jun 2020 13:45:51 -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=QmKrOvMWqrUVt7J9PTTUHlaMQYpm2NLJh4q6ELyuhdM=; b=XCqEPsRu0FQBebH0S5R6dzclIFxpNSpTmDzeEla5kpWSZX/R3aN+rySW+cKGBXke5x MjarZgPEnano5QLd2m82gDdt0KNVwGqJaRpSKOJb7rnEsb6/0WmmPpHlShwz8/syKqrW T7bjfGcJn7sjfXWBsRZPV8w8VqdaVHn0KMJ2WiMjIoWWlDadJ7KsrgBF+c52BwAyKfwm boiScgBDirFJw0aPryrM15aG74SSP4Yt2AFPGpXWaETKaU+ngS028yQeGZqIi7sL90jR 2bEI1GMzD/D6oOOK4spsdXzrKyCWpWdoBhj1zpFWii2vpyW9m4ZJqjQrYL8VRYclnBRN rPEg== X-Gm-Message-State: AOAM5337T7TzZYzkjnGOf70SN2/UteF6KhpAtW+BcE5rhqAFmLIYukOU H7SSrH/oyb3hLBpBVqGEDFXKZlTuffD+/FeKJ2AR6OBVcEOCmDk63KwiCRH3/1fWW1+qnDTJ+8U gxh/OBT0PIUj8JXlvR9CTiwb3 X-Received: by 2002:aed:25fd:: with SMTP id y58mr22804775qtc.310.1593549951208; Tue, 30 Jun 2020 13:45:51 -0700 (PDT) X-Received: by 2002:aed:25fd:: with SMTP id y58mr22804761qtc.310.1593549950997; Tue, 30 Jun 2020 13:45:50 -0700 (PDT) Received: from xz-x1.redhat.com ([2607:9880:19c0:32::2]) by smtp.gmail.com with ESMTPSA id d79sm4006344qkb.101.2020.06.30.13.45.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jun 2020 13:45:50 -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 , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , linux-s390@vger.kernel.org Subject: [PATCH v4 18/26] mm/s390: Use general page fault accounting Date: Tue, 30 Jun 2020 16:45:48 -0400 Message-Id: <20200630204548.39342-1-peterx@redhat.com> X-Mailer: git-send-email 2.26.2 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: Heiko Carstens CC: Vasily Gorbik CC: Christian Borntraeger CC: linux-s390@vger.kernel.org Signed-off-by: Peter Xu --- arch/s390/mm/fault.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c index fc14df0b4d6e..9aa201df2e94 100644 --- a/arch/s390/mm/fault.c +++ b/arch/s390/mm/fault.c @@ -478,7 +478,7 @@ static inline vm_fault_t do_exception(struct pt_regs *regs, int access) * 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)) { fault = VM_FAULT_SIGNAL; if (flags & FAULT_FLAG_RETRY_NOWAIT) @@ -488,21 +488,7 @@ static inline vm_fault_t do_exception(struct pt_regs *regs, int access) if (unlikely(fault & VM_FAULT_ERROR)) goto out_up; - /* - * Major/minor page fault accounting is only done on the - * initial attempt. If we go through a retry, it is extremely - * likely that the page will be found in page cache at that point. - */ 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) { if (IS_ENABLED(CONFIG_PGSTE) && gmap && (flags & FAULT_FLAG_RETRY_NOWAIT)) { -- 2.26.2