Message ID | 60b130b9fc3e422bb91293a172c2113c85e9233a.1723434324.git.baolin.wang@linux.alibaba.com (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 E655FC3DA7F for <linux-mm@archiver.kernel.org>; Mon, 12 Aug 2024 07:42:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5E3566B00A4; Mon, 12 Aug 2024 03:42:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 56BB66B00A2; Mon, 12 Aug 2024 03:42:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3948E6B00A5; Mon, 12 Aug 2024 03:42:29 -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 040726B00A2 for <linux-mm@kvack.org>; Mon, 12 Aug 2024 03:42:28 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id AFA96A1BD6 for <linux-mm@kvack.org>; Mon, 12 Aug 2024 07:42:28 +0000 (UTC) X-FDA: 82442800776.12.D489D98 Received: from out30-124.freemail.mail.aliyun.com (out30-124.freemail.mail.aliyun.com [115.124.30.124]) by imf29.hostedemail.com (Postfix) with ESMTP id 95162120025 for <linux-mm@kvack.org>; Mon, 12 Aug 2024 07:42:26 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=uJE1VEiW; spf=pass (imf29.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.124 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com; dmarc=pass (policy=none) header.from=linux.alibaba.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1723448477; 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=2cIcVzSoLVgPRYlybE3t8RKibMfrcxZj8JgqApi1OSo=; b=jbhBSlCPwYJhnTO2fJs7zm7+XCeMMGFffSDxoO3/x8TTIY2sHataZVxFjm4MesdQz1wNHK jKT0H45RYm4VUPwCSiLxsroYQujaMlXMU9TJqdIAr7FXkwa7HSntmWgOrKtcfME/Dstlin cQeLp3WxSElYl0yo2+9zbQzkBFI3rIM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1723448477; a=rsa-sha256; cv=none; b=5BJ3hnOsgGatN/HDo78XNWpb1d4o7R6hHI8JRHaImUZJH4QeLWoqAzYh0ovbC0EX7gGeJn nXDJDe/cb+upjSDC250tyZs2M1TC78uYVKgsp1gW9xmHjowL+EReitH0ghvRwzQ5D0Jtkt V+mnE/pphGJ5JdUvEBUcVQjtwXfrvw8= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=uJE1VEiW; spf=pass (imf29.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.124 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com; dmarc=pass (policy=none) header.from=linux.alibaba.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1723448542; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=2cIcVzSoLVgPRYlybE3t8RKibMfrcxZj8JgqApi1OSo=; b=uJE1VEiWOPfMo9lqgitzw/Rv0cBMkRqrhdPbbiH+ks7VCoMITHmKKgGzpUK0PndssJsJbGpQNVWalpYTu3GN52Qnlr3XpGUhtbP1gHhMdwlkpFfe328GrLMmXsMrmQKbMgKIbVAbyTxpV4VfX9QlaOsTyeRuVYkmegBi6Isudw0= Received: from localhost(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0WCazOhr_1723448539) by smtp.aliyun-inc.com; Mon, 12 Aug 2024 15:42:19 +0800 From: Baolin Wang <baolin.wang@linux.alibaba.com> To: akpm@linux-foundation.org, hughd@google.com Cc: willy@infradead.org, david@redhat.com, wangkefeng.wang@huawei.com, chrisl@kernel.org, ying.huang@intel.com, 21cnbao@gmail.com, ryan.roberts@arm.com, shy828301@gmail.com, ziy@nvidia.com, ioworker0@gmail.com, da.gomez@samsung.com, p.raghav@samsung.com, baolin.wang@linux.alibaba.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 2/9] mm: shmem: extend shmem_partial_swap_usage() to support large folio swap Date: Mon, 12 Aug 2024 15:42:03 +0800 Message-Id: <60b130b9fc3e422bb91293a172c2113c85e9233a.1723434324.git.baolin.wang@linux.alibaba.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <cover.1723434324.git.baolin.wang@linux.alibaba.com> References: <cover.1723434324.git.baolin.wang@linux.alibaba.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Stat-Signature: cai7h7z4o376ke3g77k4wi39adigkyjt X-Rspamd-Queue-Id: 95162120025 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1723448546-402343 X-HE-Meta: U2FsdGVkX19EZI8Arb/ZN8zJlMx0Iauj1THlJwcAIGm4a9hUnV8BAsu2OWPp4YaSde0l4Ijmm4wuW5rlQ730FoCmk4fr0JhZ8/RjTjTGWntIrqXmhaZgwg/37VRIVF402g0zJCjyo4BVsFKu59mj4DKGO9doCeR/ahOqnVyXcXX30urmMZKRIwwyk2j9srjc5j+NwHZWS1y9HkNaX0Xca54uuYJY7PlYsGKR6GMczUe2KFUtcbdxbt4+6itDSICkLU3q9GtXJM914eO+/VnbgiKyUopLlmfPvIVvklzlhtVS+sUAfhSIlM/1SNodiK6f6+ahBJQO5y8zFIDByUK8aOpzqZSox+LeNVduZGkkyz0liUAsBCyME0qM0cAXxR0fz10tvhy6Yj6d2WKu2s7zWCrg3IsoMoxjNKRKVUsi60V2UzC+SvIkmcO4p7rHYF+CutV4LXJLzcM+pdSY6b18IVi620Uk6T+8+mdiQ0aQ+i3HF6FXQ7JhoGI1iZO/GwQqM0H2zXRDMnjZOl41Mgb6oeDLgqFXWiY1NkzHbunOs0ZYjfG8OnpH9cXyUFYnhL/RTxvkJlvcztC00owGnACw88WjM6VZWlx51BTUv/tITdu01fkEF0P0nhDbV7PdzqHCVQ65G+uvmQXWCThcnLRU1UhffoiAxfNuBrYyLsfggf5Yg/asaqHXnl/o2fuHPXssjvjaVhEc7B8IvTMB3OGca8wXf65volR29QpNiKDu1GL0fEl/RqKSSrwHjpj0AYaTW19aAC9crnqa4xXMMJCmaikgVHmId0mu6MMNi9BPVmzxKW1aewo81O8VaXg7zUYiDnfS5NsGa4OV3QpDJEnDeBUvrMcHvMINMu9zk1WMir3fw/L4OZQRqw6KJ98e3256O8PQFC1nQjmDU5mkFpa/5Zwho4OGXtaDPK/LSQufx+7Nsq8f6a2dBmb9dAq9JGsPI1oOrf3CSuy3MJegV4U 9qbfdH/8 Z6nSEmnM+KFubGEpCcm956jp/YnIVyaSAiOsXCv4Bjf98BnPUXCXYY/lwsL2mJgzoWgz2zBj1wwWmTV161cXgG0vF4oFtCrSOMuPun+23IzIteFDvdkmMnZ50d4vSKzOsxOc+mI7/l2LBKDa6Qpa+b+HPEBm2MblDnQfGmswsVkAuSdQONyreJC+ZGl9MroLPftswH222W1S+DlNLa7y09hFoEgiLBkgQBTxx1QpoJMQAgVCZcazfJ7d1gg== 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 |
support large folio swap-out and swap-in for shmem
|
expand
|
diff --git a/mm/shmem.c b/mm/shmem.c index 22cdc10f27ea..02fb188d627f 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -890,7 +890,7 @@ unsigned long shmem_partial_swap_usage(struct address_space *mapping, if (xas_retry(&xas, page)) continue; if (xa_is_value(page)) - swapped++; + swapped += 1 << xa_get_order(xas.xa, xas.xa_index); if (xas.xa_index == max) break; if (need_resched()) {
To support shmem large folio swapout in the following patches, using xa_get_order() to get the order of the swap entry to calculate the swap usage of shmem. Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com> --- mm/shmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)