From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f54.google.com (mail-qv1-f54.google.com [209.85.219.54]) (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 B78DC33DEC2 for ; Thu, 23 Jul 2026 17:07:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784826442; cv=none; b=OqJJIV/WpsRVUyI+wixKAqhLcj0ww+x82SBt2zQ9GfUNdfgpymsWQuhgeDCG2ztUHRvk91pUcB7W886RRh8u3k1JxShme5Q8librpOo/Dl6ifUM7yVRd+TY878sYRDMxjpH6pqXGp3gP/L5e24CVllQtzg1USj0fCfCKnx3woKM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784826442; c=relaxed/simple; bh=vaGPFqyOPtGK/NPyUdkbXxLgCQ/ZxcDp8ygzXnQM2sM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Lw9KGDjTZWnn63CHykhvristMJ3oPYQGfAohSx+QnEqFcl7/2CImtm8weldWIWlm9VE8fRaeI/1AmodfmkTcxQYPRzZiJOoZEdkaOwAmKurstyJm3yEtctiB8rRZ3nYiXUB+JqgxWfJ1agixRBw8c8fsk/ibXMxQHXBwp73iT3U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmpxchg.org; spf=pass smtp.mailfrom=cmpxchg.org; dkim=pass (2048-bit key) header.d=cmpxchg.org header.i=@cmpxchg.org header.b=dr6D71pd; arc=none smtp.client-ip=209.85.219.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmpxchg.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cmpxchg.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cmpxchg.org header.i=@cmpxchg.org header.b="dr6D71pd" Received: by mail-qv1-f54.google.com with SMTP id 6a1803df08f44-8f186025973so11566566d6.0 for ; Thu, 23 Jul 2026 10:07:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg.org; s=google; t=1784826429; x=1785431229; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=6nTISuiCBMBC/x5bhGnScXYmL0t1DEe+uFhjm9NEqZI=; b=dr6D71pdkJzaZoA573EzcDPgqkVMwCs3l8007MpPJFj7mfhGF6RJEvvKxfz1m+LkAE CKoD0fn9fNVo1SP3g4Y6r0cNLMq9QiDWI40Z0PnfE9C+r+IUrpVhHMv9p4nUnKEKTV9Z ur31PPNSrT4tDcWJZ1/rZdcXFfbdt3AbdSdsed43OMTuS8lWzwSaSwAhJNO3NrmoVbOY bYwfm0RmlI8++YaRCim0HcKSyJzcTtAT1wQsml1yNcjf8i27hIKmotoFZg2LQIzoZjZC 6do0lsviqsAh4q8xGfLOYx03whDjuiQ7HXyeS7sT03UQwYjausl6QYeuzZFmU38BI8us 9O6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784826429; x=1785431229; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=6nTISuiCBMBC/x5bhGnScXYmL0t1DEe+uFhjm9NEqZI=; b=av9WSCpUfUGxvLWSlqvIKUNGPeeZGQFSdxbrpMTL9S6WdBPVZAihsWrWvTvjBHoU8U 6r2+ZNoV1m6XGUx6OvyXBsTNqJbHeOORPhODh0LoAk7R+Jxjl+r6S0fq0h42zHF6/Lch 0RiqbeHrgFzlIksqbzu2zQQVaCFcybKhODk7rQoleFOjMATUjpLzBT9+VSCq1UmbZ+BL 1jMcDu2tDqkM0oeOz3jTNVZX6UzWLo7936x2Omrbt34ge+4HNg+dhvxEoJgSBPtJz6uD uR/lzpHN8tLnvUKB/DT+jcRW1LwUFu28tNiXMpGFPriLdOwUnkwH8AcW18elxIoBS/NV NQ6A== X-Forwarded-Encrypted: i=1; AHgh+RrmzyWUiaX9knrZSp1Ej35sMsWHXqldHNrUh3elekjy98C61sDVDglfmg4ISRLdDxeksLpqb3JBx/WR+zE=@vger.kernel.org X-Gm-Message-State: AOJu0Yw8re7HPfzMESJ+U7Tx/QyXoiU5cyzG9mBnk2y343BEUt3DZbnl o2ZpzFR5M1ObdeF4kERqahTz3SLJr4NkpDFwQ63RImxDnj4MstoV8sHeu65MafU3Ndk= X-Gm-Gg: AR+sD138xmJG3+xiBcKZP4xfCg9m1hHKr6ZkdQJ/52BW1NuzxY2snWLg/Od7Y8QA74j +GC8UxIwbSZM23Z/nWv5LcYLXEiHByBwRzBbfEkXXaHsjt5hZiQqKfiQ5Xi5IK/0T5u8bOFF2Yt 6b8vo6fqXHSy+Zbi3JOJHiKx++yVLK+SzAVqumpxjxPyPU1FRP7ui8OpQId9JXnv45cNEtnH9O7 P2rUQGjm95LN1/NXA4URE+HtavV3I+mSensvFCnNa35LlG77vd04A5bWnCSqkVAei/7FxA4EpFj 1655yAF89tDvdS4dk0paaWKfowXKUIBSmZsdhleu9szUJr5qUQ7hYQGE9Vzna9sUrsB8CzACpvS I9hEX3kRc6dXqC7kbYQenv+ZKiPYtyOnpjiySk/utml+mEoaqXBsP7tXu7kdtisT3iI0K+ukZc5 fB X-Received: by 2002:a05:6214:5d0a:b0:8f1:579e:a41b with SMTP id 6a1803df08f44-907ca295150mr42984396d6.24.1784826429087; Thu, 23 Jul 2026 10:07:09 -0700 (PDT) Received: from localhost ([2603:7001:f100:500:365a:60ff:fe62:ff29]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-907ba8f2a8bsm48949526d6.20.2026.07.23.10.07.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jul 2026 10:07:07 -0700 (PDT) Date: Thu, 23 Jul 2026 13:07:04 -0400 From: Johannes Weiner To: Gregory Price Cc: Sean Christopherson , Yan Zhao , pbonzini@redhat.com, Andrew Morton , David Hildenbrand , Zi Yan , Matthew Brost , Joshua Hahn , Rakie Kim , Byungchul Park , Ying Huang , Alistair Popple , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Neha Gholkar , kvm@vger.kernel.org, rick.p.edgecombe@intel.com, vishal.l.verma@intel.com Subject: Re: [PATCH] mm: mempolicy: fix automatic numa balancing for shmem Message-ID: References: <20260629163337.1264881-1-hannes@cmpxchg.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu, Jul 23, 2026 at 11:58:27AM -0400, Gregory Price wrote: > On Thu, Jul 23, 2026 at 10:54:06AM -0400, Johannes Weiner wrote: > > > > > > My stance is that using NUMA balancing with KVM guests is a terrible idea, and > > > that anyone that insists on using such a setup gets to suffer the consequences. > > > > I agree. Surely we cannot leave shmem balancing broken due to > > that. It's also not clear to me how many people even enable numa > > balancing. > > > > I lean towards Johannes' stance here that consistency is better, and if > KVM has a known-poor interaction with numa balancing, maybe KVM should > simply set a default policy (when none are present) to avoid this. > > That said, this is painful because MPOL_F_MOF / MPOL_F_MORON are already > a silently inherited policy on boot (added during init). This will be > confusing for users. > > This is not documented anywhere. Maybe this change should come with a > docs addition that says the default global policy is ACTUALLY: > > MPOL_LOCAL + (MPOL_F_MOF | MPOL_F_MORON) > > Instead of just MPOL_LOCAL and letting that silent implementation > detail bite people. Hm, where do you see "Instead of just MPOL_LOCAL"? Documentation/filesystems/tmpfs.rst says it defaults to "default" and points me to set_mempolicy(2). That in turn in general makes little mention of numa balancing and doesn't mention MPOL_F_MOF/MPOL_F_MORON. In fact these are documented as internal flags. The numa_balancing entry in Documentation/admin-guide/sysctl/kernel.rst however DOES say plainly that enabling this feature will sample and migrate mapped process memory to where it's used, and that this has a performance penalty. It seems there is a general lack of documented interactions between user-requested policies and the system-wide numa-balancing behavior.