From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f182.google.com (mail-qk1-f182.google.com [209.85.222.182]) (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 7B4521A316E for ; Mon, 6 Jul 2026 17:30:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783359016; cv=none; b=F9IM7JlKcBOEd0LIYFVfbltzBMbfUBgOgWP1jwl+iGaGYFtJt11QkA+3S6kdROdFFOFa6MsT1p1pLMXzH0pK7tLt3geuSe/eYhzZv1DQfZU/DKS9KEjaemUW4VKewwYJF0lqhzqH3Q+xhTRDxXgD+P/JG0h2u3vVIi7+6D91fFs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783359016; c=relaxed/simple; bh=UcKwPgRjJlxRjsqdVJX+HEMjXkLbrEvzo8bZtBul5yM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qw7hx09d9DHViGSFRHbOmAnkXQ6KPWWuVJjJC5Y92KVjEOF+wQ+cAT6AsSOMEexayInY/N5ao9seF3O1hvl96x9yBYtFCfkj7BCPIntuZdf5cP7LHMFcwRCQog8UUCKPctNAlrbxRXxaXm2WyYod32X9fxClYjQHVQDa/Nx4r00= 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=NpDq8fEO; arc=none smtp.client-ip=209.85.222.182 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="NpDq8fEO" Received: by mail-qk1-f182.google.com with SMTP id af79cd13be357-92e50a650a0so164070285a.1 for ; Mon, 06 Jul 2026 10:30:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1783359013; x=1783963813; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=T9PWYu0fUk83E8iTN6ucQI9VPyecYn/0QKDiHqXI4d0=; b=NpDq8fEO9A7qAGj7q5R8qONK+u89eXSM9ovm2ZKOfVODnFRPTeAeL2QANbyCVE3FVF GriejzciwHlDhzqRGQJgoTXTQ8z+jBlaaYnDx16u81nhhlGU0Gh2SbCEq3nG1nCUQEyE TdL9vFMjbXrVSkARzoXY5t9YARjsuk9OUzZa7j9KJ7/oJUpcBENfeWLLIs8jeCgozA9c ul9vDJmAKwof08xKea9Qnoghm0xhKegFAN92fxqTpl6jdNgiyvUe/K3PxcyIAFzXBJlq GLScjUhXOhPiZmcsmvij1qjQp4c71Ozw1ZOJfZwrjwluxqre6MWtaW9EgxLdqBkTIlW8 gZIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783359013; x=1783963813; h=in-reply-to:content-disposition: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; bh=T9PWYu0fUk83E8iTN6ucQI9VPyecYn/0QKDiHqXI4d0=; b=LkAuvkivkzx2te0EEd+CuAFTqioHyKY/sPC11PGRknsV69kGn+PvLYkNet48YFDVaD 8pV/K7alWCQ5wI7hqKsMC7K1M5qJF8grxBw5pwSrcQPztUIfnXuZyzwBjWExQ5W8ZkpH oOQ2ONcRMzlMlbQdUopKj4xvLf2VLcCYvhJN1bixfM16AZ2F1gcZhdQHc8JmLitHBK0N 82FWG1RiOqpaP/fwHfUod5YDlGk7hTHWPxdit1OznjfegejJIY9Wp6oKf0LZ7/Mn6ADG 3swaNuDJO0zgB1zG4C3gdNaO6lTa1ylc3R8ocdAhFMoTz1HiDtAYrXSp/ho97dNE62+q dFNA== X-Forwarded-Encrypted: i=1; AHgh+RpMD+9xmvHnh02O4TrMkTJF53pLQWF4kVPucjcgaD91py7g0pDBXpX4P3Ea1MJ5cuSH4fH62UPuakZ0dew=@vger.kernel.org X-Gm-Message-State: AOJu0YyH2MaPrAznxtX7KBz8HYAgEBA7OlMSrKOG2pqxmHZ9Slbofwla uY6sylEf0XchdbTMrZzLETHaDf/2zdWgjCWwOhZQ2vY/3ktMZczgVehYK56AZhESkjk= X-Gm-Gg: AfdE7ckX/qdMMEJ/8nhdgeB2UJjyvXOLVP4ULTgL4lfzqAI4c9CRnmXbQlWV0fQ05yN hGbnt4FT+LqrNG6ZmnNuw+yeaQjc1eB48E48/OqFmW12/oqNNdb1ka9wVgnvTUuBusb/GAWsOm/ tSOEIM8v4FqwVKfXLaSILsEkpWS4V6UbB2xP6ZtFL1kpOI3iCj+wfNH1pcQ7zTZtmXoTmJj+FBV z0ybC+w7+c8VCwWIrSzRRc6UMjIKY2w01THi5FWmiMhq3z8nshonIqM6q/GMih6/Vdb0o0CuZaq SSQXX6EzbTQJjCgTo82r1K05m44G/rYxO3WmPM69xC5h/nQSpskehxrJgsqWmjSQAGz1OVAExco r4TotKEaMloO64gUz5vKpjUE58Y+wEeK6y90nb1uT849nQ6/CloqytGw+iS/Ec3KRLAtjw/Mfpe uPTrUQXUalQqoN0Di7/YrvcW28DodFiHt1hsgB+jeK7HCRtONlWe6Q9DcWjWQ3f0RfQxBh X-Received: by 2002:a05:620a:4552:b0:916:467:558f with SMTP id af79cd13be357-92ebb4e3ad8mr220189485a.16.1783359013000; Mon, 06 Jul 2026 10:30:13 -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-92e90b800ccsm987969085a.8.2026.07.06.10.30.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jul 2026 10:30:12 -0700 (PDT) Date: Mon, 6 Jul 2026 13:30:08 -0400 From: Gregory Price To: "Huang, Ying" Cc: Johannes Weiner , Andrew Morton , David Hildenbrand , Zi Yan , Matthew Brost , Joshua Hahn , Rakie Kim , Byungchul Park , Alistair Popple , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Neha Gholkar Subject: Re: [PATCH] mm: mempolicy: fix automatic numa balancing for shmem Message-ID: References: <20260629163337.1264881-1-hannes@cmpxchg.org> <87h5mkz33h.fsf@DESKTOP-5N7EMDA> <877bnfynsr.fsf@DESKTOP-5N7EMDA> <87y0fonyrm.fsf@DESKTOP-5N7EMDA> 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: <87y0fonyrm.fsf@DESKTOP-5N7EMDA> On Mon, Jul 06, 2026 at 07:27:57PM +0800, Huang, Ying wrote: > > > > I considered proposing MPOL_F_MOVABLE_ONLY to mean (roughly) "userland > > memory only" - and then slowly trying to migrate numactl to make this > > the default. > > What is the right mempolicy for these random kernel allocations? If the > pages are used privately by the task (not the case in your example, but > is it possible?), is it OK to use the mempolicy of the task? If the > pages are shared, what is the correct mempolicy? Will it be fixed? Or > can we find a way to change the policy? > I submitted a recommendation[1], but I think it got swalled by the kvack outage, i'll probably need to re-send. At the very least, these allocations should just use the system default (local node) instead of the task. I left the page-cache affected by this (so inode data DOES follow this) but after some testing I found this amounts to around ~0.4% of total memory usage when you have many small files (~64kb files, 512GB cached). I think we can probably drop the first commit and just ship the second. The fun result - when you combine this fix + private nodes [2] you can reliably hotplug a private node in ZONE_NORMAL so long as all tasks that were using the private node were reaped prior to hotplug. This is a legitimately useful improvement in my opinion. ~Gregory [1] https://lore.kernel.org/all/20260701222112.2820098-1-gourry@gourry.net/ [2] https://lore.kernel.org/all/20260222084842.1824063-1-gourry@gourry.net/