Message ID | 20241125210149.2976098-11-willy@infradead.org (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 0BF04D59D6B for <linux-mm@archiver.kernel.org>; Mon, 25 Nov 2024 21:01:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 568166B0096; Mon, 25 Nov 2024 16:01:55 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4BBD16B008C; Mon, 25 Nov 2024 16:01:55 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2E73C6B0093; Mon, 25 Nov 2024 16:01:55 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 0E5AE6B008C for <linux-mm@kvack.org>; Mon, 25 Nov 2024 16:01:55 -0500 (EST) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id AC0B5AE6E4 for <linux-mm@kvack.org>; Mon, 25 Nov 2024 21:01:54 +0000 (UTC) X-FDA: 82825839264.12.5478EF3 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf20.hostedemail.com (Postfix) with ESMTP id 86ECE1C0011 for <linux-mm@kvack.org>; Mon, 25 Nov 2024 21:01:48 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=l9If5H5X; dmarc=none; spf=none (imf20.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1732568511; a=rsa-sha256; cv=none; b=zSE0mCq+wGXV2VWWZyFsxQV8nhOCzAbrcUCIVk+/mPb6meYO3hShL7DrnuwSg2Bbpp+gik b5YjuYTSUe/19uU5sydaokB5CxbCC672NAU3vCZYgDl1unseE116og0W4QhKN0LAnyKKRB GvLbDqYEcEA88FWFsbcufWgfAlxnrkw= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=l9If5H5X; dmarc=none; spf=none (imf20.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1732568511; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=xBcOD7+Rq7OxCsg5IggYUVCArLtnSv3WpRLtyW/sVXk=; b=KzTKFucSYAtSR9WEIxmZixWMgf/TvrMC4ei9D2f/7r0GD6k+0s2Zl86fqXFDYBCrGaojgV AqTVhV+rJd+6R/JW7Q8bAKdKlhBLa6Z4xRtIplipB56bToURGdW6u6AvfkgfyBwpKYlqan +1WAVtFqL6nlkzv8ftq94fB7PDStYlg= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=xBcOD7+Rq7OxCsg5IggYUVCArLtnSv3WpRLtyW/sVXk=; b=l9If5H5X62NQixO/foXVA2gLjd onRaneJdtB329FUKp11n1SEsdqjM2P+p4XbSxK487/6Vfz8AOaR3JMVmbNhDejJBcu4RGT8sk45lP h2l9YUEMlSac5+WVptbpT+XFQEENgQchAWUvpQz5bqNcxnQnSSgBP7OrGaWKtJcw/nn55HtfDyWl8 I5wpiVdMCbGDNmsKB13HAqMHlbxYr2jmqrnFc5FOtw5S1Dpq4bIwB3ytCHxg5rgkUNFMOX3E8mZOa dlCgOn0DGTtQDC92TNYBGaXA3RU6Xq1wSxufJo2xWT97RTuKph1HTFcpcBnKQlKxjezQoqktdVF8r gUiuT5FA==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1tFgDP-0000000CUEQ-3bYw; Mon, 25 Nov 2024 21:01:51 +0000 From: "Matthew Wilcox (Oracle)" <willy@infradead.org> To: Andrew Morton <akpm@linux-foundation.org> Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>, linux-mm@kvack.org, David Hildenbrand <david@redhat.com> Subject: [PATCH v3 10/15] mm/page_alloc: Move set_page_refcounted() to callers of __alloc_pages_direct_reclaim() Date: Mon, 25 Nov 2024 21:01:42 +0000 Message-ID: <20241125210149.2976098-11-willy@infradead.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241125210149.2976098-1-willy@infradead.org> References: <20241125210149.2976098-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspam-User: X-Rspamd-Queue-Id: 86ECE1C0011 X-Rspamd-Server: rspam01 X-Stat-Signature: h3xkzxgt84mkbrdinie946mumfrjmzxm X-HE-Tag: 1732568508-196267 X-HE-Meta: U2FsdGVkX18ckGN1RE5iXHJrs0RNHmS8DyKUeyjL4Egg8QWP34zLyjoJg1IK0Vi03kXyKy3D+8HEzW1cMvBhpjikFOHxfODhFBk6OdSH/KPYoxoiU9h+FEg0eCHujDOCeYPoTduBbPFE6Ed31VDmgT2g8vlH2QqTGhpltEAev+Fik2Omvgw8ieRkNt0nR78+JyOxd6NSYmDghs6XReIMHvZaoc4Pam94nvc2MZKwqvz6QgADd3tg3VyeN2RxA0vM978AWDXJjjBQpPsc9WyzHWvxIkPdgIRwTKpvkhVxx/ER1PUk8GpzwyghNB4KYICsgsPKWkn4lfPISp/qJrw+Mcr4Bp+VNk72+DEZQ5cMscXyRvHoKnZDUvudavw30Y7ioz72k06RhbYiE9wjUgjRn09d/etRIGdzYTWhVZlo7/sT4PPGYBWkcVCpn/XpUza9y5zJxEojoashytEv/U7nr+laiydaqeAv81j+BVkVpTMijZrNe22mX8gp6f5am1X/KJ79zLDZzAJ7Jg+Q7y+dRcG7V5Vd+Z+zurp/gCuh8G18DTtARMbK0vRlgXv3zqUlrDu0NnYlWk18XvU3AOVJV8mFjOTr1CYBSX7htMJuQQ84UG1qQDAAbQTBMIKdAp34DZx/wG4+8a1OQ/pzTbVaviFT6t+KqMibP8zbws8nbRQo1yuImvt17uouEMAG6aDSijCKKgInTCeZXhKbJTndRWUhtqHaF7AnaHrv4eJXcqstdmgZm98eS896lBU5Tt2qLOqI8NyxouR6rJAvlgR9F8iIsyAOOqsAWaXDED+3QQVfU6jl/bgF6WeFKZMdJ2QwOTPmU5cyFw7jvYwNhAL+QCbzC/kPjA/ya9BEpq/sNKZqyi8XXacgdqagZOYtqZzN6zCYQDbKdybmoNGsdJyV/5M9MwXItQDz2KQe14X4QgfifJaBCTj482psmCKffK8xlyioYalv4YakEQLFjuc ptp5Boam w5vw6hllH+7XTO+3muxlh+hI3/ZRwoySMO0aP1E+/tIKflMy+ZxlErHuj1my31TrelmUYD0LVJ3uElnK5L5p29BmqoASfR2Rit9M2+TbCHvvsNtH3fyk7cA85CnUQvI4gOjGO3F/j1jfayvxddqzcxuTToF7C2n25dRo+75axr+ZtHh+A1WcLBnnBvwXvVbUcjTsmEZdLHCzbIzYNnhfFao2GbzTNriojZhoGRDhqCvPk2vK+0dm+D6zy11Ei6RqTU2aEXCkkz9ZPMUq6S+49wwaxsrCE8FBfMdU2 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
Allocate and free frozen pages
|
expand
|
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 0f02cb253bf5..7acc32902fc9 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -3998,7 +3998,6 @@ __alloc_pages_direct_reclaim(gfp_t gfp_mask, unsigned int order, drained = true; goto retry; } - set_page_refcounted(page); out: psi_memstall_leave(&pflags); @@ -4420,8 +4419,10 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order, /* Try direct reclaim and then allocating */ page = __alloc_pages_direct_reclaim(gfp_mask, order, alloc_flags, ac, &did_some_progress); - if (page) + if (page) { + set_page_refcounted(page); goto got_pg; + } /* Try direct compaction and then allocating */ page = __alloc_pages_direct_compact(gfp_mask, order, alloc_flags, ac,
In preparation for allocating frozen pages, stop initialising the page refcount in __alloc_pages_direct_reclaim(). Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> --- mm/page_alloc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)