Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp557281lqp; Wed, 12 Jun 2024 09:17:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVW1djqR4hQ5M2lzne8J4zOdoI8L8Gd/jaSGUE1OwsAziVOLNiGGeA1iBslJX0n5Ao3zjdV0ebW9dulR7uYZXdKUs1yIPfcW+TDbsc2jQ== X-Google-Smtp-Source: AGHT+IGYn464lyDKKPbCiigNrGUROcpLVXN47daK6UpYnux8NzPfKjEcfZvnPQBPWJtRJgVS3LYx X-Received: by 2002:a05:6a20:1592:b0:1b0:3190:96d6 with SMTP id adf61e73a8af0-1b8a9b8c029mr2828513637.34.1718209049282; Wed, 12 Jun 2024 09:17:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718209049; cv=pass; d=google.com; s=arc-20160816; b=vVVhcJS+VTR0xoqGeCx7F7rFZEX2K3ahd9Gop53HhXMv98cx4zYYq5LqJV4d6TgJpL X6ZpCC9MX1y1D8a6E4W2LTT7j/YSS9KlGgD42fife2vVSkiFXduG/mwEWKzxIOFCLgrP bnisIpMu1fstAacpAY42tVcA1FG03MGZKEhkTF9IwvPiJIijL0VIm3RRvRa0EKq+Y9Rm f2/q8aorvUSu4Fp2RfQLY8+syzKdGDFCif6ihNmOqCdBWX8ornQoAHLFDOziGyyEWFNR mPul8eHTVtEQrVuWzPsxk+dnkHNVYDw0LFY2De9waUvIzVg51I2uD9qckgetxNV+utAa S8kA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:references:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to:date :dkim-signature; bh=aePX0hruEKIOA1+M6OG+w8QdYVFE2Ff801XPria8pOI=; fh=cPKELNy0agaNizfWNfLrFBcbW4r9aK+M+/ppQJFZcAE=; b=Q/9Ke9jy4OMk0GawoRSo89dk3W5qcNose//cZaB0kxS2/v6rrjuXpAAVim4PKhO+ku 8LRyFfhgstySybPeGDTF3H4bYC7bVCwQBARVD+RA5yqaJ2/kA053/bhqVH4WNfCxEiU6 1YjvzjJdpyju87Nnj75g/3mF3Ox/F//CcPmMebO52f0wdsfXd9qr0FcIRGkHGOwtneCr MrQ6sVF5m2LpfYlxASdC5X5ibKMd/pe7jdqFaRxnEfc/nxd8aoH7t+XlwlUTECW46BBQ JWqQ7nZkCzvSZFkC7OVXlefRVshzL2zfsA7mcGBMrDd6NyOdCC2xEdKLCueBgvC6ZpnC cwyg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=LGoscxZy; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-211862-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211862-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6e41550aec0si9502307a12.10.2024.06.12.09.17.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 09:17:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-211862-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=LGoscxZy; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-211862-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211862-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id DF10228A862 for ; Wed, 12 Jun 2024 16:05:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 64A5E18132F; Wed, 12 Jun 2024 16:02:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="LGoscxZy" Received: from mail-pg1-f202.google.com (mail-pg1-f202.google.com [209.85.215.202]) (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 BA5CC17E447 for ; Wed, 12 Jun 2024 16:02:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718208154; cv=none; b=KN7fDrOV2Md2GVPqgFvhBFOEucukkddN+dQO4fwE7cX7YgTnysT/g1/VtatHFJogZiHTfBXoy8KD9h8L1c9bd/Dn32RnZx8XLniY+8wR+n4odO4cUxS/B6ppBTJTC5654WqJZskHaXPbh4kbivOZbvWqDWpkZbXgwqsX4p+25cc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718208154; c=relaxed/simple; bh=1TFVrwww23bDZwSiwRJ2jYhuVWiPUIMbmY+tTlCjXjs=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=JdyuqIR8Yhx2DVUcYkxQ+Av/bLzci6jAZO2LgbC10q0vPF25qugXSVhHpFRWnrg7ghUg3k1/rGgu5pPa5pAOX9PLD/S1G3sey66tRpG9U/3qlT9Tx7lJWtm/sCniou0ppYVJm5V6XGUiPYU/awVPMKZRNI50GpAeadCyyxcIxzA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=LGoscxZy; arc=none smtp.client-ip=209.85.215.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Received: by mail-pg1-f202.google.com with SMTP id 41be03b00d2f7-6658818ad5eso5492244a12.0 for ; Wed, 12 Jun 2024 09:02:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1718208152; x=1718812952; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=aePX0hruEKIOA1+M6OG+w8QdYVFE2Ff801XPria8pOI=; b=LGoscxZy6lwkru6Pilm1lF2UQ/tHK+gZWOu43q8UxUWphgVq03Tr44mDFjp4Z3DKDs RWuYXz+E9qH7n7JsyvMVNRwHf7i4YITKTNShsUSFUllJft8lg7HAuy1tP1lpyGaAT9Q3 0UIhPoMlY9GMNpd+mKIeyMqiFDkHXQnVBcdlHQGvkR2FWRFb+h4aR9RkJpVeZIS75vfB 2VSSWI6x8vXBTec/RUAb0LY5lhCXjV9MHVLJ/ao18FPRB+tCClY6M+gF1Eluzq0H3zaD v2Juom3NsZxQQKVVD/sXKLs+B82hY1SoQpjxV7w2KG1HzSqTgbjkr5p0qOqnS6xGguz4 TJaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718208152; x=1718812952; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=aePX0hruEKIOA1+M6OG+w8QdYVFE2Ff801XPria8pOI=; b=LxK+ZXWz+AK/n/pP0c17lad0nx58citkcBWOG6oYkmfgK4bZSOoo+PoZOhunADDv+D o+umJ6RTdnLkfKFTv8jJJ2uhOeLFTedWoY0t6Hh2rvrf6Nnf/tAJS0n6HhMqchuf7Y/y QgDNKkQfs7nXy9P6hUq/nz300HQRtPQ9vyUVQ13aE3qAzqDT1ymUtnmVyCCrop+o5iIW NYilpSVrudoA2FdsWXqcm4YLmWvC5N7P2oqnwqnDLVeCIhi7Tpk7g36qFHNj/rd9tT27 vherkkOTsvheHC5vU0aQUOpfLf8+0cWlmwyE/5LpXLGDBlHgKqBiSMjIW7KMeRbGT+hA 9JKw== X-Forwarded-Encrypted: i=1; AJvYcCWRydaxshm0HJZLGfugeS2fhm639Lxp6rjUz61FwoaKw+je8cBFeKjfwuV5hfjIip5PDbwez9FJR4aYMHIRZrjytG9481b9sztgcKXO X-Gm-Message-State: AOJu0Yz1hIUHMEfowYCdiCDFIZ4yxEkmbgQEbqrhjQupW0OaXcMVPUsN e/Ww1D89mR628071dkuOxzMMRY2wVyC25t66oFpBFLQ3MB8vpMVK399O1LuPHEvqsYgWQiVQ9KK /xQ== X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a63:9503:0:b0:673:9f86:3f23 with SMTP id 41be03b00d2f7-6fae0e6eb36mr4827a12.3.1718208151688; Wed, 12 Jun 2024 09:02:31 -0700 (PDT) Date: Wed, 12 Jun 2024 09:02:30 -0700 In-Reply-To: <20240611002145.2078921-9-jthoughton@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240611002145.2078921-1-jthoughton@google.com> <20240611002145.2078921-9-jthoughton@google.com> Message-ID: Subject: Re: [PATCH v5 8/9] mm: multi-gen LRU: Have secondary MMUs participate in aging From: Sean Christopherson To: James Houghton Cc: Andrew Morton , Paolo Bonzini , Ankit Agrawal , Axel Rasmussen , Catalin Marinas , David Matlack , David Rientjes , James Morse , Jonathan Corbet , Marc Zyngier , Oliver Upton , Raghavendra Rao Ananta , Ryan Roberts , Shaoqin Huang , Suzuki K Poulose , Wei Xu , Will Deacon , Yu Zhao , Zenghui Yu , kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Content-Type: text/plain; charset="us-ascii" On Tue, Jun 11, 2024, James Houghton wrote: > diff --git a/mm/rmap.c b/mm/rmap.c > index e8fc5ecb59b2..24a3ff639919 100644 > --- a/mm/rmap.c > +++ b/mm/rmap.c > @@ -870,13 +870,10 @@ static bool folio_referenced_one(struct folio *folio, > continue; > } > > - if (pvmw.pte) { > - if (lru_gen_enabled() && > - pte_young(ptep_get(pvmw.pte))) { > - lru_gen_look_around(&pvmw); > + if (lru_gen_enabled() && pvmw.pte) { > + if (lru_gen_look_around(&pvmw)) > referenced++; > - } > - > + } else if (pvmw.pte) { > if (ptep_clear_flush_young_notify(vma, address, > pvmw.pte)) > referenced++; Random question not really related to KVM/secondary MMU participation. AFAICT, the MGLRU approach doesn't flush TLBs after aging pages. How does MGLRU mitigate false negatives on pxx_young() due to the CPU not setting Accessed bits because of stale TLB entries?