Message ID | 871ca0ed707c6245c04751523f384d4832bed13a.1720079976.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 22D10C30653 for <linux-mm@archiver.kernel.org>; Thu, 4 Jul 2024 11:25:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B68716B00DF; Thu, 4 Jul 2024 07:25:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AF0A86B00E1; Thu, 4 Jul 2024 07:25:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 91D2C6B00E2; Thu, 4 Jul 2024 07:25:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 675336B00DF for <linux-mm@kvack.org>; Thu, 4 Jul 2024 07:25:22 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 265691C0B97 for <linux-mm@kvack.org>; Thu, 4 Jul 2024 11:25:22 +0000 (UTC) X-FDA: 82301839284.09.67039F7 Received: from out30-133.freemail.mail.aliyun.com (out30-133.freemail.mail.aliyun.com [115.124.30.133]) by imf26.hostedemail.com (Postfix) with ESMTP id D01AA140003 for <linux-mm@kvack.org>; Thu, 4 Jul 2024 11:25:19 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=wGowpd2A; spf=pass (imf26.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.133 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=1720092308; 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=lRtF0SmyYSxOdTg4TDG7az1S/WCMj7v41FB3x6ABx2s=; b=yonb4qwOYdGnAkqd+i5aMBryj9Pey3oP/TFXpHH2aN8fAlq2hc9bGaTUa65p/DrRMMCxFE 6/ZpQSzEdS9jh8cF3T+EgKUEgywcMdC5Eq/b6JwOVCRlfxnut8QN3Z4vPDZa7aYlowgF1U FHQQG+/Ci3AbC2z1GRMFqHp+kCgogYE= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=wGowpd2A; spf=pass (imf26.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.133 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=1720092308; a=rsa-sha256; cv=none; b=i6+0Yyet4/Weem/or4HRbhuT9YNL/BxCYBkI82fa6cxfHMvDsU58BJORhLCFxNJ7A9ilx5 zB40zvl4xwekQ4SBZeGNaIvf3ML46jKiLjlV8i5OWLMpS+jyqz+L4/eHdKQkm8DxzYJdlB +IDRoNNr01pveVQrDr1wKTRfBDAFJ7E= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1720092317; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=lRtF0SmyYSxOdTg4TDG7az1S/WCMj7v41FB3x6ABx2s=; b=wGowpd2AnJSi+U10Xowe1qk1KCXBXaBMrx3kmgBsU6aHGBgfjW4o0nLlWb1vWZa67K3QVV4U7TrcdnduYixuFxrBR/M+reaOXXrgPWREoUht79mpK+LTbJizsFnT89NMqG65xIZDChpUunKTY+RJH8dYz5qgiUN6a3taE94zuBM= X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R501e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033032014031;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=17;SR=0;TI=SMTPD_---0W9qWV5d_1720092315; Received: from localhost(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0W9qWV5d_1720092315) by smtp.aliyun-inc.com; Thu, 04 Jul 2024 19:25:16 +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 v3 08/10] mm: shmem: drop folio reference count using 'nr_pages' in shmem_delete_from_page_cache() Date: Thu, 4 Jul 2024 19:24:57 +0800 Message-Id: <871ca0ed707c6245c04751523f384d4832bed13a.1720079976.git.baolin.wang@linux.alibaba.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <cover.1720079976.git.baolin.wang@linux.alibaba.com> References: <cover.1720079976.git.baolin.wang@linux.alibaba.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: D01AA140003 X-Stat-Signature: fus4izc3cgumehr3riyqgn4zu8y455tz X-HE-Tag: 1720092319-30937 X-HE-Meta: U2FsdGVkX1+iKHKYr53SEM4ILK2AoLwEs5cN83HyhaCKgCE1tQEV3nrNWVuhBY4QJxjKRy8P00OQe1cgi/9urnYIg3qjc2Oa7JxtKN8nn9/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VO13+MMHBvB9iB7dJkWtFu8xbE6fk5WgsYBmA5OnxRjTpaKkm5RV4eeqp8P/4IRteabnRyjR6c9OXKKdkaB0Fd3hk1nZtzrz2ix8 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 1718da7eefab..eb030827f7fb 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -842,7 +842,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(-)