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: 200878 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp1095570dyb; Wed, 14 Feb 2024 01:38:04 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVI8c/UfbN02BLFKmpS6C/u8puhqT+VAfbqtWyDE2Al6aAT+oLuSCrmfEVQYDU1Zzoa4rSh1Q832XDs6/vPaMKoYSj7eQ== X-Google-Smtp-Source: AGHT+IE1qylF+TPWVSuG/TvEI/eFXAC6qdHO6ggKwW5z0V7wMvKbWStQPQFbpX/hkL9FDy/u88fo X-Received: by 2002:aa7:c444:0:b0:562:14fb:53e with SMTP id n4-20020aa7c444000000b0056214fb053emr1676757edr.1.1707903483996; Wed, 14 Feb 2024 01:38:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707903483; cv=pass; d=google.com; s=arc-20160816; b=R2uXLE6isM74L5yWe9wdTsDE1foGpkji0Q8Tg9EVDn1k0TRNVw2+nqVIVM04ZVQAnY xw2YnwsEzLikPlisHZLYqDBilFQsO9d8iLcbTbsGzQUIuAwld2xq+rG/p/hrdKbJ4PZp /iU+JJF0cT+bff0SRv/h25H0d5/TLsNCP2JZPBSa7FEHt1zSeXex2L9vzU+GQ93ct15c 1jnIstWZOlxCPxM/+hVqyG3iuXvEk5fflcLoU+hKNhNsznU1C/Fz3araqkkIiTpcs5Yi ME/TJeSA241c32y/3eHn7rMMITYo+lfiXYcmj3FDcoFx1kOCV0Uu9h/qQxjYBE6IK8ae fZeA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=vOt507Ijo5nyZ5wUX3vXhvqctlR5/JOvafIYIWSMCPU=; fh=wnfTHNBzaht1bLPmQY/+LGWRsYRQC5yq2LmC3G1xhHQ=; b=O9daPp+b5wUM5EK/RH3myds3Z/aEW0K34Mx/Q6mxyUNU65c103zQ0e+m+CHgOeP7ok kTU9YxiECZDlSGyI+pxSulszG/rFQ6xZRJLNeFI2F1wMTaW3KZ34bRZXMFjlof+S1udn zJfC23Awo/Va07I71TNloMrwMO18I/0FzoXuOOSDVl+Zy6WcLKOFrpSd8WG/ZHJN7Z0Z SXXpOYkCNYtDkdYCHHKN2OLvnvyuaD4xrw4Umf/CdkOFgG/Glmtsvktuvc/HY8H0wacn nO+pWl72Zq8oCXzWTx40nTl9+yRGi6GjslPeQ1Uuth8X3XEtg7Ga7RnTdJPm+PPYKvPX yR/A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@pankajraghav.com header.s=MBO0001 header.b=PYSoXXZF; arc=pass (i=1 spf=pass spfdomain=pankajraghav.com dkim=pass dkdomain=pankajraghav.com); spf=pass (google.com: domain of linux-kernel+bounces-63230-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63230-ouuuleilei=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCVG6U9uMYsuxUcBfRDbSyD/qLzdTIjTEwwukHiXikb9Vh8E/Cs2ts5HKV1EPrQubyjpWY/8VXvuIYm21RO8HgyMk3uddQ== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id z26-20020aa7d41a000000b00560f7f7351dsi4701613edq.613.2024.02.14.01.38.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 01:38:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63230-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@pankajraghav.com header.s=MBO0001 header.b=PYSoXXZF; arc=pass (i=1 spf=pass spfdomain=pankajraghav.com dkim=pass dkdomain=pankajraghav.com); spf=pass (google.com: domain of linux-kernel+bounces-63230-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63230-ouuuleilei=gmail.com@vger.kernel.org" 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 193C91F26D95 for ; Tue, 13 Feb 2024 09:42:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BCA2550A6F; Tue, 13 Feb 2024 09:37:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pankajraghav.com header.i=@pankajraghav.com header.b="PYSoXXZF" Received: from mout-p-102.mailbox.org (mout-p-102.mailbox.org [80.241.56.152]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 998C946444; Tue, 13 Feb 2024 09:37:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.241.56.152 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707817073; cv=none; b=ngLP1k7FFiQkQN/J4j8svMT7TnBKY0g8g+4drcEAjNlTRUrk92YO95ni5Luq7AoUiOPr9whpHBhh3xkHsCWljEJJFPzCNJjwhYK4eacDejv7Lf50OL+fYIf2DB2mgN2hU+ouyq5ZtMoVSX71UPJBRpFc9bPkeDcwISR2Kuk0zKM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707817073; c=relaxed/simple; bh=aT7myvwbv8s6n+EpwpZGFT8dH3zqU9o7RwFhXcMPQLg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LXf93ClozDS7ToV449Xu4Ka1F+nU2GpLm+2sgwmgz62ONGG5CwTqIsKX2d4JrgX6nZ/Hu4t5OlK8zytvbufvbB0qIDWkL0hnJBfrPA2tbvMuNkIpts+AgE7FYqtYNk+qnjcRJORHC1swwi3n3BC8HAJhOodRC0WNXXW1qq4sBrk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pankajraghav.com; spf=pass smtp.mailfrom=pankajraghav.com; dkim=pass (2048-bit key) header.d=pankajraghav.com header.i=@pankajraghav.com header.b=PYSoXXZF; arc=none smtp.client-ip=80.241.56.152 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pankajraghav.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pankajraghav.com 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Rspamd-Queue-Id: 4TYx7v6WyGz9sp2 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790796690582328411 X-GMAIL-MSGID: 1790866603754853811 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 --- 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);