Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp490980rdh; Wed, 14 Feb 2024 03:09:22 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXZ6q6VFHr7mM5EY3SUcv0sljQkgq0291SlHY9g2D4OP128cw+187wVeZhsEDJqSvR/UsXI/2bny9rOqmRYkg0oaIKZIKAsaqWStUBwMg== X-Google-Smtp-Source: AGHT+IEnXPFEjMK+iOJVRhtdne6U7nGKL0Gs+/bXALW1SLfoQ5nAt5Lp7E+brHlVHrBqBbBzxobt X-Received: by 2002:a05:6a20:939d:b0:19e:a9e6:bfa with SMTP id x29-20020a056a20939d00b0019ea9e60bfamr3016018pzh.0.1707908962323; Wed, 14 Feb 2024 03:09:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707908962; cv=pass; d=google.com; s=arc-20160816; b=Iy9rvc/G/6faseINY87fWWsBLzkC6kh3DM5Jwe8Ld454fWp5+x7LeZaCH/H70uf72z Wfla8lAAd1VCNbveCTJvT15aI+slfd5jSjR/wDk4DcDu+A1dOCjcejN3t+JdLJQDOOAG aAz6yO/DzgiQZ7/OWfgulZxZLvTTr5UczOjBpLWug1HDzr7GflM801tBsvhzpstsIaA8 +yexMxK6lt7vZTQ9RgUTCyIiST+BjIcHmDLMQpybxCaIqhguj/BJs6btO72PnK1ocU9H GvyZTrnUwHeQqUjA/t5nqdp5FOtDPUpLbWE391NAVrSdbvF9G1rotiG4+gBYjad8Ztsa 3U0A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=pUfgK8/3Zvw4KNdYhiVmFgGZlIeUA3hJI1YkO3cDfJg=; fh=64vnfvUUB2g0OLPia9cHfpDaT3446l656icb2vw+C3E=; b=qwm84UVhtKD3/Q4fWGkLkVsY/+694jXn7bpq793qfx7Jicu6ULuw8mNf64To+riKyk 9jNP0wrOhIM8DLzotIPttKLIUDDVAkKn1luuQfT3+2B9hLz9O2xBSNeirfmfyzP5fntw +eriFxzMmMDIVzJhkS2HOITIXghuLa0LpANVC63d7aQV+1R5hV9ZddD0aQw7tHwlPyfn mjjL1FQX8Q7WZu/h7Izq01fJjxZ186mXZsVkooLWPz7uRPVH0J8TdNNsZ3IttmBtGnVl EVYv6clvRD47lW+TOxaHp1zYA+jct/Sd9QSZAJ5qK6bhuuyodVhfk5EhDFeR5zhjUaKU A6UQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-65078-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65078-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com X-Forwarded-Encrypted: i=2; AJvYcCXo2J22Mrf/f8RRvXfxsRU4aa6S+MmULgrVZHZl/dhhm8ONTUUTZjEbPkiPQKJNa5tqxhTxWYhmSVLdeo1d9AcnWtMgU1ZVFdKNdlqIbA== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id k11-20020a170902c40b00b001d8a94d10d9si3583900plk.448.2024.02.14.03.09.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 03:09:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-65078-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-65078-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65078-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id DEC20B214C8 for ; Wed, 14 Feb 2024 10:50:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 18E3918E14; Wed, 14 Feb 2024 10:50:27 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 751CC13FFC; Wed, 14 Feb 2024 10:50:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707907826; cv=none; b=tLA2itbq4+xIuQJ65eFGo+2EmPOr8wtSNG++R79T05k5+btLggOqN4GVMLqLf+D2jpCRgdzE8sqlBlKs6Ruh5tNoWofGYbkhxtdib30/kJ5IMP2nMTxsgtTketFd1tDZF7KBkDJ7fMEcEtCbrCt2Mj3w9oS8VvqTu3NXhntpSFw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707907826; c=relaxed/simple; bh=sS/qjzjbnPW2D6JeEd3oPGOZMUVRw2tXtw9oHmDmz8E=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=QKik7S27g9BL0ar1V082dmJCZyHsv0TGTgD6P/dh/1JbJCGPcscaJNt3+k10W+ub8LSYhC3hrP6v/EYEkmRshHVhOmll+SFHM2wbFK/e3JmLqVlUQDsocPKqPUVejs/cbFdKEZR7Zy//pfVbh1yoGflwYjMV/6ys02CCFe70CDM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 7259D1FB; Wed, 14 Feb 2024 02:51:04 -0800 (PST) Received: from [10.57.64.120] (unknown [10.57.64.120]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 541673F766; Wed, 14 Feb 2024 02:50:20 -0800 (PST) Message-ID: <66d4b27f-85e4-458e-8d66-54f800c5c65f@arm.com> Date: Wed, 14 Feb 2024 10:50:18 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 0/7] Split a folio to any lower order folios Content-Language: en-GB To: Zi Yan , David Hildenbrand Cc: "Pankaj Raghav (Samsung)" , linux-mm@kvack.org, "Matthew Wilcox (Oracle)" , Yang Shi , Yu Zhao , "Kirill A . Shutemov" , =?UTF-8?Q?Michal_Koutn=C3=BD?= , Roman Gushchin , Zach O'Keefe , Hugh Dickins , Mcgrof Chamberlain , Andrew Morton , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kselftest@vger.kernel.org References: <20240213215520.1048625-1-zi.yan@sent.com> <659e1abb-40d0-42ba-ba0a-8256d7eb1c5a@redhat.com> From: Ryan Roberts In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 13/02/2024 22:31, Zi Yan wrote: > On 13 Feb 2024, at 17:21, David Hildenbrand wrote: > >> On 13.02.24 22:55, Zi Yan wrote: >>> From: Zi Yan >>> >>> Hi all, >>> >>> File folio supports any order and multi-size THP is upstreamed[1], so both >>> file and anonymous folios can be >0 order. Currently, split_huge_page() >>> only splits a huge page to order-0 pages, but splitting to orders higher than >>> 0 is going to better utilize large folios. In addition, Large Block >>> Sizes in XFS support would benefit from it[2]. This patchset adds support for >>> splitting a large folio to any lower order folios and uses it during file >>> folio truncate operations. >>> >>> For Patch 6, Hugh did not like my approach to minimize the number of >>> folios for truncate[3]. I would like to get more feedback, especially >>> from FS people, on it to decide whether to keep it or not. >> >> I'm curious, would it make sense to exclude the "more" controversial parts (i.e., patch #6) for now, and focus on the XFS use case only? > > Sure. Patch 6 was there to make use of split_huge_page_to_list_to_order(). > Now we have multi-size THP and XFS use cases, it can be dropped. What are your plans for how to determine when to split THP and to what order? I don't see anything in this series that would split anon THP to non-zero order? We have talked about using hints from user space in the past (e.g. mremap, munmap, madvise, etc). But chrome has a use case where it temporarily mprotects a single (4K) page as part of garbage collection (IIRC). If you eagerly split on that hint, you will have lost the benefits of the large folio when it later mprotects back to the original setting. I guess David will suggest this would be a good use case for the khugepaged-lite machanism we have been talking about. I dunno - it seems wasteful to split then collapse again. Or perhaps you're considering doing something clever in deferred split? > > -- > Best Regards, > Yan, Zi