From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f176.google.com (mail-qk1-f176.google.com [209.85.222.176]) (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 005B0488D94 for ; Thu, 23 Jul 2026 18:45:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784832360; cv=none; b=MjCY+7stjm/pHPwnMSNQWz/VqK3MHyTBMqbkA1JNezzczAELUtDcSU8DV0iJUUOv3EIQtFCAktgNHx7Fo7v9HC/zx7UCNaeniXSJvjuJpAp4SHwGpxPqzDbk0310T88u0fHUlpJeru+1Y715c7bPceE7jKYAyBgVc0Dv+NgULYs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784832360; c=relaxed/simple; bh=LPFtNwvaq4iknUN8ryy9bvqn4NvsGt3LGnIJqR6PdXI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Eqem5aYMecOYk0AFPkfLFCObE6jnSQ10kJh8I5bI73G2ccApQ8ehAXtZ2sLVrD5wwrwpzC7eo5FeC7LXnATVJv5hgX7tmuvXFqx8OschOwsMDScPeP3DVxp/jBV5RKcoNa0YvJ2LDLPGlVGUsTpz3bn5kK+MA6N0Dwxa5WvC0hc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net; spf=pass smtp.mailfrom=gourry.net; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b=lTJTPlIo; arc=none smtp.client-ip=209.85.222.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gourry.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b="lTJTPlIo" Received: by mail-qk1-f176.google.com with SMTP id af79cd13be357-92e512a9a6bso77025185a.2 for ; Thu, 23 Jul 2026 11:45:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1784832346; x=1785437146; 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=j6ufwgXideJpYnCHTcqdI7XFL4I7bDx4wDEI8wCsug4=; b=lTJTPlIovsZh/NkCV2kpXgCHz7MnGJKeZ3o2OsDRztfvrH9WLLSlF4L94aAhP6mrGY zmnDB7G/nTuMA51SvCx84csUWApJGp7srNWUAi70Miwnx5GClPSLmPFKzuSnsZDEeS77 /MPHpMJXbvBZtqqWdFaHvbp7K5u7zz2iI3AJgA9ixRSIyTSEM/VKz/1rV5wcqDjPV5KD xkro2/ExspXRUxbRYvYC9dXhg+btMuhGePlGQrEeMrcnkX6QjjDEV7tfDDE0soRQdX2e eyvP+v9hgN2MZjDI0n52LRofVqkzQdzxVrjGfJ+VLgfwWYlHFX9im3i/dzjoEKCmrKSI x23w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784832346; x=1785437146; 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=j6ufwgXideJpYnCHTcqdI7XFL4I7bDx4wDEI8wCsug4=; b=E0683MO3TDR9V6W3OUQIs+AkkjbJuibqk0VmQEye8Dxdaf9FDkf4NclPIg9k7rhnw8 zgylA2i6y3BRVEpC+Bi7kXm6CSs1vS51AzSaY3qFnmqklp/HmcmPbWgCM74VxR4H8A5/ BbqX7qMslICkq3AGZNrLH2MdfvaEhPC8fpw5nW5tpjz3TjNuTnfUgLufqNd/eXeTxjRj ygdPEDZ+z2uaROnIn6ElkaDj3ViroZJEfYSmM9UGF5K7HRgezfB5/Dagyipp0Ja1CD24 eUfdmF4417Xjqw51viw2dAjgz4x05Jie2nUC6uwS8LsaXsAQCSq8omhwgmfx/6L3WLFE ezNg== X-Forwarded-Encrypted: i=1; AHgh+RoQa8iDNj6dSh8x73m6+wNZOuZsL8Hflue60GtlkFPS0S4LIFzPGbYbdy0h5v8e8fKL5UMvBX0a96G500E=@vger.kernel.org X-Gm-Message-State: AOJu0YzmS7IfmoFe9nMGa4YOYYc+mMiishCTmm+m3Mz9ej4q7WKWzg2H WBWMRzCv4Iq0+jN5bYGO8fXaEufWnlySTCyNB33LoK55uB6y1Kn53uHF/FrF2rHFJVQ= X-Gm-Gg: AR+sD11+xTul4CpVR/u/t9tH+cLubIatuv7X+kd4ZQyZckmjoJCyqtKJNt35NyG+ZVm SXLAL3B5kpz6BP4IhD5X7oic7FvobK3IgKjE9YdoVov5cvoE8EDUfbpcSLGerwSuWLj4P2d+Sqq kUDEevJgO92+ps3cGLm0T2SRf/v0NqozTeIMZs3b8QIrY39yVINIPyCSqsy0bNK2qN6ogtDuccH herNwCoFBsh/93WsgdKNNO5yB3YUiFEXothcjYAKZ/PPXUD2gXNJgFkywI1J0XDlUY2nMpXA8ML uKEwVRq4b2h32swy69U4MACKhvDNyu3Ntot0TICQFY4cI3SEkXsWBQVxPzeMWZEUjVPXgOfi967 UqGNNvITSyB4336iHe4psyXbWC1O/CwCzSh6t/0/PHMgBBNH7p9QM8+o6SOaqn6WL+GmJmCMGI/ PpVWr7CmJkHAf9xE7LqncBO/m8shoub8qtfIfBU+uyuRcUTzZ1kSZzq4NFuA== X-Received: by 2002:a05:620a:371f:b0:92e:7d53:8e83 with SMTP id af79cd13be357-9310391f7d9mr467983085a.56.1784832345663; Thu, 23 Jul 2026 11:45:45 -0700 (PDT) Received: from gourry-fedora-PF4VCD3F (pool-173-79-60-52.washdc.fios.verizon.net. [173.79.60.52]) by smtp.gmail.com with ESMTPSA id af79cd13be357-930f6a6bd88sm470112785a.39.2026.07.23.11.45.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jul 2026 11:45:45 -0700 (PDT) Date: Thu, 23 Jul 2026 14:45:40 -0400 From: Gregory Price To: Johannes Weiner 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 01:48:27PM -0400, Gregory Price wrote: > On Thu, Jul 23, 2026 at 01:07:04PM -0400, Johannes Weiner wrote: > > So the default global mempolicy is effectively: > > (MPOL_PREFERRED | (MPOL_F_MOF | MPOL_F_MORON) > > which is just MPOL_F_NUMA_BALANCING without MPOL_F_NUMA_BALANCING. > > The user can't actually see that - because the MOF/MORON flags get > stripped out when it's queried (because they're internal only). > > Maybe we should just set MPOL_F_NUMA_BALANCING in the default/preferred > policies and document that the global preferred policy default-enables > MPOL_F_NUMA_BALANCING - and that if a user (KVM) doesn't want to be > affected by numa balancing it needs to set a policy to disable it. > Walking this all back: - MPOL_DEFAULT is the default policy - numa_balancing=on means enable NUMA_BALANCING on the defaul policy - shmem was broken and did not respect this Johannes' fix is correct, and there are no additional changes required. Users enabling numa balancing while running KVM with shared regions are not getting what they're asking for presently - that is a bug. They should get the performance hit they're asking for (and then either turn off numa balancing or set an explicit mempolicy for those tasks / memfd's). ~Gregory