Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp4612200rwe; Mon, 17 Apr 2023 15:50:06 -0700 (PDT) X-Google-Smtp-Source: AKy350aX56fXIbTsgifAJZ7BKWWNMqnyU3bNZGCGugZncKOMw6Q8b19H7AFZUCcsr9r4S7WtzX6Y X-Received: by 2002:a17:90b:60c:b0:247:4186:69ba with SMTP id gb12-20020a17090b060c00b00247418669bamr17931pjb.31.1681771806124; Mon, 17 Apr 2023 15:50:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681771806; cv=none; d=google.com; s=arc-20160816; b=P12t7yEd+l1RKa2poNHOMDglYj/oPyFAnJ0mc6DITxspLGtmHIRWmVGTAgUTmIojDY BHo/RRxUdTe8BVa2vpN/wGeyHQaXSeVZLCNp4Fxvir1Hwk1u/m4/ZmX/oyV+T55Dma+n iBoorm8Lyk9jJobDsq8pq8EbOU9yVJKOoHSshZMVYWsPjLHQMwVUZs/bhhOB5NP/MohP 1bQLZAQkVYq3WcKoLIy17alW3vwJNiMY9epLsDN+3rTbomF0v42ScB/b8ZYMRuOGBczc hje7IuNhMItQgQSkmO8ktl1epjYzQBo5cHM1ozCs3kZFIchjRrnC74UPscGVRObWTmB/ B3dQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=ErxTGJUykViTqmt6WCCTleQjhu6oxiRybvh3f13WgdU=; b=bp9TnWeQfWGG7HpES8Ao6/3dYkONvHRjx9LxpeYBa1BPwuc8iK9h1qweSQYkBLxChq kPE8AbMBualN8gEom/b0WQRbhYdiTDoV8iVNR2A0Nlna6igjhK57M9Tg9e6j7geMhYJB m93SboV5Xqnviv9RL6jxrcDeps2aC7S+ycQSwRd79oThjPfWnPQ/Ria6Xq8hyqFvhaZu nLH79ZQd1zyX7CLuWh/eUFHm+ePp7hl1bNuVQomJdDbD8jb+1avLgVBmdhpm0Fune61V eDfYplASMsnI30mEK7ZX8gayCEg5DETJYjfXurbGojPLcbiQJlheLPxVAVxTNJNtenzH Y9Lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=xSNtcrKV; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id na8-20020a17090b4c0800b00247b413f4ffsi1570500pjb.185.2023.04.17.15.49.54; Mon, 17 Apr 2023 15:50:06 -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=@google.com header.s=20221208 header.b=xSNtcrKV; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229575AbjDQWsM (ORCPT + 99 others); Mon, 17 Apr 2023 18:48:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229477AbjDQWsK (ORCPT ); Mon, 17 Apr 2023 18:48:10 -0400 Received: from mail-yw1-x1132.google.com (mail-yw1-x1132.google.com [IPv6:2607:f8b0:4864:20::1132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 141C91BF6 for ; Mon, 17 Apr 2023 15:48:09 -0700 (PDT) Received: by mail-yw1-x1132.google.com with SMTP id 00721157ae682-54fbb713301so193639557b3.11 for ; Mon, 17 Apr 2023 15:48:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1681771688; x=1684363688; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ErxTGJUykViTqmt6WCCTleQjhu6oxiRybvh3f13WgdU=; b=xSNtcrKVSjj4TlFzMbctOBaE5nYolpJb0xN9M59zJn1Wd472mjAeT+csdZmQwwGHCe KeNgRF3Il8zjpOocP4lmAHXEYbpO0slHPlqdhV7s3VGPnC1MUMxPltkCGgyTvhafdw49 xXfxJNdPODi22BsQoHbL3e3NAjoUsSZ36wbolu2GUWPQWuJ5o5zQnn3hZTSz1L6hP9ft RVcyRm2K3LaZ0qWMmJxG2H5v64Z6IS3gdxzcomkntNalKBjNbCqBhkOky8swC/sPkh7A ma9Wf0nxejXaQOUALaFbVLTJvNbWSVzjRKASZYq7tSrbIN93zmMJbFkrEzvOx+SPoJh9 iBgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681771688; x=1684363688; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ErxTGJUykViTqmt6WCCTleQjhu6oxiRybvh3f13WgdU=; b=itxHJxt7rK39akaShweOjyOQiiUxbyj90Hd4HVtmM/Yz1aWCS6n5S0fx1V67O9Yng+ mchBLyi8c5PP7La/i3ZCKYkIea+jhadut4ke4puHQdecHmvXsLKLn1bIwrlXMU4xKAA2 mV7/o0nuFZunQauXV8W54+Nqk5MINXFcD1dMZVN4u+UqA73hDsZSEJiOJYX9j+j/PSsq jBtFsIX0VbVMY7woXGL9ULeKgP9ZK+WFF0QeqsYaMNAMx1HalZfqqO3kb2y6gevd+JNL n1wH3sEl1dnpcT7L73ccWvsc+a5AVx+SwaymFnhZFdBfIsFjbxbn+ZRhyljzUY7n9Kpj Rg2w== X-Gm-Message-State: AAQBX9cpjxN5Swo2270bgcIQ9Z7lUBLfgis37C6RrpOgL0hSt/9gBQT4 23A6vsnO6WmU0dz0Vy0dO0qHN0DfVeyouERHo0UhkA== X-Received: by 2002:a81:d44c:0:b0:54e:d618:f86c with SMTP id g12-20020a81d44c000000b0054ed618f86cmr10170524ywl.1.1681771688111; Mon, 17 Apr 2023 15:48:08 -0700 (PDT) MIME-Version: 1.0 References: <20230415000818.1955007-1-surenb@google.com> In-Reply-To: From: Suren Baghdasaryan Date: Mon, 17 Apr 2023 15:47:57 -0700 Message-ID: Subject: Re: [PATCH v2 1/1] mm: do not increment pgfault stats when page fault handler retries To: Peter Xu 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 Mon, Apr 17, 2023 at 2:26=E2=80=AFPM Peter Xu wrote: > > On Fri, Apr 14, 2023 at 05:08:18PM -0700, Suren Baghdasaryan wrote: > > @@ -5223,8 +5230,8 @@ vm_fault_t handle_mm_fault(struct vm_area_struct = *vma, unsigned long address, > > if (task_in_memcg_oom(current) && !(ret & VM_FAULT_OOM)) > > mem_cgroup_oom_synchronize(false); > > } > > - > > - mm_account_fault(regs, address, flags, ret); > > +out: > > + mm_account_fault(mm, regs, address, flags, ret); > > Ah, one more question.. can this cached mm race with a destroying mm (jus= t > like the vma race we wanted to avoid)? Still a question only applies to > COMPLETE case when mmap read lock can be released. Thanks, I believe that is impossible because whoever is calling the page fault handler has stabilized the mm by getting a refcount. > > > > > return ret; > > } > > -- > Peter Xu >