Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp668517rwr; Wed, 19 Apr 2023 11:15:03 -0700 (PDT) X-Google-Smtp-Source: AKy350ZSrbQQgSRtsxnCjkRS3TzoltjXGQ3yDCbIcX9QM7iswmz6eqsLEXStmx83mytIYatMHXWG X-Received: by 2002:a05:6a20:729b:b0:f0:36a3:706d with SMTP id o27-20020a056a20729b00b000f036a3706dmr5123862pzk.43.1681928102875; Wed, 19 Apr 2023 11:15:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681928102; cv=none; d=google.com; s=arc-20160816; b=bvEYbG6PD1VDTkGw8hQTFHCD0w6xB2cwUwof/sNOGHhdwZI9patjVLOD7bf/xawJgD OTyQj86BhfO3Ng6SBQ1vrJjg3XcGoW9vNnnHT4cKn6D3lywOipa1ojgJ3QC9dRN0Vakn MZpaoRhR2qdi+O0ZvjMld+o6q2ahOeqX1zXgRP31uTOiZZUKp4hKlv7LsCeGSHyBTDYo 0mBGzAfXCA8GCVrlUBEoTMqUmFmjSggj4v0iAL98WN1e2clDIaNfLj8EcoQNvhGccVuH pjUUXZKXOvX8XaMnJQbZOlQaKaTatbrgD77x4Yv7zXJGIwLgTbdzO51BWZQXZJ8G3ZWi f3Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Br4ngN1fQglzJjB6bKNoUPG9ISH75ESuia2dlD25OAM=; b=iZTq5smMb88b477Ctv0/N+6Oqu2e6oY6IOlZ/mpjpI1xBGRhbhAaJeWSsMMhSqWYuD C6IYKa4kOS4JsplzkC5xRh0n/Weo0ajNmtQF178zUL0T9K7kRolTt5LOk9A6S5ljY/vu y48nk7u6oWse20CTJyGTBdqrSh5uyfHCarZKCo28eU1JuhFDJHTaAmvwUTs3NJPHW8dw J2eDb1GU9UiREa8Tc6gRqtJC2YMDYlOlpCKp2pRvk/oOwB3BXBHco25OgaS42SXhiYrc 91JNXmk2nsiig+HfV1V8TzGyaMnP4GB1fHA13WYN1wFpBALrRrJo32QkGoRRX5rS76R5 4cIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=DmTdrO5a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a21-20020a63e855000000b00513234112acsi17703418pgk.888.2023.04.19.11.14.49; Wed, 19 Apr 2023 11:15:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=DmTdrO5a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232130AbjDSSFj (ORCPT + 99 others); Wed, 19 Apr 2023 14:05:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230256AbjDSSFi (ORCPT ); Wed, 19 Apr 2023 14:05:38 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6D515FFA for ; Wed, 19 Apr 2023 11:05:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Br4ngN1fQglzJjB6bKNoUPG9ISH75ESuia2dlD25OAM=; b=DmTdrO5al01o/2aGLet2LzP1Kh HKSuvcWgJGPXIExSaKftpDzbfWZsOIjKB+zmCC6cw53ikFQtQoQPwXieSSidnPDrCNTWeb6CAbsJ0 ywZ3kdssiq7PfpzHbYw9knmZHrC5xMYO77TLty+ML2tgUZAuD7TWIoJV5LY9fBNkFQHLGsjAD5Or4 vzagvAx+NI41DswVynQ80v3/LdfXbwPVYsNScPbvNj12vqDOTtp4W0satvvyPjLOmogkkeGVYljTb MgvdZA9XampIYwoYyO8kjpFoxPFd9IcSZCxEty8/54dP/zuZhf9xMRjaOwU81ToPMI5+RHkuvqv4t 7dXJF/mA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1ppCAy-00DT6w-9I; Wed, 19 Apr 2023 18:05:04 +0000 Date: Wed, 19 Apr 2023 19:05:04 +0100 From: Matthew Wilcox To: Suren Baghdasaryan Cc: akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@suse.com, josef@toxicpanda.com, jack@suse.cz, ldufour@linux.ibm.com, laurent.dufour@fr.ibm.com, michel@lespinasse.org, liam.howlett@oracle.com, jglisse@google.com, vbabka@suse.cz, minchan@google.com, dave@stgolabs.net, punit.agrawal@bytedance.com, lstoakes@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@android.com Subject: Re: [PATCH v3 1/1] mm: do not increment pgfault stats when page fault handler retries Message-ID: References: <20230419175836.3857458-1-surenb@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230419175836.3857458-1-surenb@google.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 19, 2023 at 10:58:36AM -0700, Suren Baghdasaryan wrote: > If the page fault handler requests a retry, we will count the fault > multiple times. This is a relatively harmless problem as the retry paths > are not often requested, and the only user-visible problem is that the > fault counter will be slightly higher than it should be. Nevertheless, > userspace only took one fault, and should not see the fact that the > kernel had to retry the fault multiple times. > Move page fault accounting into mm_account_fault() and skip incomplete > faults which will be accounted upon completion. > > Fixes: d065bd810b6d ("mm: retry page fault when blocking on disk transfer") > Signed-off-by: Suren Baghdasaryan Reviewed-by: Matthew Wilcox (Oracle)