From mboxrd@z Thu Jan 1 00:00:00 1970 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 BA944C433EF for ; Mon, 21 Mar 2022 22:33:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2EB9F6B0072; Mon, 21 Mar 2022 18:33:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 29A496B0073; Mon, 21 Mar 2022 18:33:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 188E86B0074; Mon, 21 Mar 2022 18:33:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.a.hostedemail.com [64.99.140.24]) by kanga.kvack.org (Postfix) with ESMTP id 063B46B0072 for ; Mon, 21 Mar 2022 18:33:01 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id D3CA121522 for ; Mon, 21 Mar 2022 22:33:00 +0000 (UTC) X-FDA: 79269844920.10.415E3D1 Received: from out0.migadu.com (out0.migadu.com [94.23.1.103]) by imf09.hostedemail.com (Postfix) with ESMTP id 5BD89140020 for ; Mon, 21 Mar 2022 22:33:00 +0000 (UTC) Date: Mon, 21 Mar 2022 15:32:53 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1647901979; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=4OY/H+zb0RIXu5WxaVqPmTsIU0BzpBHr2Aoo03K23OQ=; b=lWfBFFlwAImoY6uLwKWFs0S0tB3p39fYyxokhIeIaZPj4jja16BD+f2jryUMXCpvSoQH58 KeNgR9rDqZZ733hMRZ75cM3upum9/Xboyi1T1hrsp4FdNCyEUqd/OOG+FlIywmGiFjuF4e 0dwiI5FqWUCpfqADo77fjlQiIREimSI= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin To: Zi Yan Cc: Matthew Wilcox , linux-mm@kvack.org, Shuah Khan , Yang Shi , Miaohe Lin , Hugh Dickins , "Kirill A . Shutemov" , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [RFC PATCH 4/5] mm: truncate: split huge page cache page to a non-zero order if possible. Message-ID: References: <20220321142128.2471199-1-zi.yan@sent.com> <20220321142128.2471199-5-zi.yan@sent.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220321142128.2471199-5-zi.yan@sent.com> X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 5BD89140020 X-Stat-Signature: ttgbmjuymu5i86phqpx8yjtb1xz34uyt X-Rspam-User: Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=lWfBFFlw; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf09.hostedemail.com: domain of roman.gushchin@linux.dev designates 94.23.1.103 as permitted sender) smtp.mailfrom=roman.gushchin@linux.dev X-HE-Tag: 1647901980-464319 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000003, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Mar 21, 2022 at 10:21:27AM -0400, Zi Yan wrote: > From: Zi Yan > > To minimize the number of pages after a huge page truncation, we do not > need to split it all the way down to order-0. The huge page has at most > three parts, the part before offset, the part to be truncated, the part > remaining at the end. Find the greatest common power of two multiplier of > the non-zero values of them as the new order, so we can split the huge > page to this order and keep the remaining pages as large and as few as > possible. Would you mind please to describe the algorithm in more details? Thanks!