From patchwork Sun May 12 17:54:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13662811 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 DDA10C25B77 for ; Sun, 12 May 2024 17:55:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D71E96B0193; Sun, 12 May 2024 13:55:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CB0D36B01A1; Sun, 12 May 2024 13:55:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A885B6B01A0; Sun, 12 May 2024 13:55:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 83A166B0193 for ; Sun, 12 May 2024 13:55:01 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 1F30D409F1 for ; Sun, 12 May 2024 17:55:01 +0000 (UTC) X-FDA: 82110494802.19.B0B57A3 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf04.hostedemail.com (Postfix) with ESMTP id 2C12040004 for ; Sun, 12 May 2024 17:54:58 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=YzfZLIO0; spf=pass (imf04.hostedemail.com: domain of sj@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1715536499; 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=F7OWT9BgpmpF8hAC9ZHlM8ZpLHVysnlXINkIiv/z4GM=; b=GMK+hiO4acphmo43bSfTfz7SyzGqlvH9pWouhsGhoUXHkw9KCQyjpyEGwgmVlaniCNbh3H deRZzYtkFa7OHeC9Y0f/gmzPolr+qaEhqeUmPjNN3kEbtZRIjORG3gpH2ynJR7e7mRd7oz vyROD0mKgN0yUumsUip7N/TKaOXTNyA= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=YzfZLIO0; spf=pass (imf04.hostedemail.com: domain of sj@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1715536499; a=rsa-sha256; cv=none; b=rzsONslVECaVx+H4YtIbDJGChBn9k4TFvfoZ+Bnxra3MGlB7IraRFvPM9xOnmYP+8i4w7c 1laMmox5Y3UxL4zxSOrs30OrYbnsB4bFDqbnlYRklWkVhIjdsqt2cp0RV8eXbs26ne2u7d Q8ns8RF0PxH0TIBg7Q6cEVigy3luFA0= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id C7D99CE0ACC; Sun, 12 May 2024 17:54:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 83FBFC4AF07; Sun, 12 May 2024 17:54:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715536495; bh=dAqk9DDy2iHhz/atR+7qN/JQ2SHCLI1jeIZ9SIxQ32U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YzfZLIO0xU4xk2uGqYmJFr7f3seXBey3bXrqIjZdiw/SFtMH+fG1I9q4CFgFopxqd IVCnp0TttZkN0fqtW1I0HRDOz9zY7Hqm+1AvNaxbdN/NJXc7SOWQOtXo2Ro+ts6agQ t0HwAzSIReX9f0lWCnagZvNE5sfntr6LCRIzsAUroGijBR6Pxq2vnA9Y4IS9H2QvAG L1cQBBw0OLhgd7HoABJbPLpial7xLk3jDLhb3Z1BR9aYlaIGTYdAWCcoHKkSnrIGyA yJRHG4yG8JyLOix4tNXkKsQHuWXDuTQcrpMKOM/c6OV6IW9l/86wjhbPIkQu181ai+ HaBDUF3ADFFGw== From: SeongJae Park To: Cc: Honggyu Kim , Andrew Morton , linux-mm@kvack.org, damon@lists.linux.dev, linux-kernel@vger.kernel.org, SeongJae Park Subject: [RFC PATCH v4 1/5] mm: make alloc_demote_folio externally invokable for migration Date: Sun, 12 May 2024 10:54:43 -0700 Message-Id: <20240512175447.75943-2-sj@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240512175447.75943-1-sj@kernel.org> References: <20240512175447.75943-1-sj@kernel.org> MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 2C12040004 X-Stat-Signature: nsoj1shi6dfxc3mxf7kwuxraog5nnkmt X-Rspam-User: X-HE-Tag: 1715536498-309630 X-HE-Meta: U2FsdGVkX1/0kmdZz6/oBYrYtYHq422DXLHUx/0lHUEhergbraB2eY+aIuHMlToix2Av94ELUc/UW3NMkUnc3F2NSiegFA1iUeq7OWbZxprjhuWMnuPi4jU/a1aGDgPJlfHXuiLXltuq1uUyrCr3l8PGKD8sh7tu6UXGSQMf7nJMqwFKDQ0ks8Skl8A3zeZtaVdqvrQE9hxUGUUIRQuihxElxA/xA0mMUSRRANXx+q5/oV9V/nQpQ0ZZ+EIH9/kmE5ISQQOYJF/3TqK0dSpOte6mk/yCYOLPnkamJGmskjcaLU8BBH3C4QRFxI1ku1ZRu/6ZKOmL/9hH/nqx7IGWAcsTW0pdC9cI247kMsLkBMtKJsU+SZY2nXo2V4jg4H9p9p1Sefa8lr0sU0J400ynfBjOuUbVFHZ+bLASi10PHAwJES3LjFIOLdpg3sg58sWo4ykIEwKkowojj2D679fd5OUQQZz7WjiG5SMSKX685O3Y/wKqujOs+/tvLR6Kjzw61n9utq/qpprIDrFv9heCCt/cy2IfwOiCHe2hrtvLLA8pggbVG86ZH6d7hMntiHab4xhDhjEk2Ypice5Mttv+IjcFhZvzg9MVLzl/LO9h8KLiTO8Z7YuApZroyu+z/ZJ+C//9DDE3cxejuvYX8aq3dAJjxazc/AnmIgHojf0f4vYiYl6xVV0IewM97qV9wEKx/XjfxbMw3CgEC1UHOetpO30M6Bz58mRCpqWnjkrVMf9kSPD69SITvNTnqmET4ncu74JN58NxPhNEE/F/q1o611tSi1l9OimvSFugKnnEBKhFXA9vYiwJrg6+KwET15wnTzPoR/AzXsWa/kKaU+sFEutTUvHlfBxp1IesMXHFnzsYxN1DcDSnXcEEPnykV4CcoxFCyoRNU49gjxKwdHNYKm36KNx1wT3iocIyj7sRiaoIcPZso32kre7vGgQrv3Nw9u3pHFCUEuif9coaPbz jYB80DLh TpSu1K/9dkBNpZIzPPPytUx+hGKm6cHH5qfli7Eu4ooQJX/sL5CKTZ76VVJzm7WEbK2tPjjxFdHVDwj3HHvhNZq7h22Py2JeCjbQfNZjzaZ2oscN0u1OuLoG5zQH79150cA9WuY9idd/PkmqGy9VawVy4t/lsfbp6xZjPR54GfzGbhOkgiCnKKCgR/LVpaHOvrdbg+nG9ViO5fLi84DwK7+MX8BOnYjk6GZ1qeM+m9UFjjhjAGLecwb1kYuv8pUL4DObxqwRXtFxgaFIFaYpbejl1WtwKJdI/GFuLqLtTBM1dlXbdBGXUxKOjw+CUjqnu2952WBpjKjZzIwF1eqbJqBNOlQ== 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: List-Subscribe: List-Unsubscribe: From: Honggyu Kim The alloc_demote_folio can be used out of vmscan.c so it'd be better to remove static keyword from it. This function can also be used for both demotion and promotion so it'd be better to rename it from alloc_demote_folio to alloc_migrate_folio. Signed-off-by: Honggyu Kim Reviewed-by: SeongJae Park Signed-off-by: SeongJae Park --- mm/internal.h | 1 + mm/vmscan.c | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/internal.h b/mm/internal.h index b2c75b12014e..b3ca996a4efc 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -1052,6 +1052,7 @@ extern unsigned long __must_check vm_mmap_pgoff(struct file *, unsigned long, unsigned long, unsigned long); extern void set_pageblock_order(void); +struct folio *alloc_demote_folio(struct folio *src, unsigned long private); unsigned long reclaim_pages(struct list_head *folio_list); unsigned int reclaim_clean_pages_from_list(struct zone *zone, struct list_head *folio_list); diff --git a/mm/vmscan.c b/mm/vmscan.c index 6981a71c8ef0..27269bc2bcc5 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -933,8 +933,7 @@ static void folio_check_dirty_writeback(struct folio *folio, mapping->a_ops->is_dirty_writeback(folio, dirty, writeback); } -static struct folio *alloc_demote_folio(struct folio *src, - unsigned long private) +struct folio *alloc_demote_folio(struct folio *src, unsigned long private) { struct folio *dst; nodemask_t *allowed_mask;