From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE3C4C369A2 for ; Thu, 10 Apr 2025 00:12:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9548F280073; Wed, 9 Apr 2025 20:12:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 90347280064; Wed, 9 Apr 2025 20:12:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7CBE8280073; Wed, 9 Apr 2025 20:12:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 5D659280064 for ; Wed, 9 Apr 2025 20:12:42 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 60CC2161597 for ; Thu, 10 Apr 2025 00:12:42 +0000 (UTC) X-FDA: 83316208164.26.B184128 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf25.hostedemail.com (Postfix) with ESMTP id 9A837A0006 for ; Thu, 10 Apr 2025 00:12:40 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=caEs1Kh4; dmarc=none; spf=pass (imf25.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1744243960; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=v7v1/4/JqM9vSOy8l1JwqTr2kthcRua8GCWMmbgJlQg=; b=iG6BL/7+/FlN8L4njHN0M4cJJDgNu5uZMNWrFQORl6fO2GpGJG97iKF2djHq68WudJsb8d K0IjnpaCFrCccu/8FT0DgvU5+YqcgjvXns1ZSI3xGMULMiFJhdCv2GVGfqh/BtVrnMQZgi 5/rot1lSe/qa13DdiPUahphvqZOM6RU= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=caEs1Kh4; dmarc=none; spf=pass (imf25.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1744243960; a=rsa-sha256; cv=none; b=s9UjPFmY2/lxUC4gyqe2Qg7X84eTxs+lqbGpusADNX175zJwnN2BZo9p7ktd6m+reOoj2Q 2mkdYIJFomGAdJZrPiFrxDCV7e6X/AXvG/j2hO7yagL1lSVPV4/0Yv/eWIEu6+eFEazvuZ lseHIhtH8fcQPC+qnrJ0USDxphqkEb8= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 8E08F5C4A67; Thu, 10 Apr 2025 00:10:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1A132C4CEE2; Thu, 10 Apr 2025 00:12:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1744243959; bh=nLOWCvHZoWzgjEvppluyiSsl07wM63eUSZJ6MazbjHs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=caEs1Kh44EGMrsFutHyQ9jQiTL10e5+gsdtXRaNIWovIRFFssom0XQy6MKwxC2h0C bUCjx9+KZQtIMqPH5Gz5FabtElII5CJcAXDgz5CNv9Dbev9ABZVxBtHq8VU+QbwJmP 3NTbIhfFTFuC8KykCxltiT0IM5E4j5NrFZfEYcwc= Date: Wed, 9 Apr 2025 17:12:38 -0700 From: Andrew Morton To: "T.J. Mercier" Cc: surenb@google.com, kent.overstreet@linux.dev, janghyuck.kim@samsung.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] alloc_tag: handle incomplete bulk allocations in vm_module_tags_populate Message-Id: <20250409171238.494fd49979b4607bff9791b7@linux-foundation.org> In-Reply-To: <20250409225111.3770347-1-tjmercier@google.com> References: <20250409225111.3770347-1-tjmercier@google.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 9A837A0006 X-Stat-Signature: hk1fsssir7rh18bak3c7suidytxubosz X-Rspam-User: X-HE-Tag: 1744243960-675505 X-HE-Meta: U2FsdGVkX1/Os3nYW3hGIfOmKNSFdRZnE3zJc5R/DoIB0Y8VEWVpVUAJijvrtVYcl+GUp4uR7VvRJaccYWXHswtAdSHGINfbDPPGI7SzI/kpcQCUkS7Jp14274C0I/fO/J6WmA6OpLklMrRTIvIq5X442qWzWWmOUtDyPy+mxEgapJdRX1chz0QcxsehOynnqpYS+iYhfsgvxeDahq1ILbk/jKTKhPWnK5wC8ngDXIssQMR6UnVt1Qy53M5q3KycN/k7RJ2D9LvBxbF+VOX74wTVeVtDwDjCUTSn50DO7WaA1eywWB19dqoH9Pz8vGSbHcewPBzWHsnbmqivViJCfNQZLFSjLVPPVpvmEXMCcjzlpqb0G27/p0Wz0tRM/uNW/rW54t8VVt5JRo2pGQoy5xWA8ZYvcx/1oYNbKVHQxNJ94+FIi1yFHjtoTZziE7P7lioTNfhZPTPwS4+K3t5DGi/LChHZ04Os88eDnax9KU6DrHwlMneKzznAmpspeniBUsSoDP+mEEWIvtyRTcdYfkSjYnt0DsJNKucb96Y6cJdxYQFYdAkFNmZVerz9m8V9dpjpN8Xsyz8XfM8WUKUgFGI3+Oj4ch/w6eypi7zc00frcM4kApZhcdiAV75O9R/jRcvV5Z4OJ4rlCYyRfgfu/Elg4S+d5GkO15wicD6QUMEESld0YTbLe0VXyOZpEcx6sYvBuuMR13QoK/ml7ehWxxFuxLeGlf1fGvDaDTTqGNaYctxeKW39WUOJaMPZLSfgLInUW3E1e1JZRuQGH/GVB0wmS3EN+dnaO35kbQ1G95Q9DYq5fBbZgxlXMNMAnIu8miEbVnJ3wRStRx+vK0QSF3tTZl0J0tMqx4YggfpIi8frn7eL7op8VmdrGBZh2CO3XWJGytpWJ0sIpRmI3tkX23oNrIxjZu/aSI84tdT/npXykDngS1erObdMNA8+fnnYftgBawaFAyyma03IDAD p6AwH26y v5EZlL2cZhb9k1CPT/tYRHPSJ5xJe8CIIO/J2wkkM1C0qT7GLmLgfhF1q7HbHd0tvC/9yE0LbMBLTPfHN9nLxTlDB8dhJPi0nMV30xTP0xEwhcZ76b2s4W5MgjSCaVt7UcFac0jbLAEWRRWw3DnqQMKspnqkMQ3TdOxGMTKHA/gw413BTmV6Cd6Cql1/s6pXl02B5HV2cTwZ2lXyfxZtryBpkqT0CyilfQLlGjWacgUNLmh7Bn5bZ6wNHkVyWjxKCO6rAUC9tk3dFw92HkareI8PWj0wuUmpP5Zs3Vi/gGBEAqY6HGZf5iaK8vts7OLw+p0Pr X-Bogosity: Ham, tests=bogofilter, spamicity=0.003503, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Wed, 9 Apr 2025 22:51:11 +0000 "T.J. Mercier" wrote: > alloc_pages_bulk_node may partially succeed and allocate fewer than the > requested nr_pages. There are several conditions under which this can > occur, but we have encountered the case where CONFIG_PAGE_OWNER is > enabled causing all bulk allocations to always fallback to single page > allocations due to commit 187ad460b841 ("mm/page_alloc: avoid page > allocator recursion with pagesets.lock held"). > > Currently vm_module_tags_populate immediately fails when > alloc_pages_bulk_node returns fewer than the requested number of pages. > When this happens memory allocation profiling gets disabled, for example > > [ 14.297583] [9: modprobe: 465] Failed to allocate memory for allocation tags in the module scsc_wlan. Memory allocation profiling is disabled! > [ 14.299339] [9: modprobe: 465] modprobe: Failed to insmod '/vendor/lib/modules/scsc_wlan.ko' with args '': Out of memory > > This patch causes vm_module_tags_populate to retry bulk allocations for > the remaining memory instead of failing immediately which will avoid the > disablement of memory allocation profiling. > Thanks. I'm assuming we want cc:stable on this? btw, it looks like the "Clean up and error out" code in vm_module_tags_populate() could use release_pages().