Received: by 2002:a05:7412:8d1c:b0:fa:4c10:6cad with SMTP id bj28csp383835rdb; Wed, 17 Jan 2024 05:09:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IHlyIkTxABzPCsN2AfATlbFWGMYkugMYg4+yFY0VQeDDhcRVAsR9HsP8BRes4DM6n63+PbN X-Received: by 2002:a17:903:1112:b0:1d5:4b18:17d1 with SMTP id n18-20020a170903111200b001d54b1817d1mr11612544plh.106.1705496984655; Wed, 17 Jan 2024 05:09:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705496984; cv=pass; d=google.com; s=arc-20160816; b=gpkTQXn5m5sRihkD4pLEvQs4IxQk7V07J/FekUb7kwAXH1MvBCHxlwT3LQRbboR9IS 6dh7GgxmVGMjztX2XKe8h7rIckDGi+DMNOvx6n8lTNmLHRi/C+QvPTC8g9zrp/tJTrBx RaS4eB/we3zfPsPvyTL6p4hrZeIFHgqw72TEeV4g3gJJqXEgbRhxRfPTmF/MO6VnPk3u xu7V+nSsVnncdoGCb1+Tz0fCuLR6KjxRGIcVz2+eT4+kvTW+sUTOThuQQxpC/Qg1XO02 bj/JBsT2f0CkZCcM8QZ9Esm9mXZ9VTXhKBWqszyevUnE4nDcnDu8A6FlaAI7siGdjt4J pOsA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=lMaBnHLDNKZRAPQX5DsGrPNmq+ZmSI3o5caWklPO7BE=; fh=5FwSu8NITXdaOqsBIynVvkCEMTuUDpkoNtI/Cl4IDas=; b=IF7zBRouD739O1Uu6AopJ911tZjviuOq2BiuasMkus+OAr1o/IPsbWvyN5pKeezqtI f2myzjFiwSsNpHrtqeXZaufvOJk87l2W9RLkXV0qh4273PhcMoF3ZyK68ibsgyY4xWk/ NwGtelUCyE6BtmxCvit42EN+OnjFlKrwbTJbOPFztQ2AthsHxVmyjcvnf7o1wIxryEeT dBXLaRVQRcq9/27ZgAG7VI/M8IF3c0wnC062/GXg+GHJ5YiresZesIRH0TayWUeJoJsG Dfjv991ABAy2zUpzcNW4ZoAPUflStx2Lvr3KqFEyKv2Of8qZnkWtmcviuE7efsdRm3iM G8Ow== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=proxmox.com); spf=pass (google.com: domain of linux-kernel+bounces-29006-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29006-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id kv14-20020a17090328ce00b001d4cea91cedsi13066894plb.285.2024.01.17.05.09.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 05:09:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-29006-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=proxmox.com); spf=pass (google.com: domain of linux-kernel+bounces-29006-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29006-linux.lists.archive=gmail.com@vger.kernel.org" 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 539D3287FF8 for ; Wed, 17 Jan 2024 13:09:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 532231EB44; Wed, 17 Jan 2024 13:09:36 +0000 (UTC) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (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 040A614A87; Wed, 17 Jan 2024 13:09:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=94.136.29.106 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705496975; cv=none; b=p5VF2LDxI0Hj2HIez3jnKW74HzCWBvroXWzmI40+wbgQeSss7sjnk1/OUWIfRDD8NLOBuVVQWNqYxv9ZprB2kPH4ibAOzU0oMDkItoYS4eQ2hFcAK8Jb6OPnWcp1KZVd+zd9ZKw9FY2QCrZB56JQVXhAivzWA0Sf50jwd1POqpA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705496975; c=relaxed/simple; bh=fYYHB0VyLbRkjnGemOOKTFx4j4HGmAk7y1tiXw6SEAk=; h=Received:Message-ID:Date:MIME-Version:User-Agent:Subject:To:Cc: References:Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; b=q2ilyCGk44g9BHxFuNN22jFfb08b9mGGtGMS4YqPoRXy74+JhkcEkV6wh/ifPiXhAdBUTc+DkwuvyMSD1CtNFJtHYTvP4O4WbrntnTmfzVPya91EUh5uYrGLYbvWGHTbimHfjxz1EsaAIFxaKG0SYdN9MlqS/uLmSQZhh9rnM1Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=proxmox.com; spf=pass smtp.mailfrom=proxmox.com; arc=none smtp.client-ip=94.136.29.106 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=proxmox.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=proxmox.com Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 69F82457C2; Wed, 17 Jan 2024 14:09:29 +0100 (CET) Message-ID: Date: Wed, 17 Jan 2024 14:09:28 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Temporary KVM guest hangs connected to KSM and NUMA balancer To: Sean Christopherson Cc: kvm@vger.kernel.org, Paolo Bonzini , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org References: <832697b9-3652-422d-a019-8c0574a188ac@proxmox.com> Content-Language: en-US From: Friedrich Weber In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 16/01/2024 18:20, Sean Christopherson wrote: >> Does this make sense to you? Happy to double-check or run more tests if >> anything seems off. > > Ha! It too me a few minutes to realize what went sideways with v2. KVM has an > in-flight change that switches from host virtual addresses (HVA) to guest physical > frame numbers (GFN) for the retry check, commit 8569992d64b8 ("KVM: Use gfn instead > of hva for mmu_notifier_retry"). > > That commit is in the KVM pull request for 6.8, and so v2 is based on top of a > branch that contains said commit. But for better or worse (probably worse), the > switch from HVA=GFN didn't change the _names_ of mmu_invalidate_range_{start,end}, > only the type. So v2 applies and compiles cleanly on 6.7, but it's subtly broken > because checking for a GFN match against an HVA range is all but guaranteed to get > false negatives. Oof, that's nifty, good catch! I'll pay more attention to the base-commit when testing next time. :) > If you can try v2 on top of `git://git.kernel.org/pub/scm/virt/kvm/kvm.git next`, > that would be helpful to confirm that I didn't screw up something else. Pulled that repository and can confirm: * 1c6d984f ("x86/kvm: Do not try to disable kvmclock if it was not enabled", current `next`): reproducer hangs * v2 [1] ("KVM: x86/mmu: Retry fault before acquiring mmu_lock if mapping is changing") applied on top of 1c6d984f: no hangs anymore If I understand the discussion on [1] correctly, there might be a v3 -- if so, I'll happily test that too. > Thanks very much for reporting back! I'm pretty sure we would have missed the > semantic conflict when backporting the fix to 6.7 and earlier, i.e. you likely > saved us from another round of bug reports for various stable trees. Sure! Thanks a lot for taking a look at this! Best wishes, Friedrich [1] https://lore.kernel.org/all/20240110012045.505046-1-seanjc@google.com/