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 29B84C3DA5D for ; Mon, 22 Jul 2024 14:20:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B40A16B0089; Mon, 22 Jul 2024 10:20:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AF0586B008A; Mon, 22 Jul 2024 10:20:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9DFB06B008C; Mon, 22 Jul 2024 10:20:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 813816B0089 for ; Mon, 22 Jul 2024 10:20:10 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 1C0061219A4 for ; Mon, 22 Jul 2024 14:20:10 +0000 (UTC) X-FDA: 82367598180.05.6A56072 Received: from mout-p-103.mailbox.org (mout-p-103.mailbox.org [80.241.56.161]) by imf10.hostedemail.com (Postfix) with ESMTP id 126E2C0023 for ; Mon, 22 Jul 2024 14:20:07 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=pankajraghav.com header.s=MBO0001 header.b=eEMlUdYS; spf=pass (imf10.hostedemail.com: domain of kernel@pankajraghav.com designates 80.241.56.161 as permitted sender) smtp.mailfrom=kernel@pankajraghav.com; dmarc=pass (policy=quarantine) header.from=pankajraghav.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1721657985; a=rsa-sha256; cv=none; b=gCO1EMkBypCZwYPzFmN1MiH7C0DNElxByDP5c/p1fWZLAW5MxN7wSkYfSMm+2TYvcfgpD6 gOOMkiCg14xI8uZx1BLlT7lxvuBO2nScAvHl3XD3RgqTAalSadGylG263dl2JcfXSlXBP5 s9sJEesfsk46mWnBGyWkj1yY/EZ9Bng= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=pankajraghav.com header.s=MBO0001 header.b=eEMlUdYS; spf=pass (imf10.hostedemail.com: domain of kernel@pankajraghav.com designates 80.241.56.161 as permitted sender) smtp.mailfrom=kernel@pankajraghav.com; dmarc=pass (policy=quarantine) header.from=pankajraghav.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1721657985; 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=eyz9qfBcUQtwZ0SLs3SHTA7dLaRuH46FDkD9b19ehTo=; b=p32YolPty8iqKyAEpKajE7SFDJaq6YzN7YRDb3EHuLkEfPp5lRVjCEDrDGU7rYzVgjM983 O9TUEso2xbTAuUmNpNET+lX0/JMvGlYSdlLVooflsWHR1LmK2oRFl11PGfVyCu/Lhf7WaN bSAbLED3xwQ2S2yvN9cmuPiflKLbIEg= Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.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-103.mailbox.org (Postfix) with ESMTPS id 4WSMql1yPDz9snH; Mon, 22 Jul 2024 16:20:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pankajraghav.com; s=MBO0001; t=1721658003; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=eyz9qfBcUQtwZ0SLs3SHTA7dLaRuH46FDkD9b19ehTo=; b=eEMlUdYSPSSF/Ao3vUtkpcaasKr88s+aL4YohAA3FH5CfJI0Pl/fmByEU9imWjr6ENyn7d AeyTGGO7EdGNlXJgjchI0KNqjoVm5IY55IZY43nW+Q8jLjQcTGO/4LFkCSHbbdZsYprJPb T23Kzt8uwRpu3yoYwUZrIu1LgcQBXvbnKPC9ePOdv9Hg9qFjaPMaoIOUPcVvaQpOpD96x5 7M7A7TP8SCF1Lo7KsFN18Bp7mIek8yFRUlf3hVHDKP3EIdP+x5LkylFKsYYolCUlXIv9ae NPABlzqOWDPdebgv3VZ4c9pNVxqAeorAarKW0lUhcvxGNVDSEOWGd1+5cqw4CA== Date: Mon, 22 Jul 2024 14:19:57 +0000 From: "Pankaj Raghav (Samsung)" To: Matthew Wilcox Cc: david@fromorbit.com, chandan.babu@oracle.com, djwong@kernel.org, brauner@kernel.org, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, yang@os.amperecomputing.com, linux-mm@kvack.org, john.g.garry@oracle.com, linux-fsdevel@vger.kernel.org, hare@suse.de, p.raghav@samsung.com, mcgrof@kernel.org, gost.dev@samsung.com, cl@os.amperecomputing.com, linux-xfs@vger.kernel.org, ryan.roberts@arm.com, hch@lst.de, Zi Yan Subject: Re: [PATCH v10 01/10] fs: Allow fine-grained control of folio sizes Message-ID: <20240722141957.yog434qio6okkdiq@quentin> References: <20240715094457.452836-1-kernel@pankajraghav.com> <20240715094457.452836-2-kernel@pankajraghav.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Stat-Signature: 3gpqfzkgijdt9bexywwdht73wnim3bpw X-Rspamd-Queue-Id: 126E2C0023 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1721658007-73086 X-HE-Meta: U2FsdGVkX1/ybuqJFDZL7ZwpD8vsCX4QAbnbLKkOdIcCadgS9xVwQzbVW821qvWUVD4cSrJik7n66hR+OtaZFg0mkcotyS/pijgMVclktg68UeUh1dVd9oLl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Cr6mM41z0w== 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: @willy: I want to clarify before sending the next round of patches as I didn't get any reply in the previous email. IIUC your comments properly: - I will go back to silent clamping in mapping_set_folio_order_range as before and remove VM_WARN_ONCE(). - I will move the mapping_max_folio_size_supported() to patch 10, and FSs can use them to check for the max block size that can be supported and take the respective action. -- Pankaj On Tue, Jul 16, 2024 at 04:26:10PM +0100, Matthew Wilcox wrote: > On Mon, Jul 15, 2024 at 11:44:48AM +0200, Pankaj Raghav (Samsung) wrote: > > +/* > > + * mapping_max_folio_size_supported() - Check the max folio size supported > > + * > > + * The filesystem should call this function at mount time if there is a > > + * requirement on the folio mapping size in the page cache. > > + */ > > +static inline size_t mapping_max_folio_size_supported(void) > > +{ > > + if (IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE)) > > + return 1U << (PAGE_SHIFT + MAX_PAGECACHE_ORDER); > > + return PAGE_SIZE; > > +} > > There's no need for this to be part of this patch. I've removed stuff > from this patch before that's not needed, please stop adding unnecessary > functions. This would logically be part of patch 10. > > > +static inline void mapping_set_folio_order_range(struct address_space *mapping, > > + unsigned int min, > > + unsigned int max) > > +{ > > + if (!IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE)) > > + return; > > + > > + if (min > MAX_PAGECACHE_ORDER) { > > + VM_WARN_ONCE(1, > > + "min order > MAX_PAGECACHE_ORDER. Setting min_order to MAX_PAGECACHE_ORDER"); > > + min = MAX_PAGECACHE_ORDER; > > + } > > This is really too much. It's something that will never happen. Just > delete the message. > > > + if (max > MAX_PAGECACHE_ORDER) { > > + VM_WARN_ONCE(1, > > + "max order > MAX_PAGECACHE_ORDER. Setting max_order to MAX_PAGECACHE_ORDER"); > > + max = MAX_PAGECACHE_ORDER; > > Absolutely not. If the filesystem declares it can support a block size > of 4TB, then good for it. We just silently clamp it. >