Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp809670lqb; Wed, 29 May 2024 11:05:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV3ezRQ05kK7MNoa7jXhrUTwZkSWqlqyDwsomFPFDmN1lS/UBRiDt63ZCYs5bb2G43vwD4eZY0N2q3HTftEkt0plNoAPg4JYdggjro2BA== X-Google-Smtp-Source: AGHT+IHpgjfu44+OzwXlNMt431GPa38tsw1nGD+r7FtEst26TtD1gR+8cPpD2d9L0dSARc8dLlyu X-Received: by 2002:a05:620a:c4c:b0:792:988f:5916 with SMTP id af79cd13be357-794dfb6c12fmr538397785a.5.1717005948252; Wed, 29 May 2024 11:05:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717005948; cv=pass; d=google.com; s=arc-20160816; b=s33OEBCA8XXekGoI7+aGwSFQN7TuZrj3iCtWHeJBo2lMyo1TaQKx+hnsYPV8yEn64n YWklrIlKhYXl4UBwKr+eXM9qn2Hoef933h08isy1j2wsGLqIvd6ABGW77xM4YU89nt8V C2qcrbrJ8WSZbj7Mh/iIljIQt4KBRnfkHzneBBBM7cdm5/k0LLL8QiTTfvLugSJAJ8Ig Dmovk/5wxPV5H4kK8rotRW1dKWRO7fyE2ssXiu4FLKF2ohR2Oi2/lfUkEsv80qaG8RqA 1DTmbOyUDGgLZLrTp745SQx1TOssr/OH0RyFr09Gov9VpTC56Ln8VcTKOnVOTrpYCy2f qdyw== 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=nPLVZGS8AMw+CagEZYqGOZQVma0bD0XI55fQjmFacis=; fh=dMgCcnEK2vheEIkearuvGpDdj3FKMJ3dGxFrIBM1o0U=; b=P/g9NxLTBpnFkq5GvtM9MykF2SOQNzKRSMrwGifIGp4+mKGfLmsCdpgWk/U4pIr8cs spyi9aWebIE8aGiJNZ5WC6Zshi9fEVAGWL0NRtcxAC1BOGzmMVfQq+zc7Is9984BtIh4 cNbQBPRoP9+3tOWbVW1JYm07749rY9b8siBsvNStzB41qjxtcW/ARVOxZaADotE+kVP7 7yN1jwBXZMCTwXbFsUzhzegCPaRmxQr4NCQWzagQw38wwBu0eKksdyloQ/3VwQlUEVuz naCGQA+d5y1KeDJVGuu922+mvmqfW5As7xJQzkP/h+zCX0eGYm2BSqtKFZ0b5+8az9k/ UXIg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=CC4UcVbw; arc=pass (i=1 spf=pass spfdomain=flex--jthoughton.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-194546-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194546-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-43fb18c93ffsi146063131cf.693.2024.05.29.11.05.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 11:05:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-194546-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=CC4UcVbw; arc=pass (i=1 spf=pass spfdomain=flex--jthoughton.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-194546-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194546-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 02A351C23047 for ; Wed, 29 May 2024 18:05:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A6DD91C2320; Wed, 29 May 2024 18:05:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="CC4UcVbw" Received: from mail-vk1-f202.google.com (mail-vk1-f202.google.com [209.85.221.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 6E5751C0DC2 for ; Wed, 29 May 2024 18:05:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717005921; cv=none; b=ZgoyY6wSx2e2JYTkJGAt2ZHiQHNGeCjhAzTM2QtBfgde3XGVT6JWW+JQtcNAoR0Dp+P4MUU0ZmE3zLKTGgXHpxFVhpOJN518uFEEJT6sORTVww3ez90acl6DdmVNdYe4YA0j/NvcTmQFIoY3wKz5DiX4Fd4O8shYLEL3AxuLNno= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717005921; c=relaxed/simple; bh=rClDOFeTBM3INZgvPf3xqhdotKn3Xjpsol6JPcgeiiY=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=dGAh8HlmrxGkIY0NCcXfz5uF7/gCPxg7qsz7A5QOWLsgjAkxwsQ7o68a2fjL/gdw0mtfttZE3SRVeRbIcaiIDK3ZlomOg3yIlH0VPlD8lWxOYfuviniAbw6qnG0ai4s5BWveV+5+eT977KY2r7L7AyPdEcKWaTD5EdgJb80yfgM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jthoughton.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=CC4UcVbw; arc=none smtp.client-ip=209.85.221.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--jthoughton.bounces.google.com Received: by mail-vk1-f202.google.com with SMTP id 71dfb90a1353d-4e4f007b7beso20151e0c.2 for ; Wed, 29 May 2024 11:05:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1717005918; x=1717610718; 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=nPLVZGS8AMw+CagEZYqGOZQVma0bD0XI55fQjmFacis=; b=CC4UcVbwULTuGVoAfXx6HOyqloX49BTtf0JjisU9VF0+bW40Ee1I0GJa9LZERIqQav jZ0hGCrSf3iKYqQM+gdaqIh/H627pYv4M8orIF9963maJRklsNYZeNECH4dEjdn/0bJp DFuQG38Gxpj0dI+k2CxVNgRbRTsv5BztRWfOiA75gndMG8g7IA/EsxbLX0qXPGjSucys POEviCxs2pZKLFZAKzX5/EgIzi/9Vqu82w410h4g+IAB/rih/pKF4372+HacUVhg/wX2 8ODDZeFz1Vr08RzMm+/txHByVx7LqPO1iOGRSmSv4prndSwT91oVvkHk6vYGTxwWyAtr iwfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717005918; x=1717610718; 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=nPLVZGS8AMw+CagEZYqGOZQVma0bD0XI55fQjmFacis=; b=PFiSwHMIo7LAk90cCmXdwQU7wGMbrEZxLMyWfyifwNIW5fVEu38Lqd/Kg6KdqAVbKE ArXca+i+bJl5G8Lvdz1NjKfzJRtVW26IZiaeuHeVgib3wgMg9L5lYtYy/2/jJ548pi+Z dT6qdxKn/ZkZUcj7jiR3faL1E35PBGEOA86TWCsOWSdRRZT6Z/Z3+XbTBuF8/ALhf59W OjlXpu2mBqsmkcvnKVaUujj+/t8+16qYzCFP1ZNOmzPpsAWeXHiF/khccgay8OHkc8b1 rw5fsPEzvuTHgOvaNn9jCiWUpxqR7k08cOvu5oppci0KAcS6LsrX8rYSWWcJmzN1QV7Y edAg== X-Forwarded-Encrypted: i=1; AJvYcCU2bo0DWbn7b8qD9EpJm68Sz6buVzJ8DCCazF/dzWOPBZG9YeDevCEsqB9cNRd6rhSs5J2p0OTnkbTSXSRrQdkUxaMyWJWDaRiz1Lgk X-Gm-Message-State: AOJu0YyU1Qs5AX0w9KbpAv6HQbRw3KCLU4aj5jNFeGFtvfIZc6wOdL9U +Q86FtGIi51htqAHX39YEOBcYzGdDvlUExywA+i25Y8EUcTFRhQFzCYmqU71vQTlQchT9IKC26G zxvlUn/0DjD2Tvq4bBA== X-Received: from jthoughton.c.googlers.com ([fda3:e722:ac3:cc00:14:4d90:c0a8:2a4f]) (user=jthoughton job=sendgmr) by 2002:a05:6122:2006:b0:4d8:797b:94e0 with SMTP id 71dfb90a1353d-4e4f0112182mr502860e0c.0.1717005918294; Wed, 29 May 2024 11:05:18 -0700 (PDT) Date: Wed, 29 May 2024 18:05:04 +0000 In-Reply-To: <20240529180510.2295118-1-jthoughton@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240529180510.2295118-1-jthoughton@google.com> X-Mailer: git-send-email 2.45.1.288.g0e0cd299f1-goog Message-ID: <20240529180510.2295118-2-jthoughton@google.com> Subject: [PATCH v4 1/7] mm/Kconfig: Add LRU_GEN_WALKS_SECONDARY_MMU From: James Houghton To: Andrew Morton , Paolo Bonzini Cc: Albert Ou , Ankit Agrawal , Anup Patel , Atish Patra , Axel Rasmussen , Bibo Mao , Catalin Marinas , David Matlack , David Rientjes , Huacai Chen , James Houghton , James Morse , Jonathan Corbet , Marc Zyngier , Michael Ellerman , Nicholas Piggin , Oliver Upton , Palmer Dabbelt , Paul Walmsley , Raghavendra Rao Ananta , Ryan Roberts , Sean Christopherson , Shaoqin Huang , Shuah Khan , Suzuki K Poulose , Tianrui Zhao , Will Deacon , Yu Zhao , Zenghui Yu , kvm-riscv@lists.infradead.org, kvm@vger.kernel.org, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-riscv@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev Content-Type: text/plain; charset="UTF-8" Add this option so that one building the kernel can choose whether or not they want to support walking the secondary MMU. We want users to be able to blindly enable all lru_gen features to have the best possible performance most of the time. Walking the secondary MMU is mainly useful for be able to do proactive reclaim, and it is possible that doing this can harm VM performance. This option should be enabled by users who run VMs and also care to do proactive aging/reclaim with MGLRU. With this config option enabled, a user can still disable the new functionality at runtime through sysfs. Signed-off-by: James Houghton --- mm/Kconfig | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mm/Kconfig b/mm/Kconfig index b4cb45255a54..3ac4b1dbf745 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -1222,6 +1222,14 @@ config LRU_GEN_STATS This option has a per-memcg and per-node memory overhead. +config LRU_GEN_WALKS_SECONDARY_MMU + bool "Walk secondary MMUs when aging" + depends on LRU_GEN && LRU_GEN_WALKS_MMU + help + This option allows multi-gen LRU to walk secondary MMU page tables + when aging. This allows for proactive reclaim, but this can reduce + overall performance (e.g. for a KVM VM). + config LRU_GEN_WALKS_MMU def_bool y depends on LRU_GEN && ARCH_HAS_HW_PTE_YOUNG -- 2.45.1.288.g0e0cd299f1-goog