Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1632281lqo; Sun, 12 May 2024 10:55:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUiH7UBq2sQNm18w6oNsM1JNhpXRziMC0SuQkGquRvPxPnWC1BUTV8NHy0y1U6dUnYLKbGSfbbmamQDIUmKEUbTGEE0dv/k0rHfVm83bQ== X-Google-Smtp-Source: AGHT+IHRqBw/LsTlpGfL9BddOrIkjP2YBqL1WiyM1XpqPv3ZDYRl+r+so2wPwqhlQZyrq8o9Bit7 X-Received: by 2002:a05:6a00:21c6:b0:6ed:21d5:b03a with SMTP id d2e1a72fcca58-6f4e0355541mr9367058b3a.23.1715536503811; Sun, 12 May 2024 10:55:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715536503; cv=pass; d=google.com; s=arc-20160816; b=AHQhgqWl6Pl/SteklTm57ouRqFILg6woAUsKs4EZBsWRHdjF3b3xJ0OgWUdgVhO3jP FjD9CF47n9H7Ij5AOgnXk4p6nnfZnRK12FdQlWF5YgCYbY/CWpbonVTtBpHwK2QDQLjR BWc3OvuL2cLJ6X1V0LH9tF4CL7vNZ8P9u9bHpimzg0oGp25Pzzh2Hc248SGjzm0Ntkga ZD3Td1vhMfA/S81oXI/i34GrRVGngBuEjaD0FyYoSW4w4D0J+ttIjQQ2gOes74faCndA HMk6UHz6Ykg78F8fDc4/5xG39Ui3EUDKhG7GCCPLpA2WSagkAaXkjlhIPx1uNhmkA13F mVYQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=F7OWT9BgpmpF8hAC9ZHlM8ZpLHVysnlXINkIiv/z4GM=; fh=vjlmcul/iwKngVKus7Y1UamKvCrctb9tSAOtgsfLjl0=; b=SOHtfHmzbB3cklD5PbcuASLOZEjWjQKFfSfzgkj1nBPgqT2r53abFw+Y52ua7XSfdf sXjGslux0u4Dcw79yQtaCAMteeSaI0DpNo2Nqr2pM5DvDLmZnMXqH9kRqdyrA9Ey8Di3 SNky3mzpUnqexL4YhqWwf+kDzOwmQQuDp+73NrBTNhO0KuvTUzUrVwiWiIMffL0FHprC NuKlrJCS/b3XZRaccjzU0sD4iigJ1HOCk6j5h6f5eECN99PcSP8iVspo38qlI7UzGC9E DokYOrqFLC4kuqePT0Uyx5gbJ4Lh1WHArrZS4/1Xpb7rEdZN8PQhclae+76nwrAup7rx kv/g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YzfZLIO0; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-176960-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176960-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-6f4d2aee5c1si7885752b3a.215.2024.05.12.10.55.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 May 2024 10:55:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-176960-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YzfZLIO0; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-176960-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176960-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 6B27A281070 for ; Sun, 12 May 2024 17:55:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 451BE4F211; Sun, 12 May 2024 17:54:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YzfZLIO0" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6693F4D9F2; Sun, 12 May 2024 17:54:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715536495; cv=none; b=ZY/XV/9k4/mittFtm6m//c65fm5a0ibL8Qr5TtOYk7Fmfcx6gwKfWQ+GQMELNhRIMRCz2RxPBPUTrFkTc1mgXAQk1IUmDzCVk7BbJaQ6GJEcfjky2xdNSUUs/Tz3S3UQt6q4tjrFXBVz2Krkao8e80YflqiBjcJWOSF6PuaQrfo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715536495; c=relaxed/simple; bh=dAqk9DDy2iHhz/atR+7qN/JQ2SHCLI1jeIZ9SIxQ32U=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=K+FgJ61MNBHeBOP6CCBR1dcybslWAvjCOrYhF7Mjpq9PkZYYEgv+Aad2xr+rc9tsMwdimTsqkua9h3n6TgPqSTk4bhZvwsEWnXSkRBB33aeuch7YUMrxd92gPx3m63U36dcUaogqBS3XGA1+ML2yiVPER5z1dZl+SbUUGJtp+wE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YzfZLIO0; arc=none smtp.client-ip=10.30.226.201 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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; -- 2.39.2