From mboxrd@z Thu Jan 1 00:00:00 1970 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 5F27553E24 for ; Tue, 18 Jun 2024 20:32:19 +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=1718742740; cv=none; b=SjBDF9VDUbQXmlydtd9TcoeflSauc6Z8Xbv8p2UPc3++gCm3VBgFACUkA4EGQ1aWwXPMl58K5YgROyGBLi0zwkgVd1fzzz6AXZ0m0yoyusTefKNmndrstOgM43MwMnKZgo6iY+XR3twW2qVS6w/a1xG8O2r1Cf+fpNAwyJoS8fs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718742740; c=relaxed/simple; bh=lVZf36AY/lYAeMik1sMA690aBusOKhDs7Fpin/A/jCk=; h=Date:To:From:Subject:Message-Id; b=p4pMiZ7rMLLS70v6PEGq4yc0b0IU0Umqv+KTikWhNmT0ipW8Sff40KFJAe24jrkvQK+W9fw2gKetdkuhLJi2O2fgWPW9qBibedLo8D2/H147F9196f+EA/mWY33lZ5j7IciEJKuSzvJKe9+DE7+9kPi7JUJzjra5KodufiLeVpw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=EwWubX3H; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="EwWubX3H" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5748C3277B; Tue, 18 Jun 2024 20:32:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1718742739; bh=lVZf36AY/lYAeMik1sMA690aBusOKhDs7Fpin/A/jCk=; h=Date:To:From:Subject:From; b=EwWubX3H4iKmsh/jT+vtqHV+E5pjve89vY9EsPA5mEcxkoKvb1j6C3RRrH1Qztgj9 p1DdLplJkJHw0C6v1QO4eespBZzKalbIvMTy0lM3/+OiFYqwgzTLYrv1rQL/lZ98bZ S0cM5j8ijId9N7MJLACP+ZfV4bUXzw3p+M33cfP0= Date: Tue, 18 Jun 2024 13:32:19 -0700 To: mm-commits@vger.kernel.org,ziy@nvidia.com,ying.huang@intel.com,willy@infradead.org,wangkefeng.wang@huawei.com,shy828301@gmail.com,ryan.roberts@arm.com,p.raghav@samsung.com,ioworker0@gmail.com,hughd@google.com,david@redhat.com,da.gomez@samsung.com,chrisl@kernel.org,21cnbao@gmail.com,baolin.wang@linux.alibaba.com,akpm@linux-foundation.org From: Andrew Morton Subject: + mm-shmem-extend-shmem_partial_swap_usage-to-support-large-folio-swap.patch added to mm-unstable branch Message-Id: <20240618203219.C5748C3277B@smtp.kernel.org> Precedence: bulk X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: The patch titled Subject: mm: shmem: extend shmem_partial_swap_usage() to support large folio swap has been added to the -mm mm-unstable branch. Its filename is mm-shmem-extend-shmem_partial_swap_usage-to-support-large-folio-swap.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-shmem-extend-shmem_partial_swap_usage-to-support-large-folio-swap.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Baolin Wang Subject: mm: shmem: extend shmem_partial_swap_usage() to support large folio swap Date: Tue, 18 Jun 2024 14:54:15 +0800 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. Link: https://lkml.kernel.org/r/61c49050a8aeffecade8c2c407280bf6b92f359e.1718690645.git.baolin.wang@linux.alibaba.com Signed-off-by: Baolin Wang Cc: Barry Song <21cnbao@gmail.com> Cc: Chris Li Cc: Daniel Gomez Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Hugh Dickins Cc: Kefeng Wang Cc: Lance Yang Cc: Matthew Wilcox (Oracle) Cc: Pankaj Raghav Cc: Ryan Roberts Cc: Yang Shi Cc: Zi Yan Signed-off-by: Andrew Morton --- mm/shmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/mm/shmem.c~mm-shmem-extend-shmem_partial_swap_usage-to-support-large-folio-swap +++ a/mm/shmem.c @@ -870,7 +870,7 @@ unsigned long shmem_partial_swap_usage(s 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()) { _ Patches currently in -mm which might be from baolin.wang@linux.alibaba.com are mm-memory-extend-finish_fault-to-support-large-folio.patch mm-memory-extend-finish_fault-to-support-large-folio-fix.patch mm-memory-extend-finish_fault-to-support-large-folio-fix-fix.patch mm-shmem-add-thp-validation-for-pmd-mapped-thp-related-statistics.patch mm-shmem-add-multi-size-thp-sysfs-interface-for-anonymous-shmem.patch mm-shmem-add-multi-size-thp-sysfs-interface-for-anonymous-shmem-fix.patch mm-shmem-add-multi-size-thp-sysfs-interface-for-anonymous-shmem-fix-3.patch mm-shmem-add-mthp-support-for-anonymous-shmem.patch mm-shmem-add-mthp-size-alignment-in-shmem_get_unmapped_area.patch mm-shmem-add-mthp-counters-for-anonymous-shmem.patch mm-shmem-add-mthp-counters-for-anonymous-shmem-fix.patch mm-memcontrol-add-vm_bug_on_folio-to-catch-lru-folio-in-mem_cgroup_migrate.patch mm-vmscan-add-validation-before-spliting-shmem-large-folio.patch mm-swap-extend-swap_shmem_alloc-to-support-batch-swap_map_shmem-flag-setting.patch mm-shmem-extend-shmem_partial_swap_usage-to-support-large-folio-swap.patch mm-filemap-use-xa_get_order-to-get-the-swap-entry-order.patch mm-shmem-use-swap_free_nr-to-free-shmem-swap-entries.patch mm-shmem-support-large-folio-allocation-for-shmem_replace_folio.patch mm-shmem-drop-folio-reference-count-using-nr_pages-in-shmem_delete_from_page_cache.patch mm-shmem-support-large-folio-swap-out.patch