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 9D409C433EC for ; Tue, 30 Jun 2020 20:45:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5BA5D20663 for ; Tue, 30 Jun 2020 20:45:59 +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="ajm6FVVL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5BA5D20663 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 35F956B0062; Tue, 30 Jun 2020 16:45:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2C14E6B0068; Tue, 30 Jun 2020 16:45:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1B0DE6B006C; Tue, 30 Jun 2020 16:45:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0224.hostedemail.com [216.40.44.224]) by kanga.kvack.org (Postfix) with ESMTP id F12826B0062 for ; Tue, 30 Jun 2020 16:45:54 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id B5F28181AC9CC for ; Tue, 30 Jun 2020 20:45:54 +0000 (UTC) X-FDA: 76987059828.21.bee40_3a0c7ab26e7a Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin21.hostedemail.com (Postfix) with ESMTP id 8F136180442C0 for ; Tue, 30 Jun 2020 20:45:54 +0000 (UTC) X-HE-Tag: bee40_3a0c7ab26e7a X-Filterd-Recvd-Size: 5530 Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by imf40.hostedemail.com (Postfix) with ESMTP for ; Tue, 30 Jun 2020 20:45:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593549953; 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=QmKrOvMWqrUVt7J9PTTUHlaMQYpm2NLJh4q6ELyuhdM=; b=ajm6FVVLMhpJ0qJ3IrlAz0L73Yn8Mo8DBQrdqh1VITkCuFQAYob6t7aXk4FAdMesiOeElq ZRR97h8Zr6adp7Nvq3PGczMV/khBzzpj8V+AIEAS/4Bs5tjHxVDyRm1Oj7qm9haN4fh5fo unmj5KNLjtaXvZpNXrsPooS5G08r+fg= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-513-ncUOgfMgMLGqxyu6z4Jzng-1; Tue, 30 Jun 2020 16:45:52 -0400 X-MC-Unique: ncUOgfMgMLGqxyu6z4Jzng-1 Received: by mail-qv1-f71.google.com with SMTP id y36so14596458qvf.21 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=MHccHGLoeFRA8BZiMzXOauSkUlbiZ43U+eHuAr7bGeZTlBNaEFBh63oeAe/pv14ch1 h71CuYvrIHFcpd3zXH9xn09qr0Xcnxl1DLyIag0F+LuzGLVRVfdNhG2eS7UQK1Z5gBar nBRu/ku0eh+agIVdj2kOfeKv/tUmMtKo/ANbwUiotIRZKRnrbouoM6mmzBdxYw/m88Bs 01N9tMhvjXyYMbVu5mvNUZX9wd5tvVtXNmEJ+TwXngM/PhJjyZGIpXzGPSIe2esVhMvc QCKga31tcEFstauxmNFSBXaSpnuDLGVw4k6Mp5PQCcfqkxLI0NWHjq70feEitDs3uYcO 4S/A== X-Gm-Message-State: AOAM533dFKycqHaJVaP/aYif8Jk954jDVDMEogD0OHnc9YTbFMaoujUd pojx06pW6wgJHWuPYYxWdW8sqqGuC6fF2a0fm6ZPMDnwEIAqI2oFWBgSaOX/0uAg51W6zresJd9 wo7rkkP2Xzpg= X-Received: by 2002:aed:25fd:: with SMTP id y58mr22804777qtc.310.1593549951210; Tue, 30 Jun 2020 13:45:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/hkCkeODL2Wy8DJkssVjFyiyJsWkeyAfUcqwLI37xKcbykEL4x8zUn+pbQH01QHAlweYYdg== 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 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: 8F136180442C0 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 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: 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 =3D handle_mm_fault(vma, address, flags, NULL); + fault =3D handle_mm_fault(vma, address, flags, regs); if (fault_signal_pending(fault, regs)) { fault =3D 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; =20 - /* - * 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)) { --=20 2.26.2