From patchwork Tue Feb 13 09:37:07 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: 13554789 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 10D7EC48260 for ; Tue, 13 Feb 2024 09:37:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 91DB28D0007; Tue, 13 Feb 2024 04:37:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8CDEC8D0001; Tue, 13 Feb 2024 04:37:53 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 76DB28D0007; Tue, 13 Feb 2024 04:37:53 -0500 (EST) 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 620508D0001 for ; Tue, 13 Feb 2024 04:37:53 -0500 (EST) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id F3520120AB6 for ; Tue, 13 Feb 2024 09:37:52 +0000 (UTC) X-FDA: 81786278784.02.CD28095 Received: from mout-p-102.mailbox.org (mout-p-102.mailbox.org [80.241.56.152]) by imf21.hostedemail.com (Postfix) with ESMTP id 521831C0018 for ; Tue, 13 Feb 2024 09:37:51 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=pankajraghav.com header.s=MBO0001 header.b=PYSoXXZF; dmarc=none; spf=pass (imf21.hostedemail.com: domain of me@pankajraghav.com designates 80.241.56.152 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=1707817071; 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=vOt507Ijo5nyZ5wUX3vXhvqctlR5/JOvafIYIWSMCPU=; b=jFUnaOGGfiqjIwaWabLGlOUFEG089T7souFCZwISMuDIMvQ1ea8yCSPBpjXbwc1GCZ38uB NqelfAU4QBt9UvXx0TC6JR76k/qG5L9x9bjeANUTYeERYB8VSprynbvaWyfzYS8t4l+wEY fxLY1oNoo5fREwXSW8pZ4oeEvLVFVfc= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=pankajraghav.com header.s=MBO0001 header.b=PYSoXXZF; dmarc=none; spf=pass (imf21.hostedemail.com: domain of me@pankajraghav.com designates 80.241.56.152 as permitted sender) smtp.mailfrom=me@pankajraghav.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707817071; a=rsa-sha256; cv=none; b=B3CCYpMUAnG7/YnhS44AdBQ2Lqzd8dAz2Q8Uogs7gpCWvPGlkv9JykLdNVVfUdRLojC6dP AuVPGEGet3PQ2btLt2zN3eeP050pporWRsYN0Im44POQu5cmo9GJNOIOg1I4XJax8Rj2bq yQdCv4dOXRyz5XoI7KNpyh96MYSpjWA= Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (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-102.mailbox.org (Postfix) with ESMTPS id 4TYx7v6WyGz9sp2; Tue, 13 Feb 2024 10:37:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pankajraghav.com; s=MBO0001; t=1707817067; 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=vOt507Ijo5nyZ5wUX3vXhvqctlR5/JOvafIYIWSMCPU=; b=PYSoXXZF27fQan8sPatQHAhpAqM4cF203+dvlg+l2btfVaBSRRZiJ1MzdG7gxXCdw/x1xv zyTcd5oYO6PhI3ZFTTCL+6yiaM+Y6yFqYDrBTpKbEIBodE2d741iRoZELCaE88A++S1DY4 rTb77WTAkP4yb3+9A/L0UsVRr/+EI8CsZdN/tVRk429O3hpuT4W5VPTqeszPTncLWrnDU0 7UA6a6QW14Jlo99OKaM/RQfdVcRG6UsIp0cSAOQ7vP8EVJfGVRCfZwh+Jcy59vj6v6E1ie USql3iBXYGMEmlth5qx6Id4J6beIAHNMU9q3QOpfjtUTd+FbUH7EXaWS074UEQ== From: "Pankaj Raghav (Samsung)" To: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: mcgrof@kernel.org, gost.dev@samsung.com, akpm@linux-foundation.org, kbusch@kernel.org, djwong@kernel.org, chandan.babu@oracle.com, p.raghav@samsung.com, linux-kernel@vger.kernel.org, hare@suse.de, willy@infradead.org, linux-mm@kvack.org, david@fromorbit.com Subject: [RFC v2 08/14] mm: do not split a folio if it has minimum folio order requirement Date: Tue, 13 Feb 2024 10:37:07 +0100 Message-ID: <20240213093713.1753368-9-kernel@pankajraghav.com> In-Reply-To: <20240213093713.1753368-1-kernel@pankajraghav.com> References: <20240213093713.1753368-1-kernel@pankajraghav.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 521831C0018 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: rrzusydwd5zkdwnzneiknsbaf6in8em4 X-HE-Tag: 1707817071-89133 X-HE-Meta: U2FsdGVkX1+MQz+Mq1A2zk9OdkmP23XikHyzKx9j2Xf9kANqCdOpl3vg6fwoJmt4QlqdWtP48Z3RewibqfodIEw4KnALYaKzIUB6mVi9u3Euc79oraqLaVrWE3XzWlaV4AZINF8qfD6KDFHBPaWgUhY7l/oU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6QYXp1uONJbmtxzeh3hGp4MXZI8flb9k3xZHACPQl4mUbGqlGXIWcp53OX7LNaRJUOpHtUogSFYZZUGbDuXsgnj/pPigZqwJPmMYJRwk86IcN0W3ewdgtLlp/epMhvTEpWTd9z8xeCvdjhQtf1QFNtWTLfmd1yOKlFdSuYks4= 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 94c958f7ebb5..d897efc51025 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -3026,6 +3026,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);