From patchwork Fri Mar 17 10:58:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Roberts X-Patchwork-Id: 13178883 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 57AE6C74A5B for ; Fri, 17 Mar 2023 10:58:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AAD136B0080; Fri, 17 Mar 2023 06:58:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A5F186B0081; Fri, 17 Mar 2023 06:58:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8AF836B0085; Fri, 17 Mar 2023 06:58:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 76F036B0080 for ; Fri, 17 Mar 2023 06:58:30 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 508FE1617CF for ; Fri, 17 Mar 2023 10:58:30 +0000 (UTC) X-FDA: 80578091580.08.0F9CB0E Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf28.hostedemail.com (Postfix) with ESMTP id AB954C0009 for ; Fri, 17 Mar 2023 10:58:28 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf28.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1679050708; 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; bh=S/jJrLnAXbq8rUkwlmRMy37z3XO9fYbM79Iuu4QhghE=; b=mCQsb4tgfz7ImqRdHe/UHnjGdgYL1YAizVn2mTO2rPEWdtCkON9jLBb43tbAolhq6zkdiJ CZ3zF8M6b+i0QU5YQWjABlMeHQQ0xi2gHzribKscCW6ZSxGIqQvzMfSUZ4VKoMJYflbP2W Tv044+uyu4o88huV6v/atxpbI7f7WkQ= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf28.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1679050708; a=rsa-sha256; cv=none; b=BFsGTyudxwhYzMpw3u/MVdYRmEl3WpQhJefgyoIaWr/s4Ors3gJ0r1HpKE46SKUk2QsWZL Srf2RpjpH573zOvS5lm6Jysd5qPKW7J+HxcMbMhIVPxXwkhBfiTzau1JseBrQVUYaFMWEZ BWKHXBWsNAroMrACjPcMwEacer5Z0Zs= Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 043051A2D; Fri, 17 Mar 2023 03:59:12 -0700 (PDT) Received: from e125769.cambridge.arm.com (e125769.cambridge.arm.com [10.1.196.26]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3E3FA3F885; Fri, 17 Mar 2023 03:58:27 -0700 (PDT) From: Ryan Roberts To: Andrew Morton , "Matthew Wilcox (Oracle)" , "Yin, Fengwei" , Yu Zhao Cc: Ryan Roberts , linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org Subject: [RFC PATCH 6/6] WORKAROUND: Don't split large folios on madvise Date: Fri, 17 Mar 2023 10:58:02 +0000 Message-Id: <20230317105802.2634004-7-ryan.roberts@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230317105802.2634004-1-ryan.roberts@arm.com> References: <20230317105802.2634004-1-ryan.roberts@arm.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: AB954C0009 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: zwxaf6zr85w6mb3w168t1rc9r8qj6jxc X-HE-Tag: 1679050708-714459 X-HE-Meta: U2FsdGVkX1804EisYJPcNVlLOM6qZ0Qkk1PxOxXZb1vQdspjnCIlfb9bcxMws3z17oeUyPwd5CiQv6ggromtR0qvI0Jp7G9GB5Ip1cbIyd6DmExQI9JBazxUMut88BSjOHNiFZao4msX8OSXBUSzb8rcb3siN531SCTX1jvJkoEWjAN4uHpTy4rppExPc7DLtt524dem5vp/zCyXJFiIZ3sEt3Ay8t5YBi9zVhFqKikMaf/Kz+16WejgkQT4aetCAcTduyStMyNr5z4l78k2/lJEzHZDgeajo7Gwnzmhb5IsRoRfX8O0744XfYRYsjNiXinI4TmTrx87mkjBX50+GC2niCQSkb3pPMQ2LpxN0w1xTckNV30wBGPq/Bkl3H3wreipIC3bB9SIci2z/US97qm5XSO8C3B9JwYWuKNsZb9/KCaIQGCxAGDZPJZ0WUi5H3pi9vs1ZCnpe0zZQfAjxsDnUMIACCVWyXLNwPl4eLhFI4O41L9ad1hdBSO42ImYb7wG1U6oIgWlIuQHX6hy55MSuJGyr2Hqay1W7lTSnACgj9n63Lg3k4B77JSzJjKtvfKoFNRLmOimOGaaAbmqRliF2+h8G0/6Vi1H6+3Bhmzl0HWCUaVch9Fw3j1hYrsdwG66cY54yFb+HrnM5W6Ktqi85s34r+OXINUO626JJRFJHSWxkT+ygDKnTmH/3cBcDE6h0onhAEw4K2AKbTRLmB7ANrE6gpO83BfX/dVpmft87sBRWIdKN2fe+5nES4FsckYCgTGYt8G1YBjw4LEsONTsSXtFAANhUfjhX/7yjTOIGgRSNbDhqfjo2WiZE9pOzCqChkWRsXn6uOIxU5dOERtG5Jtm7Yyrc38V9Sga/BCCuAyA6P2XdcQc7yu9TWq1baw+Ut2fcOEVmHF9aHWuvMYHu1jPXicVU6wGhJoc8AwpAyGor9I4SykirPBuwU96Yz+sqdvK8GZ29kRiRN6 8f5Aqoba 4O4yN4A3g4a30lq0tVZm4gHoLRWY/rqn2gK15JtGH44b3LaaqGdHnljeO/bpr/ZQl39UIg1cDJzrb1Mh4Sg1ggu0cSX0pWdhuH9UzXIQg2zRiRht6tcdoeXQqpv+2y1lFEVt385Jt4U5T1xPJQ6gwUt2EZwEe58LveKqKQPA9W7HxBZw= 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: Signed-off-by: Ryan Roberts --- mm/madvise.c | 8 ++++++++ 1 file changed, 8 insertions(+) -- 2.25.1 diff --git a/mm/madvise.c b/mm/madvise.c index 340125d08c03..8fb84da744e1 100644 --- a/mm/madvise.c +++ b/mm/madvise.c @@ -447,6 +447,7 @@ static int madvise_cold_or_pageout_pte_range(pmd_t *pmd, * are sure it's worth. Split it if we are only owner. */ if (folio_test_large(folio)) { +#if 0 if (folio_mapcount(folio) != 1) break; if (pageout_anon_only_filter && !folio_test_anon(folio)) @@ -469,6 +470,9 @@ static int madvise_cold_or_pageout_pte_range(pmd_t *pmd, pte--; addr -= PAGE_SIZE; continue; +#else + break; +#endif } /* @@ -664,6 +668,7 @@ static int madvise_free_pte_range(pmd_t *pmd, unsigned long addr, * deactivate all pages. */ if (folio_test_large(folio)) { +#if 0 if (folio_mapcount(folio) != 1) goto out; folio_get(folio); @@ -684,6 +689,9 @@ static int madvise_free_pte_range(pmd_t *pmd, unsigned long addr, pte--; addr -= PAGE_SIZE; continue; +#else + goto out; +#endif } if (folio_test_swapcache(folio) || folio_test_dirty(folio)) {