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=-2.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_2 autolearn=no 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 558B3C433DF for ; Wed, 10 Jun 2020 15:48:31 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 29868206C3 for ; Wed, 10 Jun 2020 15:48:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="XY3AdAwp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 29868206C3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=de.ibm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:To:From :Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=oE9Mq+PZbpp5bSmdrlZER7+9+Hx5kGYZah0isjd5D50=; b=XY3AdAwpSobq2l 3+ZKrmH5G9KyclFQ9jVQbd6qt08jM3fG9l5rlAQMMW8LA39WlAWY+dygcI5NsACnHi1UFpAcQhSM6 edRdTUyGTnMo0UBd1qnoTJgK76ttMVIO8CdfY9QegjLR6TjxGcFTihDyHYXgXnT8P3P9WkqBEotvF P0yO8q7W5MpKyYTTCQGlK/0gTdYr0Ux4h+Kx0aeAr4LIpjsJ6e2Cf3Q864VPhdWFKEvFONAMIgtuc 10DW5RQurkEVTyxZNRbtTRyevf7UQRGKsu5JvszeknjwrNw3LfLtKyJrTJcx25EIHhfqqqQvZ4Pa0 DK3OEX8DmQpuWI1Xh7Tg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jj2xq-0006Xr-Ph; Wed, 10 Jun 2020 15:48:30 +0000 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5] helo=mx0a-001b2d01.pphosted.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jj2xn-0006XD-Eg; Wed, 10 Jun 2020 15:48:29 +0000 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 05AFWZNE136637; Wed, 10 Jun 2020 11:48:19 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 31k2800emm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Jun 2020 11:48:18 -0400 Received: from m0098421.ppops.net (m0098421.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 05AFX7Rh138244; Wed, 10 Jun 2020 11:48:18 -0400 Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 31k2800ekw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Jun 2020 11:48:18 -0400 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 05AFlSns025914; Wed, 10 Jun 2020 15:48:16 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma03ams.nl.ibm.com with ESMTP id 31g2s7yyge-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Jun 2020 15:48:16 +0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 05AFkw2D393944 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 10 Jun 2020 15:46:58 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 48E3F52051; Wed, 10 Jun 2020 15:48:14 +0000 (GMT) Received: from thinkpad (unknown [9.171.55.252]) by d06av21.portsmouth.uk.ibm.com (Postfix) with SMTP id 739E752054; Wed, 10 Jun 2020 15:48:13 +0000 (GMT) Date: Wed, 10 Jun 2020 17:48:11 +0200 From: Gerald Schaefer To: Peter Xu , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Possible duplicate page fault accounting on some archs after commit 4064b9827063 Message-ID: <20200610174811.44b94525@thinkpad> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.687 definitions=2020-06-10_09:2020-06-10, 2020-06-10 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 impostorscore=0 suspectscore=0 mlxscore=0 phishscore=0 mlxlogscore=999 cotscore=-2147483648 malwarescore=0 clxscore=1011 lowpriorityscore=0 priorityscore=1501 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006100115 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200610_084827_810245_518CFE74 X-CRM114-Status: GOOD ( 12.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrea Arcangeli , linux-xtensa@linux-xtensa.org, Michal Simek , linux-ia64@vger.kernel.org, linux-parisc@vger.kernel.org, Nick Hu , linux-sh@vger.kernel.org, linux-hexagon@vger.kernel.org, Linus Torvalds , linux-um@lists.infradead.org, linux-mips@vger.kernel.org, Ley Foon Tan , Heiko Carstens , linux-m68k@lists.linux-m68k.org, openrisc@lists.librecores.org, linux-alpha@vger.kernel.org, sparclinux@vger.kernel.org, linux-riscv@lists.infradead.org, Guan Xuetao , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, Some architectures have their page fault accounting code inside the fault retry loop, and rely on only going through that code once. Before commit 4064b9827063 ("mm: allow VM_FAULT_RETRY for multiple times"), that was ensured by testing for and clearing FAULT_FLAG_ALLOW_RETRY. That commit had to remove the clearing of FAULT_FLAG_ALLOW_RETRY for all architectures, and introduced a subtle change to page fault accounting logic in the affected archs. It is now possible to go through the retry loop multiple times, and the affected archs would then account multiple page faults instead of just one. This was found by coincidence in s390 code, and a quick check showed that there are quite a lot of other architectures that seem to be affected in a similar way. I'm preparing a fix for s390, by moving the accounting behind the retry loop, similar to x86. It is not completely straight-forward, so I leave the fix for other archs to the respective maintainers. Added the lists for possibly affected archs on cc, but no guarantee for completeness. Regards, Gerald _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel