From mboxrd@z Thu Jan 1 00:00:00 1970 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 C4B141B5806 for ; Wed, 14 Aug 2024 14:41:21 +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=1723646483; cv=none; b=PD1ww+jzQP0dw7vSc34N4JkTRLD3UgGIYREK/DzPSeWAKECHZ5jJPK7Cg9EJdfOHZiyds8H6c+MFTB7US7m7IXbeFQRH7lJALa937DZK/RYedGRNQDCnIchQ0sMqCv49FiypRrGmFJXN9iMVQzmFrb3eGkhXB5gp0uQKV0+Qk+Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723646483; c=relaxed/simple; bh=5ImcRxK8U/xz9H4dT7jDuX40K0+TLGa4BxIod0uQ2O4=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=HGB6KBOsp/AXYSJQLSn1t6ldUxS47BwSgAMS2MBpI12I3QWmblCWCFT5fvqt1ymrY2WJsJg9g3Wf3L8iGFRUcgr+9Ngpggr9GJkoI58LiS+vjxcyxvUDqid3+2uEabd/2PuhRVAHIpfMLrB2D6IUy0hbWDy8dof8tS8FzJvcem0= 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=ypS4pgAz; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="ypS4pgAz" Received: by mail-pg1-f202.google.com with SMTP id 41be03b00d2f7-7bbe0ab18caso3817a12.0 for ; Wed, 14 Aug 2024 07:41:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1723646481; x=1724251281; 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=8eQppPywlRD4zJK4Qw8n4TAMnHmhGHJxgJ7aSuitxnw=; b=ypS4pgAzxxeJc6yB+7mM9XmhckNbT+j/raN0l7h4fUWtpd0Xo/4bIWLvnbxKhDsG1j +JFUkolIKIavcujeUVuR4oU1r7o1lBcidXj3dyCQrVo0H8NJ+7Czo3+yaRwGjzOIpP3r Br3ffYd05kiegkGLB3v6aDYBvYsdib3gVrolZI6bmf66B8dS4ciaY1uSTz8eQNPhwynp Qe34pYx8Ly0Sz71OKk3Ekdq7apYpOPbJ937nTRIawHfy+LWr44EoxVM8Skbi4D2xUwk6 M4+yi5/Il7z8HIpUBc5TLfiH/y7w61CD8jHqmmdXE2mFvU5XJE283BeJnqb0cMMEWYP7 cVGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723646481; x=1724251281; 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=8eQppPywlRD4zJK4Qw8n4TAMnHmhGHJxgJ7aSuitxnw=; b=DdDzDngI5cA87RhNb7FvnFo6LhWS2PoHh/2IMP6ldYiSXtSCm2cW9t5ARbncxkHLgu lSQL7+4yv3pWuptc6snADTyDdY3ST7WadSqnsm5WTq7Jr8pZ+DThYpLsOE7ZZ6I2TDGu EjYtzjuT5J/5Dewdtw73xDE+XJbUBtMRr/RDKT8ETIC7lu2dkxJFnanjFmhM8C3E2Mz7 q0gjcMYEkoWB9ZSyXs4F9IzHwcOLgndZZEurS5ahazF7cTmoW1H7GBztBnieFl90HBGw EeKbbkRMihj4V9uTudW2+bsKNGyzqPAtjL6TWndsKIUyMk0Y6A0WlPhTbdsBM+6+90k2 anWw== X-Forwarded-Encrypted: i=1; AJvYcCW2/4BE2tfRxnZAqSojFaWHKsf057VP51lYGRlV8mvr3MHQLyrXH2WON1JHCcecADjM45Dytr5xkB1DdDB6VoOKHPVDQ586ezTjubet X-Gm-Message-State: AOJu0Yx0m6KMMiRXhdZeLLBwYS/923OOf3z9gPLIblYTI7H4tzwa0UFh KjHiJNLDQthwN0Xqsdym2DBVFu6eCEbLeA354Q3NqCOw1vkkt/mdFeTHU1loi394oKQSSpFMR93 khQ== X-Google-Smtp-Source: AGHT+IEy2cdq4eY82Sr3/toVMEJW3Z58+QsUSZW/hGAjFtu/nicstNFLzHq0qN99erPdDJJRMnIO+Smljz4= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a65:6818:0:b0:719:8067:6bca with SMTP id 41be03b00d2f7-7c6a568c52emr5913a12.1.1723646480836; Wed, 14 Aug 2024 07:41:20 -0700 (PDT) Date: Wed, 14 Aug 2024 07:41:19 -0700 In-Reply-To: <20240814082302.50032-1-liangchen.linux@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240814082302.50032-1-liangchen.linux@gmail.com> Message-ID: Subject: Re: [PATCH] KVM: x86/mmu: Register MMU shrinker only when necessary From: Sean Christopherson To: Liang Chen Cc: pbonzini@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Vipin Sharma , David Matlack Content-Type: text/plain; charset="us-ascii" +Vipin and David On Wed, Aug 14, 2024, Liang Chen wrote: > The shrinker is allocated with TDP MMU, which is meaningless except for > nested VMs, and 'count_objects' is also called each time the reclaim > path tries to shrink slab caches. Let's allocate the shrinker only when > necessary. This is definitely not worth the complexity. In its current form, KVM's shrinker is quite useless[1], and there were plans to repurpose the shrinker to free pages from the so called "mmu caches"[2], i.e. free pages that are guaranteed to not be in use. Vipin/David, what happened to that series? Are we still working on it? [1] https://lore.kernel.org/lkml/Y45dldZnI6OIf+a5@google.com [2] https://lore.kernel.org/all/20221222023457.1764-2-vipinsh@google.com