Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp685351rwr; Wed, 19 Apr 2023 11:30:13 -0700 (PDT) X-Google-Smtp-Source: AKy350af726xBeTkclnlF530+t1J2UWcZVQ07lfRN4n9Pzf2DLvi925gSCr5yEma/Gb7cvANRyoV X-Received: by 2002:a05:6a00:2d29:b0:63d:2d99:2e92 with SMTP id fa41-20020a056a002d2900b0063d2d992e92mr4928567pfb.17.1681929012820; Wed, 19 Apr 2023 11:30:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681929012; cv=none; d=google.com; s=arc-20160816; b=qVSwtXBFycoRdNVmcf7zWwFW8vjT4bjO9CbBbuN04b3Gnq7HbpW62oPGn1jioxesVo sUtloAigIheYUzwz9BgG55ooH4+htRMhMVSsS8XRSn8kRJyA+HT6fTQYoeE64chowg2I gTuGCor9Pi0T14Io2W6FaQIE3jK08yYvI0zVL/Q0AWLSjRHjCK65NDlfXcIkk2pJHYB4 S0zYyu4zFu3L4NkRap07ANm8oOTMZssyBoJTTzU6d78vw0cRHeKzC8dujbW41Q9U90AO fyYnWy7z1XHDp5YzEEgB4FDlyqmklfYNiuZ2By01gO8b8FNHmkjkE4wPLPERzC0o8Ehg XrMg== 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=2onLLBooGq3bEAgd4FBs+LTfCCveM4cC504bz5pRP5U=; b=qWp6a1oVH73XM0+kcDsPUFbMdkDH1VRr7k6VH8VXfjn94NwvMncCls8F5Uy3YZnwHI 7kVE2Cd0gULLLncVyYaNyt2Ww3hjla9YMk2CbfgEDv63i4IorTPcqdRhrvZgvC9W6kHz AdlKUVDI02Ja/4qvdmyp/AJLjr5Igc/MCMzuksvEEz5RIVy9Kxc5owCeApUWtnzd2SLq 587txcMhV8cfualkNFCBo1HqGB1CsqYjBZ6d1MDin5u5RIHArZXIYP8wdSb/pcXj0UrC AFnuy0Y4nHd5ClcRJksTBrPGeh34ZSxonhY9W0l8DmSORKLgTK0pTaw/ATdWAzcYAlLP qJrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Y0in4j2i; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v3-20020a655683000000b0050bf5b9ad11si16241967pgs.752.2023.04.19.11.29.58; Wed, 19 Apr 2023 11:30:12 -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=@redhat.com header.s=mimecast20190719 header.b=Y0in4j2i; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229721AbjDSS2M (ORCPT + 99 others); Wed, 19 Apr 2023 14:28:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229477AbjDSS2L (ORCPT ); Wed, 19 Apr 2023 14:28:11 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0254940D7 for ; Wed, 19 Apr 2023 11:27:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1681928845; 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: in-reply-to:in-reply-to:references:references; bh=2onLLBooGq3bEAgd4FBs+LTfCCveM4cC504bz5pRP5U=; b=Y0in4j2idOKKhORL6Ewqc7QV20pr6tu2Q6qUjlkNX/6w65tOZFu357HvZTqFLnoQa2INMF SahziPHZLR6afffrmLVm9+vtssrXVlBFGXo/gw8WFUv44XLUgFowDi2n4+ly7tcI/hlscH QzVxkrOZGWybs7PwdmvVc08BPeF3ADE= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-182-eOtgbIh1PeGTxSYBqYDnnQ-1; Wed, 19 Apr 2023 14:27:24 -0400 X-MC-Unique: eOtgbIh1PeGTxSYBqYDnnQ-1 Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-3ecd50d9db9so164271cf.0 for ; Wed, 19 Apr 2023 11:27:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681928844; x=1684520844; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=2onLLBooGq3bEAgd4FBs+LTfCCveM4cC504bz5pRP5U=; b=DvgxUQHKlCMT6VWwohAah+HDWbmPrJSBJSYMPL0v3TYkJ82ocNO86YFxhwfgat3jmi Ut20cqLIusCBFuM/teUjbZM96A3M7es56UQjxU0HoHPOdFiJwYFPrCSUCtdTRHqCsESs pmcrr9GpEPoW6n5BcR8Bwvt7bhNGz0XSewiy0pkVQ0/cz+NLGqkv+6L08O2yTypYHDsE 5V1b539/qXuYVYVfhWgRlVhyjShvgJNSigb6nmspvYxIJdcC3jQRZo2v+xvfOWBCoC7L HDYGOpsSI6wH/6C/cYHaKPSiX/CSkc4+WlN95POTeWRh/3Gf0jNafgqR4g/981Ai/RqP iHLA== X-Gm-Message-State: AAQBX9cZexMJfzlM0r4Sh7hzrVj2zmKCblBHeSgnSIzfvY3iAWjq6quF M/ME/drlkg8PE1YPdXekH3FVzKz0MWFrrls5CQs6PCblObBr7fY08eKYw5PKbzC0UCjfbAdv6j8 92EkASqaKfkW6SK2PMMoT0GQD X-Received: by 2002:ac8:7f09:0:b0:3ef:168:7833 with SMTP id f9-20020ac87f09000000b003ef01687833mr22897595qtk.5.1681928843882; Wed, 19 Apr 2023 11:27:23 -0700 (PDT) X-Received: by 2002:ac8:7f09:0:b0:3ef:168:7833 with SMTP id f9-20020ac87f09000000b003ef01687833mr22897570qtk.5.1681928843652; Wed, 19 Apr 2023 11:27:23 -0700 (PDT) Received: from x1n (bras-base-aurron9127w-grc-40-70-52-229-124.dsl.bell.ca. [70.52.229.124]) by smtp.gmail.com with ESMTPSA id i16-20020a05620a405000b007468733cd1fsm4814337qko.58.2023.04.19.11.27.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 11:27:23 -0700 (PDT) Date: Wed, 19 Apr 2023 14:27:21 -0400 From: Peter Xu To: Suren Baghdasaryan Cc: akpm@linux-foundation.org, willy@infradead.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=utf-8 Content-Disposition: inline In-Reply-To: <20230419175836.3857458-1-surenb@google.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 Acked-by: Peter Xu -- Peter Xu