From patchwork Sat Aug 17 09:51:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13767123 Return-Path: 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 1989BC52D7F for ; Sat, 17 Aug 2024 09:55:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C70868D00D2; Sat, 17 Aug 2024 05:55:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C21B38D00CF; Sat, 17 Aug 2024 05:55:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A4C738D00D2; Sat, 17 Aug 2024 05:55:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 80ED28D00CF for ; Sat, 17 Aug 2024 05:55:40 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 344D21405E3 for ; Sat, 17 Aug 2024 09:55:40 +0000 (UTC) X-FDA: 82461280440.11.2A635E3 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf16.hostedemail.com (Postfix) with ESMTP id 9C03F180018 for ; Sat, 17 Aug 2024 09:55:36 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf16.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1723888483; a=rsa-sha256; cv=none; b=CmsgYPSUKTZceOXJkvMbggI6vvl5k/zIaHH2aO4ky0sUuPEZG6DrQGF75OTC1fS4eqaTpj kwz7HAjN9bh4/BzM23AwoxXoyJdy3zHZvfCjjZj0twDla6e5MKx9v1r1ACyGNocF44hoLx qBFCODYi+f3OKpb5j1lazkW8fnLRsfk= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf16.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1723888483; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=I44YpIuFLRLlRlWnLHWyrzjJAp1EUdVZKO72vVlACD8=; b=6Jj/XrSDo5KO4nwPSqA6Up34TR7Z3JxvKuogUIj924IhlQ/E5pkcJ7XGIM+MwdABE7qVGr yemq+Ewcb4RLFpbxrVe7v+uRT6RpRL4mtxb0jpZAs03BpnCGTSNhedCqxgmw+renx5lbQJ /snHssKziTfZbgHBx1tt7Dt3iHB89ZY= Received: from mail.maildlp.com (unknown [172.19.163.48]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4WmDjr02Wgz1T7NP; Sat, 17 Aug 2024 17:54:56 +0800 (CST) Received: from dggpemf100008.china.huawei.com (unknown [7.185.36.138]) by mail.maildlp.com (Postfix) with ESMTPS id A23E8180087; Sat, 17 Aug 2024 17:55:29 +0800 (CST) Received: from localhost.localdomain (10.175.112.125) by dggpemf100008.china.huawei.com (7.185.36.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Sat, 17 Aug 2024 17:55:29 +0800 From: Kefeng Wang To: Andrew Morton CC: Matthew Wilcox , Alexander Viro , David Hildenbrand , Sidhartha Kumar , , Kefeng Wang Subject: [PATCH 1/5] mm: remove find_subpage() Date: Sat, 17 Aug 2024 17:51:18 +0800 Message-ID: <20240817095122.2460977-2-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20240817095122.2460977-1-wangkefeng.wang@huawei.com> References: <20240817095122.2460977-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemf100008.china.huawei.com (7.185.36.138) X-Rspamd-Queue-Id: 9C03F180018 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: tufzzeb15gihohsbqnak7wa3ax6kxsn9 X-HE-Tag: 1723888536-752084 X-HE-Meta: U2FsdGVkX1953dCCUOYmIUhWxeMPsXhua+v2X67mTLelfTBYuOpwZR4fMgaiDkghlIDCuOds/Krcxp6uNf/J2SeKWO2CRogoqAl8k4caGxUUwoYw96EaQ4GZ0hIuz+5x1EcqsRhjHg6VIn1/EtHdYRSsYRxpRU0BGrSzVGdwJsQhVwvuElmu6c48AyrOdarAqNAKW/cJ4V/N7j7vVCVq/tlaMkew+bvUxrjEdzsbXEmmAk2W9UpWNUdbU6Kio6DGNhDqlgNW3av89Q0ebpn0TTwiJz9jEvP+nKwGzizEQkKWt3c4gauMweeljeQ7ib6McZashCOatPudB3vGl/Rk5z0THe0qvta9aFx4wmgp4bPpsnWBoBDVJhStaIUtM1rm303TFVYBQBmfaUIAPDt0oJbbV3knG1tNradY6RGGWfkld0Pp7PrnsFjec4dnRWXuxKJngTWW72nNNuJ8F5W015J/iTlJ8GjLOVn8eMQ7S8Y16yPRLapi81zMFeawsAa9hMu4VUIEwNOsw3UOhkENpLShVuOMLcdR9JjZZi7O8TNOoYSzFQzK/qYsWz2HqMcv6L6DTrjbH08/hs2s6oIG8hnELAcbz91wDOfM9P/Vyj48H3jnFwUPOeW9FMJ/V4Hcl7Pq76fnibdvRQC6TuVcHJk1ZOKk1bbrvwqaU62YGE29iferFHhUV6pB+UeuBRD7dTYbKI1dOE9LlGuU02NinJPhHSlcrIyvf8EZw3CFkFsFxHLgqcvQ4cEI2d0kvLL4YnvqK1OWS0IBMlBh+tz3P9rp7OuHMxF/z7mroZESO3Eo9M5BHfryY7oH3kaYpwUo6sfi6btmrIxz6kDRb8kMX21r2SPHugm4t3/grKBNuBUoNChctttZRCN6HIV5xUn+MIgaHcRcsehtYLbKW/ZQgt8jV7BPetxCbafOP5cmEA1+ThVujpLYgrsU/PGNd/mQyHiLMQCBrIpND/IxcNu rW/5fntK 1u9GeZs1SiLNMp9bPXhaszRxcjbUyWm4avuQddBL+G2kTg+4cNvuasmSiZyvO1iPDKbd6M36/oQr4Y6/mgJ+slKQsh8aSSZYM82v5CW7trs0tYNSB/09q2eD9ZXLgqzyg8M64fB1eP3RPhgr8G6ksnI0DjxZNVZeLztCe+IbUdD4zw9vsxbhiAX5MwEf9PL9pqEuz 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: List-Subscribe: List-Unsubscribe: After commit a08c7193e4f1 ("mm/filemap: remove hugetlb special casing in filemap.c"), the find_subpage() should remove hugetlb case as the folio_file_page(), furthermore, we could convert to use folio_file_page() to remove find_subpage(). Signed-off-by: Kefeng Wang --- include/linux/pagemap.h | 13 ------------- lib/iov_iter.c | 24 +++++++++++++----------- 2 files changed, 13 insertions(+), 24 deletions(-) diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index d9c7edb6422b..68f59cd7637d 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -860,19 +860,6 @@ static inline bool folio_contains(struct folio *folio, pgoff_t index) return index - folio_index(folio) < folio_nr_pages(folio); } -/* - * Given the page we found in the page cache, return the page corresponding - * to this index in the file - */ -static inline struct page *find_subpage(struct page *head, pgoff_t index) -{ - /* HugeTLBfs wants the head page regardless */ - if (PageHuge(head)) - return head; - - return head + (index & (thp_nr_pages(head) - 1)); -} - unsigned filemap_get_folios(struct address_space *mapping, pgoff_t *start, pgoff_t end, struct folio_batch *fbatch); unsigned filemap_get_folios_contig(struct address_space *mapping, diff --git a/lib/iov_iter.c b/lib/iov_iter.c index 4a6a9f419bd7..b0bb1e5ff331 100644 --- a/lib/iov_iter.c +++ b/lib/iov_iter.c @@ -891,21 +891,21 @@ static ssize_t iter_xarray_populate_pages(struct page **pages, struct xarray *xa pgoff_t index, unsigned int nr_pages) { XA_STATE(xas, xa, index); - struct page *page; + struct folio *folio; unsigned int ret = 0; rcu_read_lock(); - for (page = xas_load(&xas); page; page = xas_next(&xas)) { - if (xas_retry(&xas, page)) + for (folio = xas_load(&xas); folio; folio = xas_next(&xas)) { + if (xas_retry(&xas, folio)) continue; /* Has the page moved or been split? */ - if (unlikely(page != xas_reload(&xas))) { + if (unlikely(folio != xas_reload(&xas))) { xas_reset(&xas); continue; } - pages[ret] = find_subpage(page, xas.xa_index); + pages[ret] = folio_file_page(folio, xas.xa_index); get_page(pages[ret]); if (++ret == nr_pages) break; @@ -1408,7 +1408,8 @@ static ssize_t iov_iter_extract_xarray_pages(struct iov_iter *i, iov_iter_extraction_t extraction_flags, size_t *offset0) { - struct page *page, **p; + struct page **p; + struct folio *folio; unsigned int nr = 0, offset; loff_t pos = i->xarray_start + i->iov_offset; pgoff_t index = pos >> PAGE_SHIFT; @@ -1420,20 +1421,21 @@ static ssize_t iov_iter_extract_xarray_pages(struct iov_iter *i, maxpages = want_pages_array(pages, maxsize, offset, maxpages); if (!maxpages) return -ENOMEM; + p = *pages; rcu_read_lock(); - for (page = xas_load(&xas); page; page = xas_next(&xas)) { - if (xas_retry(&xas, page)) + for (folio = xas_load(&xas); folio; folio = xas_next(&xas)) { + if (xas_retry(&xas, folio)) continue; - /* Has the page moved or been split? */ - if (unlikely(page != xas_reload(&xas))) { + /* Has the folio moved or been split? */ + if (unlikely(folio != xas_reload(&xas))) { xas_reset(&xas); continue; } - p[nr++] = find_subpage(page, xas.xa_index); + p[nr++] = folio_file_page(folio, xas.xa_index); if (nr == maxpages) break; } From patchwork Sat Aug 17 09:51:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13767119 Return-Path: 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 9A867C52D7F for ; Sat, 17 Aug 2024 09:55:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9D7C38D00CE; Sat, 17 Aug 2024 05:55:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 986DA8D0066; Sat, 17 Aug 2024 05:55:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 875DD8D00CE; Sat, 17 Aug 2024 05:55:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 680FC8D0066 for ; Sat, 17 Aug 2024 05:55:38 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id E5E291C28FE for ; Sat, 17 Aug 2024 09:55:37 +0000 (UTC) X-FDA: 82461280314.01.F757278 Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by imf08.hostedemail.com (Postfix) with ESMTP id 5F16F16002B for ; Sat, 17 Aug 2024 09:55:34 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf08.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.190 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1723888480; a=rsa-sha256; cv=none; b=bjLk7BBQM1/mRSVeA43ivWigdNjOL/I4GI5Cj/sBxNuBJLOIy7N44384S0ys8QbWY9B8vo 2vDJT2R/invP85tBEJRU8rlmPeQjvoCwt/sv2/xpgbqM/F+DSWdt/iu5N//dNcCvO/mATB ZAdzVG6KaRULTyJJjqCQApFXPAPmEjA= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf08.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.190 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1723888480; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hZrlL6BS+TGbWNASSVB2zXB2iQfSKIxScNHr1O896sA=; b=EeJjKZfGEDbQv/G749g+YWplwbeDNkj0t6qHsfD/U3azP7HyA3+4P1FtxeXnHPTMo8/HuW xS31tvDZnKylVqyVsh7UuvoqG4fQ6UohrfA8pn4QTdPdgZe1yPtxXxJJYXu97tuGp4TB19 7nISlNh69ys9zYQc0I+ZUYSF61bPIr8= Received: from mail.maildlp.com (unknown [172.19.88.214]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4WmDcp1zzWz2CmhW; Sat, 17 Aug 2024 17:50:34 +0800 (CST) Received: from dggpemf100008.china.huawei.com (unknown [7.185.36.138]) by mail.maildlp.com (Postfix) with ESMTPS id 1BD161A016C; Sat, 17 Aug 2024 17:55:30 +0800 (CST) Received: from localhost.localdomain (10.175.112.125) by dggpemf100008.china.huawei.com (7.185.36.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Sat, 17 Aug 2024 17:55:29 +0800 From: Kefeng Wang To: Andrew Morton CC: Matthew Wilcox , Alexander Viro , David Hildenbrand , Sidhartha Kumar , , Kefeng Wang Subject: [PATCH 2/5] pagemap: use a folio in __readahead_batch() Date: Sat, 17 Aug 2024 17:51:19 +0800 Message-ID: <20240817095122.2460977-3-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20240817095122.2460977-1-wangkefeng.wang@huawei.com> References: <20240817095122.2460977-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemf100008.china.huawei.com (7.185.36.138) X-Rspamd-Queue-Id: 5F16F16002B X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: r8c6w8ym7fcth8ikzq39j9741yuzqw33 X-HE-Tag: 1723888534-754274 X-HE-Meta: U2FsdGVkX1+WJBm9+IszCT0eBgE61FdJcO3EEpsDcWGZPIpJjY9/5xDvTtLk6pTTYUKmlBni3DmB2V+Cs6CceC1ttI8TcMICngHGLK8wMGvIiB4veJCR8cFF1p+1M9T5hgIh0SVjyTVNJb597G1XqwMfICpifx+SktxKOc80e+BXMEXU4Hgg9yAraP3Uul93VjzJD01A5dKnLVxn68mwo0lvlQ+6W6pogrrs+zFvwKl/pfb61e2Qw0obzlm8Td0j42glkVgoR0TDJXBI27SFykUceZZQtkCSv0InMjBQb5xDyRL6ojzSUphU716Tovzx5Rx/pAdU9/Sczc4SK78ome8zrsTUxnp5j6Ey0BUGAc9k1rHaB6WCRPkCewRSUV45UcLFH/3165q0/ytEuh5NzDkbFPw0TvvCdCPrYQFbkbF23sDiF3kWBjH7zohQ/02vWntpj56u3HquGPACZ8vUHdwpP3UHCSdolKx6053hJkrTr2dOTlfB693oum7YxZ+MathRoQKlHZIYOHF0M+qIlfHRgAOgQ520BpZ4tK+wcXsjU3gng54PXcN4j40sOlEDkkyRZirh8CdoOkMvgRiNNylNs6oq0ve6s8kXdDYp2DkZap70fWZRNAJbsuMj6+I0Y7ntS9o942Qw5zemshoRF8aAikd2hIcVeI6ilMkJlkmONkFfH7Bo4tHq+zxFx3e6blZhp9HKpm0JsD9GOcyDp2eYAIoGqVkafqmqOcKSQm/laVxxF1HVrwO8TLbXwHIe7nC3WXSnJQy0s7IotZaOOu94SkSDomLw0I2SQOKBt9NoIdYynd3bpKuPQmzY4hs6Tghh96w6+3vamd8jcE7Oz+5DB1bpvxKOGetfQotqhXPo/rWdUhKgplVKFKvkfezOtdeyo3c0HC75ATJK18g7BHz67J8SZ4I0bKqN1/wWUdJPYzNixovhV1e5b/eT1VuaA71+9ytyY123EX30apk K2WRBAS7 Ci3o+BLuMXo6yqIZVr1CxfFmgPEJLTH4Xd8hTjnZ+8Fg6QLAV83RoC4bkzWpBa3mR8iQgeS8KrGJRARP/QlsoKqBRYFVhAOk8Juht/Dp3C2ghSDuDh00qGbyCGOR76EYmw/r7Ur9CCQ0jYkeQ3G8O3cR70gEGa6+o7hLqdfs6aPR0K+2BjamKrlKP4RlFMK62Lags 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: List-Subscribe: List-Unsubscribe: Convert to use a folio in __readahead_batch(), remove the check of PageTail and thp_nr_pages(). Signed-off-by: Kefeng Wang --- include/linux/pagemap.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 68f59cd7637d..a83913555497 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -1363,7 +1363,7 @@ static inline unsigned int __readahead_batch(struct readahead_control *rac, { unsigned int i = 0; XA_STATE(xas, &rac->mapping->i_pages, 0); - struct page *page; + struct folio *folio; BUG_ON(rac->_batch_count > rac->_nr_pages); rac->_nr_pages -= rac->_batch_count; @@ -1372,13 +1372,12 @@ static inline unsigned int __readahead_batch(struct readahead_control *rac, xas_set(&xas, rac->_index); rcu_read_lock(); - xas_for_each(&xas, page, rac->_index + rac->_nr_pages - 1) { - if (xas_retry(&xas, page)) + xas_for_each(&xas, folio, rac->_index + rac->_nr_pages - 1) { + if (xas_retry(&xas, folio)) continue; - VM_BUG_ON_PAGE(!PageLocked(page), page); - VM_BUG_ON_PAGE(PageTail(page), page); - array[i++] = page; - rac->_batch_count += thp_nr_pages(page); + VM_BUG_ON_FOLIO(!folio_test_locked(folio), folio); + array[i++] = &folio->page; + rac->_batch_count += folio_nr_pages(folio); if (i == array_sz) break; } From patchwork Sat Aug 17 09:51:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13767124 Return-Path: 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 F21CDC52D7F for ; Sat, 17 Aug 2024 09:55:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 215AC8D00D3; Sat, 17 Aug 2024 05:55:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0D7A08D00CF; Sat, 17 Aug 2024 05:55:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EB8348D00D3; Sat, 17 Aug 2024 05:55:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id CEEB28D00CF for ; Sat, 17 Aug 2024 05:55:41 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 95F381A05D0 for ; Sat, 17 Aug 2024 09:55:41 +0000 (UTC) X-FDA: 82461280482.02.846D445 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf10.hostedemail.com (Postfix) with ESMTP id 61F87C001F for ; Sat, 17 Aug 2024 09:55:38 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=none; spf=pass (imf10.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1723888464; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ss4JETdMoaJz3tU6jROR4vKh495ultomvTa+/QJ/dHY=; b=uCyH2VuVWKEDfeaR+B+ja20rafWdvEUa8eKsF+0xuSJHjD5CFa5fblsRLFz9kkt2gEvP0H LX7G/nh0c2acOmPlddE/9ZUabL75CM3ylFwWW43nsuF6xGfztGrJP82FuOwD2dIKBZiYOU L9263OOweO980T7e1NfhGpa2fATlLgM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1723888464; a=rsa-sha256; cv=none; b=MxW5Rro/vKSF+d1B/yXSWE2i4YecfZcWGnvWw6uSjDdKT0ihWyWxkvU1ROjNjIiKixn8t4 K9VcqL+w8rt8gCAejHkhjtazZ0+cQA0/McdlPjGBG7TqUGkyR1dCzM8mblBJ7pNniJ3NHd cSr4R0IoKCwSuPP3arrB/UtJBT3s6I0= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=none; spf=pass (imf10.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.194]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4WmDjr6H3Pz1T7Rn; Sat, 17 Aug 2024 17:54:56 +0800 (CST) Received: from dggpemf100008.china.huawei.com (unknown [7.185.36.138]) by mail.maildlp.com (Postfix) with ESMTPS id 8603F1400E3; Sat, 17 Aug 2024 17:55:30 +0800 (CST) Received: from localhost.localdomain (10.175.112.125) by dggpemf100008.china.huawei.com (7.185.36.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Sat, 17 Aug 2024 17:55:30 +0800 From: Kefeng Wang To: Andrew Morton CC: Matthew Wilcox , Alexander Viro , David Hildenbrand , Sidhartha Kumar , , Kefeng Wang Subject: [PATCH 3/5] mm: remove thp_nr_pages() Date: Sat, 17 Aug 2024 17:51:20 +0800 Message-ID: <20240817095122.2460977-4-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20240817095122.2460977-1-wangkefeng.wang@huawei.com> References: <20240817095122.2460977-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemf100008.china.huawei.com (7.185.36.138) X-Stat-Signature: hnhcd4f79qki9tx3i7xdqr1mo134ucou X-Rspamd-Queue-Id: 61F87C001F X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1723888538-152876 X-HE-Meta: U2FsdGVkX18l17j8ToSX4sg8vH35mEgAj0JppKgtiW7xVpMuNDgJTCpv0Gvm8AfsmCeolRESJy64p1coidJaVkhy7PXHH+2fmreyGVu5qbLzJ82g+2OmmA/fNI5bbaUfTqGLveheuqNUz28vS2S7q74DDnPRA5pPoI0qZUeclWeHxsbeNe0KN3Z3oT/Etks4NE6E8xfSaSqEFZY4o94GSOkBoxiFklIINA96f+KEQNFjBpqIrlJn1BNXVDgUxEXP3ADtYIQP+BGsLcklzpZ2dbSsKaiRnnTtEEIKIJ+OHS5isP61+VGhrJcUn8IhTlPiEKOkpLDwl3FJjq/QUcSE2xRMbZSQFo0Xi/3PQC4W2iwJpoaPnCRw4TyHOyJaINTJjfix9DSeh+HxGLNlG+xMjlaRDcnFrpfpnHhAenO7JAcBm2CPGeL7KxE0xZNnmWLsDxra11AQhtMWWaEIJykoPaIBIEeSGt13fAL0YT4m7rgKkxC07CSwaq/YvdAS28W7PV6+8Nru02xlxVK1nO6M/TuRBQw8QC/gp2DLQ9x4NThxqwmyk2e/vjSo0f4HIMyNCutXYIXHJC7NTmzU4MrK2nBEWWcz5yikpSrdpGB4FYcq1IAtnPN4Nd04Y1BD7bAXcej8Zh18JqTQD7ZyFKTsXV/iT9N4mkTl+mZ+vrVeb/rs561GeXT2VOPAkgrEXdh6krMAIYBfoZEbKMLTV/RgBbFbxzeCzNcgaInm+mMuHGBP415HWis9POcasJ0odg8VJ3cZRrnY3OXiSugWeddwrTXj6SBC4j74zxc0PvN3WYtghTQO9mAaIZh+jKWidIINYZtjW1SLzoM5ohleoqorMhh8RGVW41J/yh9FJjgVyzj+KeBWKne6BT+0vYGhG1rKhWYf/wmUApCbOPDrINcixRGDt7Xkxl9sOkYceqPh8wBpX8oWuBzUYBhfFo0sFZlVjhB6bSgA24gjmYkGxHC 0POP2nEA qyKqj5rvP9kWv9oK573s+cOJNaUDTO2mLME/EmWFpjMnrOiGFJz5jhK/fqcVTGPBRz15pS3F1y6bZbcrgbPFjHIhIb0njTUNYHEMd4PxjVU74KyySdwsL4ElGegTQjV9p8TZx72xdeGOjhQ7ESjJrErNk2gb0Vv2wSKEDsRBWh7CYvbvLSE3VWPYO1pfwmxVaGhU5 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: List-Subscribe: List-Unsubscribe: There are no users of thp_nr_pages(), remove it. Signed-off-by: Kefeng Wang --- include/linux/mm.h | 9 --------- 1 file changed, 9 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 653287396808..d6a1b8356a31 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2065,15 +2065,6 @@ static inline unsigned long compound_nr(struct page *page) #endif } -/** - * thp_nr_pages - The number of regular pages in this huge page. - * @page: The head page of a huge page. - */ -static inline int thp_nr_pages(struct page *page) -{ - return folio_nr_pages((struct folio *)page); -} - /** * folio_next - Move to the next physical folio. * @folio: The folio we're currently operating on. From patchwork Sat Aug 17 09:51:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13767120 Return-Path: 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 86AC0C52D7D for ; Sat, 17 Aug 2024 09:55:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F239E8D0066; Sat, 17 Aug 2024 05:55:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EB7278D00D0; Sat, 17 Aug 2024 05:55:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D7E508D0066; Sat, 17 Aug 2024 05:55:38 -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 BDD218D00CF for ; Sat, 17 Aug 2024 05:55:38 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 3621C1A05D0 for ; Sat, 17 Aug 2024 09:55:38 +0000 (UTC) X-FDA: 82461280356.14.CD40FA0 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf30.hostedemail.com (Postfix) with ESMTP id A947F8001B for ; Sat, 17 Aug 2024 09:55:35 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=none; spf=pass (imf30.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1723888436; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8XkKxLrmBCSX6p5WCCvAz0doZCiQjZUC4v8jCk75XOA=; b=DqCRJ+cvvLOeo++hwb0PBDii6G3JhUPs3zzhH4Tk24QiDz0/R5hgxNtx8slEwFauOw+PbZ G4tKjhaTz5HoK+O4bWgKf/olf5rNRHJcdnm1Sp61WJg0/xYwsqwJ1H9Bb3e75iBN44kiJ0 k7r2Snj2Hg6oLlkwCrsMsa5Hi2QyFo0= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=none; spf=pass (imf30.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1723888436; a=rsa-sha256; cv=none; b=33eKpXw7QEIrANhDtUGKuT2axmn1wC1IQaJQGTp5FsGmbulXm1SLbCPwQCmTibnPDBZ29z QhynVPixaOVpcmaVSdAVaqpIpHEc6ZJ1smrlRfXdmwYdxFPsizBAGTpBUePv0gB1RonbF0 b3uNRy8PpKPwDA4F5GAtoh1HcgWwrZE= Received: from mail.maildlp.com (unknown [172.19.162.254]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4WmDk85ltSzcd4J; Sat, 17 Aug 2024 17:55:12 +0800 (CST) Received: from dggpemf100008.china.huawei.com (unknown [7.185.36.138]) by mail.maildlp.com (Postfix) with ESMTPS id 07AB71800F2; Sat, 17 Aug 2024 17:55:31 +0800 (CST) Received: from localhost.localdomain (10.175.112.125) by dggpemf100008.china.huawei.com (7.185.36.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Sat, 17 Aug 2024 17:55:30 +0800 From: Kefeng Wang To: Andrew Morton CC: Matthew Wilcox , Alexander Viro , David Hildenbrand , Sidhartha Kumar , , Kefeng Wang Subject: [PATCH 4/5] mm: khugepaged: pass a folio for set_huge_pmd() Date: Sat, 17 Aug 2024 17:51:21 +0800 Message-ID: <20240817095122.2460977-5-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20240817095122.2460977-1-wangkefeng.wang@huawei.com> References: <20240817095122.2460977-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemf100008.china.huawei.com (7.185.36.138) X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: A947F8001B X-Stat-Signature: tncdrdnuy6hjixm5n3wew86k9a5i5emm X-Rspam-User: X-HE-Tag: 1723888535-341099 X-HE-Meta: U2FsdGVkX1+IXdZWDDJoo2spLtuW/64TAwlD+ucDl2vqXRuxxpyK9SjhAiK6O+2bBGO434UNcDeWo4xqN5wYK0jO7L6cQdmcDiRKUs4Kjg2sJ003Kzgd3eLY4zI173VavCxSscq/It7ntKPrVFIwKPe4NIGBkl37rXaER4ry+XFZ44cPJIFYsvuZoYuOnkLWqtyX2elhCxbuaEUMYtsPpdwlymaCh1Rhrrp0rpoLxsXD3cwuDlbA4GYY38ry5WShU/kw8mrsNm/4hfEnji2+QSEBSQStMp8F3HqoeA2y/57+bAlCNqZ7Un9Tt6adZ/uLyA4/gFkoqNXF8R1YP+uVPbbwUyd8/akK0V0HIc8mymaECp2SeFHM2QpDXQoi3nwNpnnCwUiJp3KTLR4DGbAk9BdJNdVbKCRrgQkEDPQLAxvP0rfQM4bV0p7BLRAbUcOhqXqNuwsSZv8x07XzzVFNapCZEEZStwiUOYyVReOgNQBK4JdLooqB2a7NUKJZzz0ewwW0Ysjg4R8vW/YSQwj830dNn1LJKrsCcY44pAYs1WVG2MeeFaf/wIwAl00Htai9Dn5iGLuIDDC3oWVK6PjC+RzH0bLkLaWudt2XxSlGERc4IJRotKyCTAB0L1Zw4zGUpaYvSZfQ2OoWGTtEg80iV0VUh0cBCDbHu4kkYjtrSXEMLKXpvySEbE5y+rAxqjtncnidRzm2Y7C6ZGzyD/xlfzo6Ra//3G1arecrr/+TrVDW26hvs5f1H4Fo+hK/UBa2RvXmySCb8K3QUV1A56xWVtTxsiCL7Inr71aElx3IlP6M//uzJs6KQP6uy5qdIrYoUSWU6N52GDMsp/TYF4xUWsRf9Ypk/B7oDC8u0MEuI9Z5blr9t2//uAPV8/KJKoMQ4BA0Phcyn0ej8/bRAw/H7oG6/lRrOYDXk0RqwOpyuVhxoq+K2Y0mtBxd1kkr7lVOzi0ERRrWYBqwkhTg3/D xGH8VP4m hFgGhFB1n7i5OHN7RFfz2eDVSrpL+4amdV8Wf2m4q6HmoSFHQjnJwGQM7/cCrrKbU7iBpQ3CNc6kDCYYKBZFzL9V1OcQ/Ld/sdaYrc7R6GiDxbXiWI+FsMzrbvmQIHv0dtxfU9yVTAi/zPhdSKWVXtIgmNSB5kWbkJPjeuq5Y4gchtnlizuxOuZ3DAMfztHw4H5x1 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: List-Subscribe: List-Unsubscribe: Save one compound_head() and remove last PageTransHuge() in set_huge_pmd(). Signed-off-by: Kefeng Wang --- mm/khugepaged.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 02e1463e1a79..ae796219f8a0 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -1455,7 +1455,7 @@ static void collect_mm_slot(struct khugepaged_mm_slot *mm_slot) #ifdef CONFIG_SHMEM /* hpage must be locked, and mmap_lock must be held */ static int set_huge_pmd(struct vm_area_struct *vma, unsigned long addr, - pmd_t *pmdp, struct page *hpage) + pmd_t *pmdp, struct folio *folio) { struct vm_fault vmf = { .vma = vma, @@ -1464,13 +1464,12 @@ static int set_huge_pmd(struct vm_area_struct *vma, unsigned long addr, .pmd = pmdp, }; - VM_BUG_ON(!PageTransHuge(hpage)); mmap_assert_locked(vma->vm_mm); - if (do_set_pmd(&vmf, hpage)) + if (do_set_pmd(&vmf, &folio->page)) return SCAN_FAIL; - get_page(hpage); + folio_get(folio); return SCAN_SUCCEED; } @@ -1670,8 +1669,7 @@ int collapse_pte_mapped_thp(struct mm_struct *mm, unsigned long addr, maybe_install_pmd: /* step 5: install pmd entry */ result = install_pmd - ? set_huge_pmd(vma, haddr, pmd, &folio->page) - : SCAN_SUCCEED; + ? set_huge_pmd(vma, haddr, pmd, folio) : SCAN_SUCCEED; goto drop_folio; abort: if (nr_ptes) { From patchwork Sat Aug 17 09:51:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13767122 Return-Path: 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 93C18C52D7D for ; Sat, 17 Aug 2024 09:55:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D59DB8D00D1; Sat, 17 Aug 2024 05:55:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D0A5F8D00CF; Sat, 17 Aug 2024 05:55:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B5C4F8D00D1; Sat, 17 Aug 2024 05:55:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 984048D00CF for ; Sat, 17 Aug 2024 05:55:39 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 4A863160585 for ; Sat, 17 Aug 2024 09:55:39 +0000 (UTC) X-FDA: 82461280398.10.7633B73 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf04.hostedemail.com (Postfix) with ESMTP id E306F40003 for ; Sat, 17 Aug 2024 09:55:36 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=none; spf=pass (imf04.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1723888437; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yqMYThzwFYwMorLsY+ky31EpeoOH95q0aHPXdErN6nc=; b=Z4RysW0dMq/shjJorWXuaPsXiOI48kr+EcBtBohZpHqeAvTp4VlJUBvR/YatRv1jiRjccm CczcpHW3gpxPxejVFF0adj8ieeLqTZgBiISlNMTm6bBmXodBkN5GSdMCqMt5cpP1Ls8P7f 51LkeoiY1ogtQ/Qwoa173/mwLEm9Y9E= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=none; spf=pass (imf04.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1723888437; a=rsa-sha256; cv=none; b=ROwjX5w+yra0GxHrY5kw8S59wQKSRi84FKUVT7V/EHe+X+ZSKHd/1h1RFJ3myMUzwS3fUW EUWw1ajQPwvmSPJPdFuh+sKWRLMMbTUjI9Q4e7olAHSLlaOqaEjQ220QR/8Q0h8SWvu0+k PEgw6KDwYl0cS8et9fxihIgyeLnmy8w= Received: from mail.maildlp.com (unknown [172.19.163.174]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4WmDht1MnFzpStk; Sat, 17 Aug 2024 17:54:06 +0800 (CST) Received: from dggpemf100008.china.huawei.com (unknown [7.185.36.138]) by mail.maildlp.com (Postfix) with ESMTPS id 70A651400D1; Sat, 17 Aug 2024 17:55:31 +0800 (CST) Received: from localhost.localdomain (10.175.112.125) by dggpemf100008.china.huawei.com (7.185.36.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Sat, 17 Aug 2024 17:55:30 +0800 From: Kefeng Wang To: Andrew Morton CC: Matthew Wilcox , Alexander Viro , David Hildenbrand , Sidhartha Kumar , , Kefeng Wang Subject: [PATCH 5/5] mm: remove PageTransHuge() Date: Sat, 17 Aug 2024 17:51:22 +0800 Message-ID: <20240817095122.2460977-6-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20240817095122.2460977-1-wangkefeng.wang@huawei.com> References: <20240817095122.2460977-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemf100008.china.huawei.com (7.185.36.138) X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: E306F40003 X-Stat-Signature: 4zpx5n5rdjc4mjcsyurkx3kutczjt9di X-Rspam-User: X-HE-Tag: 1723888536-698988 X-HE-Meta: U2FsdGVkX1+GEncdFn2dc2rqhFi2hYIQc7xsm/4iDGfvpF9xyUzOj8NNHnb5v/NlSx/uTRRlvwemKds44ghsh7TvxArCdU+ESqdewToAhke8MUiuhy3GM6mp+Go8eYRJnEWMnSvrNGkJn6f2QBCBO6RI67W/YwObplJL1ChFTrNSEjNearLecEzI0SFPfCllZmfpqYNCBZO1+ozSXQwEs8rtS3tnXQrZWZ/VxLEp9ASDtJFyrTFBq6NfcGaJy3+Jilh6ePoE44welmiMC/ygyamQyN04h9XGiWsr+nz7E9ceBoMYx9jZoaYEsZ4ItyBn7D3j9kR/9dS4zQK9ZSjSCbQX+MoLbwcn6sK5glgL/sHVX2huuowptTBh6i/Zsdy/LSN2pnEwI2wtsuc9ISGiRg8/b8ZhshRQDDUkzn/Cr1o+m+KVENiwkTVvNfqNE+JdGAb2X6FxnICyjXLYz5JYNnYwWw4htyu01NdOqXOAF9gf4HOWozK+vDBPYJ5SM8DqnVBStSsdRZoGtk+RIkD6DBmuNorvy30DliWEL3AAoz03lu49+kT/1oxvkCZBrj47gZplqEEl4grs0pyrJFB57pudBlbGfIhhEFqHcQ564NQ5pnulfywFPUxBPqRRa4GZJRRGqPTOdwP+zHu0p9MjJU803mKUWly63Z7/6WarCGV6DZiZ9/CdoG/Agy3hwBxkFuyEKgRimXMaEO5c3qDw7G9iq9cUqrHUCdeVFWpDU5kiTOKoStGlyjKkOuG2JIIfEd1DcvYQ71Yl70Rfku657QPFGe2/jpCcUnhBhENj0K+01zJ/pMnuDPY44CM5O0bGR8++5wKxaA73egbJMpwm165EG5qwQJ/0E89ctBXwyW/9GL0UxyxHTl7smybmDI6MFbeRO0A1/5ckrzHfyofwSxBXGO7+FRNZCB1ZIob8c1LdTvMkzZQz4xRo+OFC9bp00by4VMwNcGniFmGk/ZJ W3Ym7+MH 4ASGNHzwo4LjFI35PczK/9s+8acb/52CFJhwW6b6MEDnYiKUlAUNYCd+UEaCG2Mvyv7VNOG5k4qArEOVfrP/XWB84qx/WEKW4KDrwlpl7vDKesIPwY1EJLqEJ2XfnfYRJzXK4r6YNqdOnTXSr9/FSOhmwnQ== 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: List-Subscribe: List-Unsubscribe: There are no users of PageTransHuge(), remove it. Signed-off-by: Kefeng Wang --- include/linux/page-flags.h | 13 ------------- include/linux/pgtable.h | 2 +- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index b753d158762f..71e972ba489e 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -871,19 +871,6 @@ FOLIO_FLAG_FALSE(partially_mapped) #define PG_head_mask ((1UL << PG_head)) #ifdef CONFIG_TRANSPARENT_HUGEPAGE -/* - * PageHuge() only returns true for hugetlbfs pages, but not for - * normal or transparent huge pages. - * - * PageTransHuge() returns true for both transparent huge and - * hugetlbfs pages, but not normal pages. PageTransHuge() can only be - * called only in the core VM paths where hugetlbfs pages can't exist. - */ -static inline int PageTransHuge(const struct page *page) -{ - VM_BUG_ON_PAGE(PageTail(page), page); - return PageHead(page); -} /* * PageTransCompound returns true for both transparent huge pages diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h index 780f3b439d98..36fc336782e8 100644 --- a/include/linux/pgtable.h +++ b/include/linux/pgtable.h @@ -398,7 +398,7 @@ extern int pmdp_clear_flush_young(struct vm_area_struct *vma, #else /* * Despite relevant to THP only, this API is called from generic rmap code - * under PageTransHuge(), hence needs a dummy implementation for !THP + * under THP, hence needs a dummy implementation for !THP */ static inline int pmdp_clear_flush_young(struct vm_area_struct *vma, unsigned long address, pmd_t *pmdp)