Message ID | 3516f4ff0242c48ad0fa000d50ac382817776be1.1717673614.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 1CCFAC25B75 for <linux-mm@archiver.kernel.org>; Thu, 6 Jun 2024 11:59:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6BE6F6B009C; Thu, 6 Jun 2024 07:59:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 66F066B009D; Thu, 6 Jun 2024 07:59:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 50E396B009E; Thu, 6 Jun 2024 07:59:19 -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 36D956B009C for <linux-mm@kvack.org>; Thu, 6 Jun 2024 07:59:19 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id E0240C1603 for <linux-mm@kvack.org>; Thu, 6 Jun 2024 11:59:18 +0000 (UTC) X-FDA: 82200318396.22.935EC9C Received: from out30-131.freemail.mail.aliyun.com (out30-131.freemail.mail.aliyun.com [115.124.30.131]) by imf08.hostedemail.com (Postfix) with ESMTP id A53FF160006 for <linux-mm@kvack.org>; Thu, 6 Jun 2024 11:59:16 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=NdhGyyJd; dmarc=pass (policy=none) header.from=linux.alibaba.com; spf=pass (imf08.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.131 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1717675157; 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=QaLyG6fEgySNt1B9Umu3RlbPCCtnChT65+F+Wd+srs4=; b=7w/9z6ec0BCbZQFKL1nM3q06+4ngOVNrnleKBDnvzZneBFucoeopFRR0ibE9vUKEToiwIk wK6cOh/a/UiGh1JyTNpzm0q/3Qq1DjFdlWcwmPjrJUEeuXd/1SCYhxyK92E6B91Hvq7QMT 5QshyZTmYmXunO1xy+S4J3saru0aURo= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=NdhGyyJd; dmarc=pass (policy=none) header.from=linux.alibaba.com; spf=pass (imf08.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.131 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717675157; a=rsa-sha256; cv=none; b=cyLAhOHOPTLgncwK+xd+I1nMJH6fdnuY4VrEKxFlIx5FH7egSG3Ub0XU1D2Oswk/XXbMVh RVCRgF1NrO+l1QvFH9aXDzkslJqGLp8tTcYGKt2ulYh/EXKZ+km2ClP5fwSHSEyDba1lPS lgI5aIxzRYfedz89yMOhpbhu226gRMk= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1717675153; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=QaLyG6fEgySNt1B9Umu3RlbPCCtnChT65+F+Wd+srs4=; b=NdhGyyJdxwqunhqgviQG52l7beR8YPxvNV19Uo779mUWRcRKpkwiX55A3BRaXTp7F4wNeSxYZ/3uMCO543VTw/kmsI3aucTdA6Z3dkzAPDazoHyxkjPuO2OTQ73o0PrHUWbsCMdGuY4aAKgcQiUwIzVF9+rOf0GgviXhrwT7peQ= X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R681e4;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_---0W7y5mug_1717675151; Received: from localhost(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0W7y5mug_1717675151) by smtp.aliyun-inc.com; Thu, 06 Jun 2024 19:59:11 +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 1/7] mm: vmscan: add validation before spliting shmem large folio Date: Thu, 6 Jun 2024 19:58:51 +0800 Message-Id: <3516f4ff0242c48ad0fa000d50ac382817776be1.1717673614.git.baolin.wang@linux.alibaba.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <cover.1717673614.git.baolin.wang@linux.alibaba.com> References: <cover.1717673614.git.baolin.wang@linux.alibaba.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: A53FF160006 X-Stat-Signature: m6bwb7ywbz4hucgocu55aetyj1k375co X-HE-Tag: 1717675156-336942 X-HE-Meta: U2FsdGVkX1/HULgOS8ls/R9jzKIIkincpi9V0ALw/BbXknoZ+iwfFb+ILts8bw+oqXGzqOh5SDKPbXfMENIlFlz0X8jVfcMfuQwZ/gSDKyu7l89g+mnB8F700jcobBNelIgL5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EqLF0oCOL1+QL22dPA91KgayyFftAW3TlKrBpCrsOiMXc9q10hg= 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/vmscan.c b/mm/vmscan.c index c0429fd6c573..9146fd0dc61e 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1255,6 +1255,14 @@ static unsigned int shrink_folio_list(struct list_head *folio_list, } } else if (folio_test_swapbacked(folio) && folio_test_large(folio)) { + + /* + * Do not split shmem folio if no swap memory + * available. + */ + if (!total_swap_pages) + goto activate_locked; + /* Split shmem folio */ if (split_folio_to_list(folio, folio_list)) goto keep_locked;
Add swap available space validation before spliting shmem large folio to avoid redundant split, since we can not write shmem folio to the swap device in this case. Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com> --- mm/vmscan.c | 8 ++++++++ 1 file changed, 8 insertions(+)