Message ID | b371eadb27f42fc51261c51008fbb9a334985b4c.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 8C43DC52D7C for <linux-mm@archiver.kernel.org>; Mon, 12 Aug 2024 07:42:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 326796B00A7; Mon, 12 Aug 2024 03:42:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2D7076B00A9; Mon, 12 Aug 2024 03:42:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 176576B00A8; Mon, 12 Aug 2024 03:42:31 -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 E715F6B00A7 for <linux-mm@kvack.org>; Mon, 12 Aug 2024 03:42:30 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id A148D1C510A for <linux-mm@kvack.org>; Mon, 12 Aug 2024 07:42:30 +0000 (UTC) X-FDA: 82442800860.26.678497E Received: from out30-124.freemail.mail.aliyun.com (out30-124.freemail.mail.aliyun.com [115.124.30.124]) by imf01.hostedemail.com (Postfix) with ESMTP id 9DF8440016 for <linux-mm@kvack.org>; Mon, 12 Aug 2024 07:42:28 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=bAE8veZu; spf=pass (imf01.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=1723448537; 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=HTq6ByUKYopHbBOucaa7TnUS458Ur1YounHQqWHqN9Y=; b=NExq6XJxl21EhZS3P3cadcrjT1rYNhW9p+v6bIwMNKFkHb9Ru4l0jBbTl2mo40+1856R2q e4zBJxPIhu8Zg56aX7bHBeV+mq5ENhshxnEKrV6FmGUkrHRPH1qNZrmsfhOQDCkHNnrdm6 CkxCqogt08T/NtZYj1JrPTEJpZLRzGs= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=bAE8veZu; spf=pass (imf01.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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1723448537; a=rsa-sha256; cv=none; b=5JqOG5pW9t8VxmgmS1Msc85Z+T6Gi8ieXetzBsLa38u1cfBwyhOnERGP7HKWUUeZ0bFLLR BDNVFXy7vM4P7ATYePBxN+GS4QwDssv2jFocupJsxbLAMCCx5/xPw/og2hxrZjk9FeXZ+E Yjts5sM4koSvPstVLxYHPtB0kYQEUTs= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1723448546; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=HTq6ByUKYopHbBOucaa7TnUS458Ur1YounHQqWHqN9Y=; b=bAE8veZuDTdgOTjU5mbOztE6V5fXtk1bkAFgwjJkMZyXhIZGNKNUWxil4iLfRAt5R/7y73IW1f5Cq5DzOQi8IV+ZYuVOwFUEwc/aixtu/OtZ1YhUoTf57zEwLAM50teME5MV3Qf8L4zEDgQN9ahwWeobJcUI1wFVTp6zS67utg4= Received: from localhost(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0WCazOjj_1723448544) by smtp.aliyun-inc.com; Mon, 12 Aug 2024 15:42:25 +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 7/9] mm: shmem: drop folio reference count using 'nr_pages' in shmem_delete_from_page_cache() Date: Mon, 12 Aug 2024 15:42:08 +0800 Message-Id: <b371eadb27f42fc51261c51008fbb9a334985b4c.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-Rspam-User: X-Stat-Signature: s5ucpypb6tn3jpn96kzridfs5aqfreyx X-Rspamd-Queue-Id: 9DF8440016 X-Rspamd-Server: rspam11 X-HE-Tag: 1723448548-854248 X-HE-Meta: U2FsdGVkX18ZBAwZFXnYvd9pZM0Zt9BRdCwXcdC1JBP723RMrdilqB5lJ8iQmQf7Y3dOb+dnjPrKyzUGGQ5l6YifacR/tny9bjJdAzaS7cy/Ut2XI8UhmA0boOxaQF+Zji1uaS2giW61lZ2NWP9s+B0Ud7tqSWt/gg8uD7IAWeQEcXCFAipOaOh6/VyRTkF8nl9bdb/lXrcFeKSNw/YfGXLqeFZ1Vo1hDJBCCr8WRF3Qg7q3W3sx8bAnoZI4f8TmM1kStMGDoAV3PKcS4kb/qjDVmTiqds031mXMcP5XJMH9ZDHRp42HnYJtGLOpMMPRUFNvC23ehI061HjK2lgUSV8UE3A5FiBhAoPThWnmri30aIpJdsuPLXhCBRRkI4OeyeQJSPB+AUF/SFKMk1rNTrGNJW9IxH6gpDdgKvjZQvqDCHLZIfio7ys374vifrJvQlQJokV3RnK4DYdKMTNLvVOgjaqNHmrQZRswOtClMx75F3/HmExYKbKLtDi6uZbYZQaZ/gvnt2S8TFGIO+cV4apqq5Ho+HF6N8YS2Uze7bPB2Xkok0WJjwI/3JaoXPIQLSYBbP2BZwK0MThfiWUXQhETb+jxfgBMDOeJEnVN+tJzM+2N3tx5hbscbKqIizCfup2S0Usf1b5J7l/Vmm703bn7UrVO6nj3+uR277cS9ODPBsDvKZL4uHCrJArTeQH9CJrFW/NK/rAjM6KHrVD7MzxLfiw0+nJQP+kJvLxcYVUVgIDaoGU8XqrYPPdPGgLQEDa4FTv07SKbqGQSLq1/57U4kphtkaUMQpevFZh5nhIBkHMotNHrfS3bBYZuuWzJtJfXuQZ5MkXdJEU9z5HG61zRLJ5N9mT3ByY7OUBphYpKqszT7HxJjvJWbIJez4mro9QAil5YX3yb7JxLkJz5z+gglNhrPRi8O+EON6yMjMhW/FeCzN1N8S3WplOmidzIT6yHyQndgxcrmReuEkp Oui1EjQ7 jfrY+TqvZ6cjCysWNx9CcXQWYS3KRMrsYo0tl9z9copeqzOTjn4Q3IwNgiBP/wrJKHkS07USiMssWW8Mwg+hNvO0Ah8Uv8bL8T1rXMKcvVkGU2g8lJvXyEymk6st0olGALwHgcDE+VFDJQa4ISwDlDpGVwBh/iIKSvObybn9e6fwy7vTB3PT+GriRxYXopg2EXXYTfhS4BT1qb+vnEjJ76gujYWsrJLaQHEDSWYkmo8dyB8IL8fj6PMm+Tg== 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 d94f02ad7bd1..345e25425e37 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -851,7 +851,7 @@ static void shmem_delete_from_page_cache(struct folio *folio, void *radswap) __lruvec_stat_mod_folio(folio, NR_FILE_PAGES, -nr); __lruvec_stat_mod_folio(folio, NR_SHMEM, -nr); xa_unlock_irq(&mapping->i_pages); - folio_put(folio); + folio_put_refs(folio, nr); BUG_ON(error); }
To support large folio swapin/swapout for shmem in the following patches, drop the folio's reference count by the number of pages contained in the folio when a shmem folio is deleted from shmem pagecache after adding into swap cache. Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com> --- mm/shmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)