Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp35390rdb; Wed, 14 Feb 2024 11:50:41 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVgG9n5VDGWU+mCVAGnUveDd2VgIJNqV5sdEI4XGAvqlZTDUrIB5in5jRWI0ubF/yLb8aGJSMw2W836zNHegNymdbFC4taCrx3C+xVNGA== X-Google-Smtp-Source: AGHT+IHP/QEE9VAH0c/reKcw48aYZ+570qO4GrzvqzZfyK6/Vsf4eGtRbxmJo73rp+uW77wmJNrb X-Received: by 2002:a17:902:f68b:b0:1db:6c6d:f8ea with SMTP id l11-20020a170902f68b00b001db6c6df8eamr1723460plg.27.1707940241182; Wed, 14 Feb 2024 11:50:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707940241; cv=pass; d=google.com; s=arc-20160816; b=C9tbIZexQxjJGseYkTl3eQELjTy7rpdDiWtfvWtE02N8k9jtBw6JYq3e6Ll35CycmB li9+ep8b/b4ed5mWV1+8W3Qm7A5S9Q5e9ItJCSF7FNvJQsrTKAG4ad5JuLaBxIlnNZLW eyBRpbbLSGoiL5AYEm/AuWDDvIZ25jiwJ/iP0Ke+VV0y1uRlFpas7CthA6A5jp1nRHWi X8QgLeAndZXr7IRbZuMDPsvs7fxoz3h0A7InJTBaRCCvJ4XUZV/3VKxK47YFqfAQYYni dUYxXRrjxILrpMAb8CJWCS73WhqL69x0+V3q59wgDBc6roOUVqqjfQPR7+qQoUep5wY5 T0Lg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=0KOsHR0mivN1ZZPk/2uGmtXwkoKyWymL79tieqRNs30=; fh=bCxY21azHRpX57jkOJEr1QFO4J8zGrffhvocgE/mJLI=; b=WBL1LW0aCia5+S0EXVcTF/ORhFcNfQ7U+yBNriSM7UENF6L7wH2w6oUW+7s9NHk+1G Nt00E3sdgFVcpWuRlPxF+UVl5zPg8jr411IZ8OrHboXP5tmuOTDEteRSXwWX3CK1arXM 9tTtnDZJo6ZoRqCWrJw7N4UDTfjnqwRwYM7tUMtFOeoR9l95qpExidqRQRNdwvLaOmxw czAaEtYDtwkEpFLNIjOFX4GNpv2QlzTLheVwkAYAepaFPGtEEE84XWNJcsNumdg8/Nnd DawWnOYfxb7krJs/Sst5lNBh0y9MnEZXbviQZkQT/hpMk6H7rTz75+ye7iwXqaM5V+Zn kE8Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=OvyXhtJ8; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-65836-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65836-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCUr2sQSHVya/1hBc0mFhSzjoWXtDhSeo75e+9u59EYB+NGAB+bThOk9C2Mn9mkoUA9x4sCYBnQy8gew3e6ivKRJQFgb3NWgWXNnUZ8r0w== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d13-20020a170903230d00b001db28b0c06asi4129863plh.329.2024.02.14.11.50.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 11:50:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-65836-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=OvyXhtJ8; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-65836-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65836-linux.lists.archive=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 246AF28502B for ; Wed, 14 Feb 2024 18:50:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1592A13A26C; Wed, 14 Feb 2024 18:49:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="OvyXhtJ8" Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 7462312F594; Wed, 14 Feb 2024 18:49:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707936596; cv=none; b=AOgLRiTRl3V4UKLBGXqqMNAr+qTeu7/MCd7LjGSHyIbFAa6BV4i9zlYarVSwhN3obva8tamBBaAa+z58vok3tpoql0FaO+yYDUhm84OHaIzEbbFC1+j02EzJxlYZG0a1DjPpQB/GyAoaJOdCtVMWux9nMcUw5/yqhugeUUzhPqQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707936596; c=relaxed/simple; bh=iBeIw0o1R3URh7naf47rO/sCII+0g4wVjBf/jxJYoeo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=QIJw+fKy7Chij//vWDmNyMPbFdyhbrlu7tly4vIAJ+uAB67u/IRS58mlz90uYT7ZdvkNJ/HS/elwevLeQOWXHEHQNJlsDHF82jB+/I0vw/8PVNDOhfBaJme/rzzl8O0X0mRD+N1ivWs3brZegnv19fxWOBfu6RDzIkBdxoJawzQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=OvyXhtJ8; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=0KOsHR0mivN1ZZPk/2uGmtXwkoKyWymL79tieqRNs30=; b=OvyXhtJ8mQgx4SgxaUeo7jx9L4 bjPJWNX+T7lTnlXe/fI6JNH3/RIBdDr1g2KQNWbeblnK1FMIf5ZtSM6Y35/vtq8XdW4bld4YqAune mmIuNNz/a9ISDWOwrCc1fJ/MoFgbbE8Fl8sTaU3v58DBQsVo+IU58Lcmvsw3jMMzXkTOrOZZ80hXR BvLXvH+4XHO8oaiaC7ALXQhUU2OTz9jJnaU2xcAvKzuX5/ke82xeUcmPHaa7HS4QdJaEm6kZgCn+R p74VQqWy8sZv/9g+3ejyqe/ugYMLllAZQi3jFyq9CHL0JXL//stNzydkLuK2+14+CcN90N4+tGFNP jdB6FYjQ==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1raKKL-0000000HKRe-3RpX; Wed, 14 Feb 2024 18:49:49 +0000 Date: Wed, 14 Feb 2024 18:49:49 +0000 From: Matthew Wilcox To: "Pankaj Raghav (Samsung)" Cc: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, 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, linux-mm@kvack.org, david@fromorbit.com Subject: Re: [RFC v2 01/14] fs: Allow fine-grained control of folio sizes Message-ID: References: <20240213093713.1753368-1-kernel@pankajraghav.com> <20240213093713.1753368-2-kernel@pankajraghav.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240213093713.1753368-2-kernel@pankajraghav.com> On Tue, Feb 13, 2024 at 10:37:00AM +0100, Pankaj Raghav (Samsung) wrote: > +static inline void mapping_set_folio_orders(struct address_space *mapping, > + unsigned int min, unsigned int max) > +{ > + if (min == 1) > + min = 2; If you order the "support order-1 folios" patch first, you can drop these two lines. > +static inline unsigned int mapping_min_folio_nrpages(struct address_space *mapping) I'm not sure if you need this, but it should return unsigned long, not unsigned int. With 64KiB pages on Arm, a PMD page is 512MiB (order 13) and a PUD page will be order 26, which is far too close to 2^32 for my comfort.