From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A81371624DF for ; Sun, 10 May 2026 12:45:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778417138; cv=none; b=Klrzh3MYiMFcROGu7fc/oV/VJ8Ph/pcwKrqmL5rR3zTnv/26xQjJcslXQZhHFVHAaYRCiB4YvO/n+2aqsW0ZKZX7gn/hi02Px/V6ut9CtDrY+Q7rdCnnzEcnqnpg0iH3xzD/EnK7ijdBFwBh0ZbLPZkJu1+QfRQp7VRirfutFPg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778417138; c=relaxed/simple; bh=X/hFAuublZo3137FXmtleJGVotYYNrBYRLCfqdxFdXc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=eihoGcK50d1wHr6P7tsuuAe1MePcJJBb6qyx5fcFnHL7g8Nf7ktHqMPSbqo7nmQm/tMoKPxuRxS99t+ITxynvVwJzz9EeyBo1GTeORfqfZnTsHVxyBjM/uAJIEIAxzEii6E7szb6uS7nicnFsvMsRdh+HJWwfcrozdXRX+Ec6SE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=bKb4u5/f; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bKb4u5/f" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-4896c22fcbaso29725725e9.0 for ; Sun, 10 May 2026 05:45:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778417135; x=1779021935; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=kdhWyaWXzaWwO4E5O8KkAS5mbQAZBKf8kRalyM8PNnw=; b=bKb4u5/fLKbqRpG3iQrNaE6bt+UKYRAsMmCVWsgU51dSdH6K/yHBXipeR1gwX0aOGO 0nFOnceXnd+pHZYkZsnwLiXXBgGKeXESG3rv7H+zzCTYR3S5Ftus4HK6czh98KLlok7l kR+P57y9DrPv82p1j2JgB4pLQagJik5HDCAi1e9JHQBcLRpsZqEzzNuYfZGUqjtgrgzr xcGxVXASLzYfRE/Qf5hyS+zGPvwQj1HYKmcMQY8Uk3PpHjJHNHH4mkj5YxaHFO3rMlHl GZbD5B4JZH5DQ5ldlUk/T5CKF/PuBO8+LrnUF54ehgSCLp4xgU9NviZcvWLf2/b+ZJzz w92g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778417135; x=1779021935; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kdhWyaWXzaWwO4E5O8KkAS5mbQAZBKf8kRalyM8PNnw=; b=MZCHdBFjZSjdv1Td2ZdYKkRwOP0cQ689VBbu9abFFn7NJadxBrS9jMgkAHS7hBK/yz mIgQmtM2kp6qnr2ljsd31kT6tsacqcpxBDdhGRy9yYmLEkWQiiPTaEkqp04c5Mp5txJO 9OEyp1aXEBzxMQXE+MnKb9At2Grvc4zi97NSwhcIuQvImxlkQuGqGv3/UgIweQ9iWLe/ mEGHku2MtKy2lfD8jZU+YqqtHucL1GpFKa24hlM5t+JyQhg9jKfORIX6YeWvYMdXfdS1 iPui10lJvnGky85YFCwNXSQutXCz/EH/rFLp/1zGFkjgWKW4e5Bc/rMnn4gIXQaNbkfj UZOg== X-Forwarded-Encrypted: i=1; AFNElJ/EsLYVNCGYCI+HG+NBwg7Ja3w8S10DSpSbRm3NTt1Wmy3uyvzDSHBmVLvzK/g9+9sjjMdn0XPkfDDo9Xo=@vger.kernel.org X-Gm-Message-State: AOJu0YwnaY4IMMG4Xl18UennXj+jOs3Gi02jV3CwvFGPy8Bt4r+v/FBN U+7V91tOOpSHGlvbl7kXmoJbs6ShojNCeMS4PxryA8omcxEQJg5BOKBwRT0qzoBb X-Gm-Gg: Acq92OHiLEYDOzWEb1MNvA7zoXlQlIBR6vmYK22Y4AzOyZ1IUH/cK7Tgc93LjwRBuQl oZWmk6uFVyD9xnLDghVhmJ/QXnwd4Ll6VCjk8lSNJ+8lG4yYw+GuCQ4V7GpHWXcmOWRV5daMn/Y XoaTgXOjLju/yE5bwfzjIC8Y7JauQ6PbkcTExhBY2ozzF2191/NUmKUNchfOrDLBHo1RhdMm8pI Fw1ciNjQUCv14x55yyOY2uJDp1VEonBtsdS/jcKw49QQivKdarEQtbS2H0K2ifIbQsv17kw5l3d L0xDBSELjlaRNXGEwjFqY2wPMxY3gmxk1y1LuAjWVOix311pZBpUT6yWaUVw70W59uHSOktY40j PqgHqYsR9yQNrq7f8XSYxoXe70hucQaTON3YUhQTigTpSr5T6Ty3eV4o9eUlGmtlZo7NukEUSGq /dPzxGsCSQDcJw0vEtMcvqPFmlnAyOTdoOwp4VyivnVzl+fDXi X-Received: by 2002:a05:600c:4695:b0:48a:76a3:2b9b with SMTP id 5b1f17b1804b1-48e706b26fdmr93427255e9.17.1778417135052; Sun, 10 May 2026 05:45:35 -0700 (PDT) Received: from fedora ([94.119.44.1]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-45491bae13csm18186868f8f.29.2026.05.10.05.45.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 May 2026 05:45:34 -0700 (PDT) Date: Sun, 10 May 2026 13:45:32 +0100 From: Vishal Moola To: fujunjie Cc: Matthew Wilcox , Jan Kara , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Roman Gushchin , Haoran Zhu Subject: Re: [PATCH v3 1/2] mm/filemap: count only the faulting address as a mmap hit Message-ID: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Tue, Apr 28, 2026 at 01:59:43AM +0000, fujunjie wrote: > filemap_map_pages() reduces file->f_ra.mmap_miss when fault-around maps > folios that are already present in the page cache. That hit accounting > is too generous because fault-around can install PTEs around the > faulting address even though the fault only proves that the faulting > address was accessed. > > Move the mmap_miss update back into filemap_map_pages(), drop the > mmap_miss argument from the helper functions, and decrement mmap_miss > only when the helper return value shows that the faulting address was > mapped. Keep the existing workingset-folio behavior unchanged. > > Signed-off-by: fujunjie > --- Reviewed-by: Vishal Moola