From patchwork Wed Mar 13 17:02:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Pankaj Raghav (Samsung)" X-Patchwork-Id: 13591604 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 0B37BC54791 for ; Wed, 13 Mar 2024 17:03:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BEAD180049; Wed, 13 Mar 2024 13:03:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B9A76940010; Wed, 13 Mar 2024 13:03:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9EC4780049; Wed, 13 Mar 2024 13:03:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 89746940010 for ; Wed, 13 Mar 2024 13:03:32 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 61FEF40827 for ; Wed, 13 Mar 2024 17:03:32 +0000 (UTC) X-FDA: 81892637064.13.44E0116 Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org [80.241.56.171]) by imf06.hostedemail.com (Postfix) with ESMTP id 49B04180029 for ; Wed, 13 Mar 2024 17:03:30 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=pankajraghav.com header.s=MBO0001 header.b=L+OtKexa; dmarc=pass (policy=quarantine) header.from=pankajraghav.com; spf=pass (imf06.hostedemail.com: domain of me@pankajraghav.com designates 80.241.56.171 as permitted sender) smtp.mailfrom=me@pankajraghav.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1710349410; 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=F3Xg5bE7lOUEiWrLgvJkawBGempm7FqinU/8gfujPB8=; b=l9fLMiH1ETHuWsNd1WFH8EmYjLj+uJ8qUJDIfaGvRS5ykA1G/PwmHpgAqh3zLY1ZahwUGZ iHeX+4IQfNdCIkHK3WQEASH77mNrmKV8JM2Pv0PkIMRIh+ud/f3BaLxjReSR9MnCWmAunK 4a49YFnTfldRkQSIHtbYv1olMeHzGRU= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=pankajraghav.com header.s=MBO0001 header.b=L+OtKexa; dmarc=pass (policy=quarantine) header.from=pankajraghav.com; spf=pass (imf06.hostedemail.com: domain of me@pankajraghav.com designates 80.241.56.171 as permitted sender) smtp.mailfrom=me@pankajraghav.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1710349410; a=rsa-sha256; cv=none; b=VZp7VIZzedW1vdzI1GzX/sbZeCR8qeT6Mp80SE8Ii0H92kXdbuXl/r+Flb8tV8IoySgyX8 eustI8AsO8Gb7dvMYWmKQV3Szq3W6VBps+FLvqnCtQWTeuwXwyEjaR0EswPNHnDovDsLWl WEyAM64Cd/P/kra5DNHNm99PYilarLY= Received: from smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:b231:465::202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4Tvxfl1Ftrz9sqV; Wed, 13 Mar 2024 18:03:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pankajraghav.com; s=MBO0001; t=1710349407; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=F3Xg5bE7lOUEiWrLgvJkawBGempm7FqinU/8gfujPB8=; b=L+OtKexa8lscvnV+tP6Qwfgscep0OokKJI+6VWJsVSvNCdYGHpjfa+oUx+M4CnU+flHItA Z7biTY7xoXAJWfjX8BUdzqizkXIbR083jNK0fC/LUb0rJ1ZBAH9+6gYFAQuNpHE9vI7/wL zbWzflaswuuxg1W3On8MRJaz9vHDwPBmneBEUngNZBU/bneNO4W9RdsLF/SuGWBcq4rFBL EDyHiJ9W22Go64+oMoK0yj/4z70enqNwtiC/3W/sgqAhc0pY2QxwX3uOcaTcmNTYsts4WV zcm5NCF1rZ91I8S3vS/p0psodGFJnSjvTeYE+LRQIBxvVmMN5SOOT2jfF38FPw== From: "Pankaj Raghav (Samsung)" To: willy@infradead.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: gost.dev@samsung.com, chandan.babu@oracle.com, hare@suse.de, mcgrof@kernel.org, djwong@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, david@fromorbit.com, akpm@linux-foundation.org, Pankaj Raghav Subject: [PATCH v3 07/11] mm: do not split a folio if it has minimum folio order requirement Date: Wed, 13 Mar 2024 18:02:49 +0100 Message-ID: <20240313170253.2324812-8-kernel@pankajraghav.com> In-Reply-To: <20240313170253.2324812-1-kernel@pankajraghav.com> References: <20240313170253.2324812-1-kernel@pankajraghav.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 49B04180029 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: yzyxxdejg3gp6nbbnhozrjnaqc9pnjzg X-HE-Tag: 1710349409-556121 X-HE-Meta: U2FsdGVkX1+PazkEdH9cJdZaEaTs7NUrOATu2IliQEQT+ViAOHDupBrGccRGxDKxhV9JJWN7y78kJRU5+LtWFllkc0W1e8D2EhuFQFh6eMpbtPy8woKTJFDhHJlvd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DBCLArH+ClUUjyhJijytz1kvl8W20JpEuyQ7ZNEj//HmtwhJMmV5t2Q+ivZD2dDHat5JjfE0nGEEqXsFqyQSoq9Y1zqTsCROcQ2rr6pm0mTR8LGgeWvr3dAhS5ktuZM9NVJ0JSHWIxT8yi51Fiw+aeyWUAvI2jrM3Lqw+0eUikN45V0spMOqJErJ8tWt7LAk3ZE/wf1oIH7g3JBVOgSDSTufhRv6MnEbHmbVe7UNOXNrFbzYoP1VsWEtQ9tEz4yqQ+9PfJ+aHK+x8HfK3JLMnXVd4oZ60GhSTFRnQAvywmifopZaJhRUi1FpAL46Z73R3M 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: From: Pankaj Raghav As we don't have a way to split a folio to a any given lower folio order yet, avoid splitting the folio in split_huge_page_to_list() if it has a minimum folio order requirement. Signed-off-by: Pankaj Raghav Signed-off-by: Luis Chamberlain Reviewed-by: Hannes Reinecke --- mm/huge_memory.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 81fd1ba57088..6ec3417638a1 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -3030,6 +3030,19 @@ int split_huge_page_to_list(struct page *page, struct list_head *list) goto out; } + /* + * Do not split if mapping has minimum folio order + * requirement. + * + * XXX: Once we have support for splitting to any lower + * folio order, then it could be split based on the + * min_folio_order. + */ + if (mapping_min_folio_order(mapping)) { + ret = -EAGAIN; + goto out; + } + gfp = current_gfp_context(mapping_gfp_mask(mapping) & GFP_RECLAIM_MASK);