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 6610AC48260 for ; Tue, 13 Feb 2024 21:29:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E871A6B008A; Tue, 13 Feb 2024 16:29:19 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E37BB6B008C; Tue, 13 Feb 2024 16:29:19 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D00006B0092; Tue, 13 Feb 2024 16:29:19 -0500 (EST) 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 C0E826B008A for ; Tue, 13 Feb 2024 16:29:19 -0500 (EST) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 8C44B1403DB for ; Tue, 13 Feb 2024 21:29:19 +0000 (UTC) X-FDA: 81788071638.17.61B259E Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf28.hostedemail.com (Postfix) with ESMTP id DF5A3C0011 for ; Tue, 13 Feb 2024 21:29:17 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Tw2vRvgv; spf=pass (imf28.hostedemail.com: domain of djwong@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=djwong@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1707859758; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=+J5TbqElkYdwn8/aa4Gu5bIjM9KJLszZYGfTrxi53pU=; b=dzPDU8sM7ZD0EdyB3sH6PHFfnPFYDbKBjowuu9oFb/pns0v5yDZMfv7sKEMQFld40PeBQc 4lM0b35b5Gj8QVBUEQUerua4UqBOikFNAVh5hi4N3g5mUyuhTqVOubm1zZ13rF4ULL/2BT kjfXcgzKaYz2Si20boX+hy2DcaSr2Mw= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707859758; a=rsa-sha256; cv=none; b=YV2GqWvNwqYOFYg8j7lZTt7wfylqLM4lbL/9y9RZ5iDXBbucedaJ81qJcQU1odncw8ek1O bxyZT85vwagrHDQ0hwV5eu7R8st22hbaHBRmSTIHjoV/PgHjZQjkoj7k5MyOTnYcSnPEGQ cf+0/gNBaSAXW6CjYnZZTUxrPTcdM5I= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Tw2vRvgv; spf=pass (imf28.hostedemail.com: domain of djwong@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=djwong@kernel.org; dmarc=pass (policy=none) header.from=kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id E0B30614CD; Tue, 13 Feb 2024 21:29:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7DDE0C433F1; Tue, 13 Feb 2024 21:29:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707859756; bh=QClImjY1lYcfORamVxbILEkRAbA7o0MUEXBX6cK6mdo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Tw2vRvgvBGoL0Ybzyb89j9Y1Lm4agG8oAyI/KLsbv3TRTZOvVBQCjGbNELkZdSC19 gpRw2yOJELK7gbM82zJ28/vuizg6p0Zt9gme8w7eEhoH7nYgW/dakZeWvM8k7VT6Ka QXLqI2SttC5f+otkU1PkmVz4crUdpqcBV7kDsO08/S2/g2bl7Nlqi0hwW5N9KvDJXR 3neoJi0i0g2NpSg+CqOuCk3yP+mCS7T4u/skbEPqkj86JzM1y9POHMvvzgp7/gzkjm pYxrrB1WQDGmyO6My01WjdOh2FATKOWemRL0m/T4587jN1wLfe9HXOcRtS0GFiW2EO Mr2rUD9JKmtMw== Date: Tue, 13 Feb 2024 13:29:14 -0800 From: "Darrick J. Wong" 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, 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: Re: [RFC v2 01/14] fs: Allow fine-grained control of folio sizes Message-ID: <20240213212914.GW616564@frogsfrogsfrogs> References: <20240213093713.1753368-1-kernel@pankajraghav.com> <20240213093713.1753368-2-kernel@pankajraghav.com> <20240213163431.GS6184@frogsfrogsfrogs> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: DF5A3C0011 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: dwaubh4moykz4m43bq3g3wkfq4bh15eu X-HE-Tag: 1707859757-731675 X-HE-Meta: U2FsdGVkX18Glvt2WPbOgeXHWAiiKU4o2BEMq2xdJw1fCJcMcUfvbWcMApc3HQCxLY45Cj7DzVtpud3y+muOjz+hasTSdwmv8lQhyxsoVUznDvNT4ibxv2+g+Y04TOq6XLGAyN7sDQdFZgeqW3rmbsGR+ZcEdgUvGzue2Ypn+5mV1J6u4Ve74HC+pXK4V+KVJ3hyW3JHc7X6QWoLghhmQ7rH6ErSnf142V1tV7ACFC+gEO2TT/gLuhHFIljhW1Zz2JVTJYT7qwut4UgdY5BbIwv5iZg9ADW99oPe7dCCGP5ToLjmNbckCmXmyMAst3jZgzjaQZUJqtaoY1FyRhyN6/tPbh//X4RjR/SfBN3b5ixlyt0Fz7sRtk66VdEHDszv/2MiEpzJi6M9Rcgcz5d3RRSzlUSwro/ROf5t7MswPjDzQYuSd1vVb34HS+yYhTQAm9AxJ1YSoSmTansbdbjwctagIF00fdq2smxzMU3jiDOQEVlkutDamCm4r0BjaJrGGOhWZiq541U9608re0XdW330l55K0RqlNyZIdyxrgwFNR9zezpTE7uQyS28oMH9wZGA5iRY3cz2VPQX9djfwOKsByZq48rj/Y5vWcP8jYcBOhNFZG+Ttqk//zuCvoTGQ12DSOgIiEk4H6tn25CXjuW8AExJMysdkN1GOOa62zxrKMP/x46EKaiYt2X/IivSvnXlHBlzuU1V0RsQ0Kwk8iD5mL1rcB3mj1iVUN9Go895f17d3mV+X64rHdpbJLNy85UYF05qoRt5cce8JU/Y/JOVzbXXRHrKnL/+4yjdbkK2jYLQ9iHoMmehuIrCIqcjR+3sFxtN8zcwR5N1PQRY5Z0KRamD+NPuYt3F/Y+oj5pBSFMSBudUWA7H7tPKwMW0m3zfZ5ux1V38afCXoZpKVlDM3XJi9fH8mKIl7E+WgHrIBUeQjTDFNAj+QIkskoS61l0JEM89boFlw7wdq+f6 XnYfPCb4 AbTOir8gex3LDRjDGTdJwbu+BJAzlDhToX7WajIgJWNdSjcrN2QOxB8GT+D3GROPlQjHvB+ExF8GElGxxmWTPsmoYLhknIWAaIwE2l0s3wV0RrhWPxWK8+Tp4l+KkmSQSY6FBczw4AVlZE4gWN2P+4tl7djheFgu+tl+n+gnBlFbzwXPuU+bHnUlDwxKgF2RdSCgyXMcCKCrgpfBPX7CEUOVkfi67Y3Kc0grEy6YzlVPCjm5S1DHfrpBsBA== 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: On Tue, Feb 13, 2024 at 10:05:54PM +0100, Pankaj Raghav (Samsung) wrote: > On Tue, Feb 13, 2024 at 08:34:31AM -0800, Darrick J. Wong wrote: > > On Tue, Feb 13, 2024 at 10:37:00AM +0100, Pankaj Raghav (Samsung) wrote: > > > From: "Matthew Wilcox (Oracle)" > > > > > > Some filesystems want to be able to limit the maximum size of folios, > > > and some want to be able to ensure that folios are at least a certain > > > size. Add mapping_set_folio_orders() to allow this level of control. > > > The max folio order parameter is ignored and it is always set to > > > MAX_PAGECACHE_ORDER. > > > > Why? If MAX_PAGECACHE_ORDER is 8 and I instead pass in max==3, I'm > > going to be surprised by my constraint being ignored. Maybe I said that > > because I'm not prepared to handle an order-7 folio; or some customer > > will have some weird desire to twist this knob to make their workflow > > faster. > > > > --D > Maybe I should have been explicit. We are planning to add support > for min order in the first round, and we want to add support for max order > once the min order support is upstreamed. It was done mainly to reduce > the scope and testing of this series. > > I definitely agree there are usecases for setting the max order. It is > also the feedback we got from LPC. > > So one idea would be not to expose max option until we add the support > for max order? So filesystems can only set the min_order with the > initial support? Yeah, there's really no point in having an argument that's deliberately ignored. --D > > > +static inline void mapping_set_folio_orders(struct address_space *mapping, > > > + unsigned int min, unsigned int max) > > > +{ > > > + if (min == 1) > > > + min = 2; > > > + if (max < min) > > > + max = min; > > > + if (max > MAX_PAGECACHE_ORDER) > > > + max = MAX_PAGECACHE_ORDER; > > > + > > > + /* > > > + * XXX: max is ignored as only minimum folio order is supported > > > + * currently. > > > + */ > > > + mapping->flags = (mapping->flags & ~AS_FOLIO_ORDER_MASK) | > > > + (min << AS_FOLIO_ORDER_MIN) | > > > + (MAX_PAGECACHE_ORDER << AS_FOLIO_ORDER_MAX); > > > +} > > > + >