Message ID | f6628d0a1257a9c46aa91a7774017b4da931d6fb.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 9194DC30653 for <linux-mm@archiver.kernel.org>; Thu, 4 Jul 2024 11:25:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 85C4F6B00D2; Thu, 4 Jul 2024 07:25:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7E2976B00D8; Thu, 4 Jul 2024 07:25:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 65CE96B00DC; Thu, 4 Jul 2024 07:25:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 440976B00D2 for <linux-mm@kvack.org>; Thu, 4 Jul 2024 07:25:20 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id EB9181202A1 for <linux-mm@kvack.org>; Thu, 4 Jul 2024 11:25:19 +0000 (UTC) X-FDA: 82301839158.20.1A10A93 Received: from out30-133.freemail.mail.aliyun.com (out30-133.freemail.mail.aliyun.com [115.124.30.133]) by imf17.hostedemail.com (Postfix) with ESMTP id B827440021 for <linux-mm@kvack.org>; Thu, 4 Jul 2024 11:25:17 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=GXt422Bu; dmarc=pass (policy=none) header.from=linux.alibaba.com; spf=pass (imf17.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.133 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1720092298; a=rsa-sha256; cv=none; b=rqf3/3H/bEbpDHhGfw3GSFNRJdKEouNo7nxQGhvgTVXjdRXBv3eAxFZKtgAaTbfwSatiw5 Nk7fSM4ty4pzrJwhqd3tCT+AM2NmLbdNx8mylnZET+Vwi7+5zCJkKSa4gEce8zOk4ucWNg Q/u43742GXGbXzvHmWdnX174Abqb3W8= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=GXt422Bu; dmarc=pass (policy=none) header.from=linux.alibaba.com; spf=pass (imf17.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.133 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=1720092298; 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=QyBoZMTgb7NS//TXwyienog6t9srSRphl+czPh5Cin4=; b=iR1W8rXIYLU5RLr4A5YCrWyBRLzHD6PobAKdapEksyc8iPKmFHYxwim5MSd/KBxMouCxla CfSigPOJkcUZApJDIk1W4c+GdLexv0DCEfjZMOoMKedIxZWXHPOab0IQS1cYUKq3cFtgy+ DRCKIrcMuLkqRshgkCicikW3h+nxKsE= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1720092314; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=QyBoZMTgb7NS//TXwyienog6t9srSRphl+czPh5Cin4=; b=GXt422Bu3EY5MyVCQnrbMEBU6ujx9LD6o+YcorNPC+INTf81iwD4/T/vlPpZncXA9E2Kzs2q+z1ArfvA7ZUw7MtPFbvzyOWz1jcFHMxZGNOY9P/ovRM8912DCe5BQCLIAM1/WZ+jTO2brpXqkfszvBgCqeDev/wkr25Gs/dTd+g= X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R131e4;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_---0W9qjnNQ_1720092312; Received: from localhost(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0W9qjnNQ_1720092312) by smtp.aliyun-inc.com; Thu, 04 Jul 2024 19:25:12 +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 05/10] mm: filemap: use xa_get_order() to get the swap entry order Date: Thu, 4 Jul 2024 19:24:54 +0800 Message-Id: <f6628d0a1257a9c46aa91a7774017b4da931d6fb.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: rspam12 X-Rspamd-Queue-Id: B827440021 X-Stat-Signature: 4z5w68g7no44ins8e86ozcjbq79fbbof X-Rspam-User: X-HE-Tag: 1720092317-58601 X-HE-Meta: U2FsdGVkX1+G75MAuB2bAl9VJ5wuD2/NULkkmB2ZVAEQ9AHoYM7l6Nu1bPsANYRVIslXvyEGWSsOkxwCeaj4nVi61a4+a4tLGA+Bp82ejjc/Na3AmVTpnxpnKU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0B65RM9EX/0v5/56LRduOMuymp3B8R7TORSRsmh1pIoOcAvQmHA+eu5xE2Wdj9DXoC+P46byjR+MsljTdUZQ== 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/filemap.c b/mm/filemap.c index 95d56cc788ef..c1a703eb8116 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -2056,6 +2056,8 @@ unsigned find_get_entries(struct address_space *mapping, pgoff_t *start, folio = fbatch->folios[idx]; if (!xa_is_value(folio)) nr = folio_nr_pages(folio); + else + nr = 1 << xa_get_order(&mapping->i_pages, indices[idx]); *start = indices[idx] + nr; } return folio_batch_count(fbatch); @@ -2120,6 +2122,8 @@ unsigned find_lock_entries(struct address_space *mapping, pgoff_t *start, folio = fbatch->folios[idx]; if (!xa_is_value(folio)) nr = folio_nr_pages(folio); + else + nr = 1 << xa_get_order(&mapping->i_pages, indices[idx]); *start = indices[idx] + nr; } return folio_batch_count(fbatch);
In the following patches, shmem will support the swap out of large folios, which means the shmem mappings may contain large order swap entries, so using xa_get_order() to get the folio order of the shmem swap entry to update the '*start' correctly. Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com> --- mm/filemap.c | 4 ++++ 1 file changed, 4 insertions(+)