Message ID | 61c49050a8aeffecade8c2c407280bf6b92f359e.1718690645.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 6BAD0C27C4F for <linux-mm@archiver.kernel.org>; Tue, 18 Jun 2024 06:54:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2155A6B014C; Tue, 18 Jun 2024 02:54:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 176146B0154; Tue, 18 Jun 2024 02:54:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 03C8C6B0155; Tue, 18 Jun 2024 02:54:38 -0400 (EDT) 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 D361E6B014C for <linux-mm@kvack.org>; Tue, 18 Jun 2024 02:54:38 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 9C42CA1F76 for <linux-mm@kvack.org>; Tue, 18 Jun 2024 06:54:38 +0000 (UTC) X-FDA: 82243096236.01.B18A079 Received: from out30-97.freemail.mail.aliyun.com (out30-97.freemail.mail.aliyun.com [115.124.30.97]) by imf18.hostedemail.com (Postfix) with ESMTP id 959CA1C000E for <linux-mm@kvack.org>; Tue, 18 Jun 2024 06:54:36 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b="yRYct/UF"; spf=pass (imf18.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.97 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=1718693673; 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=eA6kyRQ9XEpy05GdpwvXfCDvN4imeajWIAzdeARsgKo=; b=HPm/6CjfI5qOc/H5vhm5Iw8OXfRAA8UAyyZfAdeKjaP8PTi1/1O1DEonyzMNUieNsonHV5 6aKTEwTwqf+XlXP2C90Y4HtxaqVum2QXdV3C0zzqpgYEZmMUfGmfGeuTdZlqSy+gZbkYGV G1iMAx9tquY2W9UOQ7V6a+aGFohaeUM= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b="yRYct/UF"; spf=pass (imf18.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.97 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com; dmarc=pass (policy=none) header.from=linux.alibaba.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718693673; a=rsa-sha256; cv=none; b=Q0DwaAb5T7YTgzH5tFLp10hEdO2rKs6R8UDcqkiFK+0ZfuVh7vBdgaxSziDGdlbywbj12O 5kn8W3jnY/wAeXSyrXZ3/H7RnwV8qLq9xUWF9kpf4/irPi2ialwgRn0y1t94h13y2b3qlB gw9UaKOrYfuMKxSvTqTcp8RxOy/x4uk= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1718693673; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=eA6kyRQ9XEpy05GdpwvXfCDvN4imeajWIAzdeARsgKo=; b=yRYct/UFaYNmmeZK5qcyA8QOZ3CAsn+smy8uqjBqePugsHlZ44p8OjReZj4Xu5pUhK+XvsQ9P7e4q6fPIbCx5rSgGPfU09vJUsnvUnFKZLhPFiI6aTOcuv7WAFYnecuylPRwEOqP8w9uuiH0IHfX+QYLZI9M0w3GKBDi/+BSEMg= X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R531e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033045046011;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=17;SR=0;TI=SMTPD_---0W8jH7ld_1718693670; Received: from localhost(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0W8jH7ld_1718693670) by smtp.aliyun-inc.com; Tue, 18 Jun 2024 14:54:30 +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 v2 3/9] mm: shmem: extend shmem_partial_swap_usage() to support large folio swap Date: Tue, 18 Jun 2024 14:54:15 +0800 Message-Id: <61c49050a8aeffecade8c2c407280bf6b92f359e.1718690645.git.baolin.wang@linux.alibaba.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <cover.1718690645.git.baolin.wang@linux.alibaba.com> References: <cover.1718690645.git.baolin.wang@linux.alibaba.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 959CA1C000E X-Stat-Signature: cn8yscf3zerkdfd9m55d55ndcdyosgpo X-Rspam-User: X-HE-Tag: 1718693676-353167 X-HE-Meta: U2FsdGVkX1+F6ZZgJVnmnVoLWDEuZckssA1NrcB0oP9PHAbZEHu/G5gciC/VpON1V/z+vQn3bINc7nYvsWJg10phsnFUiYIOo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My6iWbpIoNjGlsfgEgrhwMCH6IG0NSjp8x1La5lYi7XYIUt/bJ0Zlgz54lY0pQEXr8FJDKjVR4SGj3SSEQ== 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 b90965486631..012a06ef39aa 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -870,7 +870,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(-)