From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1A9B619A288 for ; Fri, 24 Jan 2025 16:43:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737737033; cv=none; b=YfsqqOV4vvLcKRo77DsZ4sOJk78p/bc/uecHNApeMCJsv/5VEBOPq1COWmgGA3fTDiCmWG2traQPBB9yM75/2z/NhBd6m8qzjR8AKeDbhH3YUSUrqEiLcOjJ0HbShXoddnzj8ON+Ofx6kREFE9/urpJKYhvt3ZsSX6ak31KnaYk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737737033; c=relaxed/simple; bh=M0gUo6K+Yug351ge5kav4yGXMaVYaJQg3+ESkre66t0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Z7J3wewPPo6Zbrs1SzcFME0hkdYm1ddHsm/hSab5eaofNHXo6wwKwRoXPmvKoi39BUzFFy1EqaRYJK3IWd1tndBIxPodTHdlyQGivJyU1hQe2ufH72pOUq9+0SLopkI9R/5SYqQws9AvhwCiMiIePSwb+uYGFsjqg/XayRhgNNw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=glFRMlJ0; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="glFRMlJ0" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1737737031; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+a/GBdBpxGagHtsT9KFhBKvr7JZFccrGBu8wLCkI9O0=; b=glFRMlJ0ds3iN9Uq2wa/p+s8drW3ItmcNYiEhLKq/47B+UqKrbN2v5PCpq1pwsdoLQQ3j+ ODIqJoaGKs2T5SSrzkuftupObfaKYmc6ifFPEXaaO7q118/RYNJn33CVFlYSBWXDovvx6k fJbzy93SnvomEPzZ8dKxEopZDw6XgVI= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-94-MsZoim5EOIOUmPA4ceIZJw-1; Fri, 24 Jan 2025 11:43:49 -0500 X-MC-Unique: MsZoim5EOIOUmPA4ceIZJw-1 X-Mimecast-MFC-AGG-ID: MsZoim5EOIOUmPA4ceIZJw Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 78C6319997C5; Fri, 24 Jan 2025 15:30:48 +0000 (UTC) Received: from virtlab1023.lab.eng.rdu2.redhat.com (virtlab1023.lab.eng.rdu2.redhat.com [10.8.1.187]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7065E19560A7; Fri, 24 Jan 2025 15:30:45 +0000 (UTC) From: Paolo Bonzini To: Keith Busch Cc: kvm@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, Vlad Poenaru , tj@kernel.org, Keith Busch , Sean Christopherson , Alyssa Ross Subject: Re: [PATCH] kvm: defer huge page recovery vhost task to later Date: Fri, 24 Jan 2025 10:28:03 -0500 Message-ID: <20250124152802.93279-2-pbonzini@redhat.com> In-Reply-To: <20250123153543.2769928-1-kbusch@meta.com> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 > Defer the task to after the first VM_RUN call, which occurs after the > parent process has forked all its jailed processes. This needs to happen > only once for the kvm instance, so this patch introduces infrastructure > to do that (Suggested-by Paolo). Queued for 6.13; in the end I moved the new data structure to include/linux, since it is generally usable and not limited to KVM. > int kvm_arch_post_init_vm(struct kvm *kvm) > { > - return kvm_mmu_post_init_vm(kvm); > + once_init(&kvm->arch.nx_once); > + return 0; > } This could have been in kvm_arch_init_vm(), but then the last user of kvm_arch_post_init_vm() goes away and more cleanup is in order. I'll post the obvious patch shortly. Thanks Keith and Alyssa. Paolo