[{"id":3686917,"web_url":"http://patchwork.ozlabs.org/comment/3686917/","msgid":"<xjduwrjb3nlvvfaproth226slnagxhimeln3duhkizbzlh2xpx@zuh56jw5xk3u>","list_archive_url":null,"date":"2026-05-06T09:35:17","subject":"Re: [PATCH] ext4: enable mballoc kunit tests for blocksize >\n PAGE_SIZE","submitter":{"id":363,"url":"http://patchwork.ozlabs.org/api/people/363/","name":"Jan Kara","email":"jack@suse.cz"},"content":"On Wed 06-05-26 15:59:00, Baokun Li wrote:\n> With Large Block Size (LBS) support, ext4 can now use block sizes larger\n> than PAGE_SIZE. The mballoc kunit tests previously skipped three test\n> cases (test_mb_mark_used, test_mb_free_blocks, test_mb_mark_used_cost)\n> under this configuration because the buddy cache inode's folio mapping\n> order was never initialized in the test harness.\n> \n> The real mount path configures s_min_folio_order and s_max_folio_order\n> in ext4_fill_super(), which allows ext4_set_inode_mapping_order() to\n> set up the correct folio order for the buddy cache inode. The kunit\n> test bypasses ext4_fill_super(), so the mapping order stayed at zero\n> and __filemap_get_folio() allocated order-0 folios too small for LBS.\n> \n> Initialize s_min_folio_order and s_max_folio_order in mbt_init_sb_layout()\n> to mirror ext4_fill_super() behavior, enabling properly sized folio\n> allocations and removing the three blocksize > PAGE_SIZE skips.\n> \n> Signed-off-by: Baokun Li <libaokun@linux.alibaba.com>\n\nLooks sensible. Feel free to add:\n\nReviewed-by: Jan Kara <jack@suse.cz>\n\n\t\t\t\t\t\t\t\tHonza\n\n> ---\n>  fs/ext4/mballoc-test.c | 14 ++------------\n>  1 file changed, 2 insertions(+), 12 deletions(-)\n> \n> diff --git a/fs/ext4/mballoc-test.c b/fs/ext4/mballoc-test.c\n> index 90ed505fa4b1..04bc9f773d63 100644\n> --- a/fs/ext4/mballoc-test.c\n> +++ b/fs/ext4/mballoc-test.c\n> @@ -206,6 +206,8 @@ static void mbt_init_sb_layout(struct super_block *sb,\n>  \tsbi->s_desc_per_block_bits =\n>  \t\tsb->s_blocksize_bits - (fls(layout->desc_size) - 1);\n>  \tsbi->s_desc_per_block = 1 << sbi->s_desc_per_block_bits;\n> +\tsbi->s_min_folio_order = get_order(sb->s_blocksize);\n> +\tsbi->s_max_folio_order = sbi->s_min_folio_order;\n>  \n>  \tes->s_first_data_block = cpu_to_le32(0);\n>  \tes->s_blocks_count_lo = cpu_to_le32(layout->blocks_per_group *\n> @@ -791,10 +793,6 @@ static void test_mb_mark_used(struct kunit *test)\n>  \tstruct test_range ranges[TEST_RANGE_COUNT];\n>  \tint i;\n>  \n> -\t/* buddy cache assumes that each page contains at least one block */\n> -\tif (sb->s_blocksize > PAGE_SIZE)\n> -\t\tkunit_skip(test, \"blocksize exceeds pagesize\");\n> -\n>  \tbitmap = kunit_kzalloc(test, sb->s_blocksize, GFP_KERNEL);\n>  \tKUNIT_ASSERT_NOT_ERR_OR_NULL(test, bitmap);\n>  \tbuddy = kunit_kzalloc(test, sb->s_blocksize, GFP_KERNEL);\n> @@ -858,10 +856,6 @@ static void test_mb_free_blocks(struct kunit *test)\n>  \tint i;\n>  \tstruct test_range ranges[TEST_RANGE_COUNT];\n>  \n> -\t/* buddy cache assumes that each page contains at least one block */\n> -\tif (sb->s_blocksize > PAGE_SIZE)\n> -\t\tkunit_skip(test, \"blocksize exceeds pagesize\");\n> -\n>  \tbitmap = kunit_kzalloc(test, sb->s_blocksize, GFP_KERNEL);\n>  \tKUNIT_ASSERT_NOT_ERR_OR_NULL(test, bitmap);\n>  \tbuddy = kunit_kzalloc(test, sb->s_blocksize, GFP_KERNEL);\n> @@ -905,10 +899,6 @@ static void test_mb_mark_used_cost(struct kunit *test)\n>  \tint i, j;\n>  \tunsigned long start, end, all = 0;\n>  \n> -\t/* buddy cache assumes that each page contains at least one block */\n> -\tif (sb->s_blocksize > PAGE_SIZE)\n> -\t\tkunit_skip(test, \"blocksize exceeds pagesize\");\n> -\n>  \tret = ext4_mb_load_buddy_test(sb, TEST_GOAL_GROUP, &e4b);\n>  \tKUNIT_ASSERT_EQ(test, ret, 0);\n>  \n> -- \n> 2.43.7\n>","headers":{"Return-Path":"\n <SRS0=e+97=DD=vger.kernel.org=linux-ext4+bounces-16325-patchwork-incoming=ozlabs.org@ozlabs.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-ext4@vger.kernel.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","patchwork-incoming@ozlabs.org"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256\n header.s=susede2_rsa header.b=hK6nSEF6;\n\tdkim=pass header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=ALVxJFS1;\n\tdkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz\n header.a=rsa-sha256 header.s=susede2_rsa header.b=hK6nSEF6;\n\tdkim=neutral header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=ALVxJFS1;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.org\n (client-ip=2404:9400:2221:ea00::3; helo=mail.ozlabs.org;\n envelope-from=srs0=e+97=dd=vger.kernel.org=linux-ext4+bounces-16325-patchwork-incoming=ozlabs.org@ozlabs.org;\n receiver=patchwork.ozlabs.org)","gandalf.ozlabs.org;\n arc=pass smtp.remote-ip=\"2600:3c0a:e001:db::12fc:5321\"\n arc.chain=subspace.kernel.org","gandalf.ozlabs.org;\n dmarc=none (p=none dis=none) header.from=suse.cz","gandalf.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256\n header.s=susede2_rsa header.b=hK6nSEF6;\n\tdkim=pass header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=ALVxJFS1;\n\tdkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz\n header.a=rsa-sha256 header.s=susede2_rsa header.b=hK6nSEF6;\n\tdkim=neutral header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=ALVxJFS1;\n\tdkim-atps=neutral","gandalf.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-ext4+bounces-16325-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz\n header.b=\"hK6nSEF6\";\n\tdkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz\n header.b=\"ALVxJFS1\";\n\tdkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz\n header.b=\"hK6nSEF6\";\n\tdkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz\n header.b=\"ALVxJFS1\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=195.135.223.130","smtp.subspace.kernel.org;\n dmarc=none (p=none dis=none) header.from=suse.cz","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=suse.cz","smtp-out1.suse.de;\n\tnone"],"Received":["from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1 raw public key)\n server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g9Vkp4dwkz1yJq\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 06 May 2026 19:41:21 +1000 (AEST)","from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\tby gandalf.ozlabs.org (Postfix) with ESMTP id 4g9Vkn6SPnz4wCj\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 06 May 2026 19:41:21 +1000 (AEST)","by gandalf.ozlabs.org (Postfix)\n\tid 4g9Vkn6Q6sz4wCt; Wed, 06 May 2026 19:41:21 +1000 (AEST)","from sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby gandalf.ozlabs.org (Postfix) with ESMTPS id 4g9Vkj1NbMz4wCj\n\tfor <patchwork-incoming@ozlabs.org>; Wed, 06 May 2026 19:41:17 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 008A3303AB64\n\tfor <patchwork-incoming@ozlabs.org>; Wed,  6 May 2026 09:35:22 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 60CBC3DC4C4;\n\tWed,  6 May 2026 09:35:21 +0000 (UTC)","from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id D669D30AD0C\n\tfor <linux-ext4@vger.kernel.org>; Wed,  6 May 2026 09:35:19 +0000 (UTC)","from imap1.dmz-prg2.suse.org (unknown [10.150.64.97])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n\t(No client certificate requested)\n\tby smtp-out1.suse.de (Postfix) with ESMTPS id 0F4436B259;\n\tWed,  6 May 2026 09:35:18 +0000 (UTC)","from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n\t(No client certificate requested)\n\tby imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 03BB7593A3;\n\tWed,  6 May 2026 09:35:18 +0000 (UTC)","from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])\n\tby imap1.dmz-prg2.suse.org with ESMTPSA\n\tid PLPXAFYL+2lpBAAAD6G6ig\n\t(envelope-from <jack@suse.cz>); Wed, 06 May 2026 09:35:18 +0000","by quack3.suse.cz (Postfix, from userid 1000)\n\tid 53BBBA0790; Wed, 06 May 2026 11:35:17 +0200 (CEST)"],"ARC-Seal":["i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1778060481; cv=pass;\n\tb=m6X1zaWDIgPyrGaip1xA/ZfCkltU4WN5LRRSWj/wDOY9KDoN6heHSkq1F0/mbk22q2fogeFqo1imEUBjbzHGpP2kl22v1kd/VMjDCS9dfY01eqVzVSdn8kKzvWC+sjD5mbnFQT+zR5z+3vhPvh79i1/D5DmN1437FEeRBUaRnsLlx+P4Ly0UNtg+prDnvUvOJs+M7ZZrWS3h6/YbOrraoxR9gHgPnDT25RZvfHS+Yl5gk823kKcsSB0hhh9sRFzsVccu4CUzgRxseEIpQGnVYu3xmXwNO/4E53pkKP7/q5k/KxuhilWNi+5O6b8cnsS4ikQXrfSwbDrSNUDJXmy2AA==","i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1778060121; cv=none;\n b=jdcL7+ParI6TL8RmUb5w4Z0uejJqF1mz1YiPZBi1QIXQeTk9ASPQiq4CzYMHXydC7cOepqZmOwnfEvX7q9PL1WzR8IRXD55d0lyt/KHOr7jyi7myrzX/HV/Hxzge5tos/FB8RtQ7QUEZDudjuoF3McfgKY5e64GxN1WJpzbVzag="],"ARC-Message-Signature":["i=2; a=rsa-sha256; d=ozlabs.org; s=201707;\n\tt=1778060481; c=relaxed/relaxed;\n\tbh=/3jNXVakWdXrmEzJZl0S7Fl91TMBaZIw/pAeShBSRfU=;\n\th=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:\n\t Content-Type:Content-Disposition:In-Reply-To;\n b=JRw5vADJKLsQa2kBeEQs5E9/oMpdlLQbBmyER7JPKBm14DUjtyH2qH9e1Jfp4epUcI5HyXjMaHeqhUHF0+976Qb/LvuHDYDCLyrSwO7xT7aKFA9Qa3lLo/HzUu/Pa1hxE4EzYPbzyNvf2p14iE4drrp/t6wj29at9cpDbTC57usy4vNiPzKww0EcG4zj/vCyhzSyI6a8ZqpABI3iZApEbR6o3sz8aP5cx1pb8I40UecpoBvw2vPk9LSK196EMZxTzXOKgPVXIvA9KdRp8+vFKPK7ER3DEkelP/U8ygCaH03A/XEKP/O68JGi8Sck+2l4CDk0pEKgVh7lOY7FlcOe9Q==","i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1778060121; c=relaxed/simple;\n\tbh=85uy0TE6amGgzWnJ0dK6WKEm+tc8kMVjzywmV+z7Tg4=;\n\th=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:\n\t Content-Type:Content-Disposition:In-Reply-To;\n b=RekyGW/u41QKuFzxnbZJn5LxvK8Q+WAWNrw26D6BebNX//sBb8aH68uqIK6YAGoG1wY4aZDlFB5djUjUZBkHauDdUrugXK/J/SkipYCIxWh2/02IoZ2cbibDxDICDvjNjnyHFEmNG+J+Wh/4vf+e5lJiCahJVKD7zZv2g/I8rLI="],"ARC-Authentication-Results":["i=2; gandalf.ozlabs.org;\n dmarc=none (p=none dis=none) header.from=suse.cz; dkim=pass (1024-bit key;\n unprotected) header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256\n header.s=susede2_rsa header.b=hK6nSEF6;\n dkim=pass header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=ALVxJFS1;\n dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz\n header.a=rsa-sha256 header.s=susede2_rsa header.b=hK6nSEF6;\n dkim=neutral header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=ALVxJFS1; dkim-atps=neutral;\n spf=pass (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-ext4+bounces-16325-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org) smtp.mailfrom=vger.kernel.org","i=1; smtp.subspace.kernel.org;\n dmarc=none (p=none dis=none) header.from=suse.cz;\n spf=pass smtp.mailfrom=suse.cz;\n dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz\n header.b=hK6nSEF6;\n dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz\n header.b=ALVxJFS1;\n dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz\n header.b=hK6nSEF6;\n dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz\n header.b=ALVxJFS1; arc=none smtp.client-ip=195.135.223.130"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_rsa;\n\tt=1778060118;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n\t mime-version:mime-version:content-type:content-type:\n\t in-reply-to:in-reply-to:references:references;\n\tbh=/3jNXVakWdXrmEzJZl0S7Fl91TMBaZIw/pAeShBSRfU=;\n\tb=hK6nSEF6V7SHpd7axWAWAUEtLZaAiu2pf36yQHh9TIzoQhEtXI12JdVvU6gC1bfxO11ewx\n\taG0dQQw18sDhQdLCatmsmO3davEg1U/EwwCPTKcOyx6/o7dDksSCje7s8gZNd8zM8uHyvL\n\tHKOJEu0O3zx0Es9jv98KG73xFr3OazQ=","v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz;\n\ts=susede2_ed25519; t=1778060118;\n\th=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n\t mime-version:mime-version:content-type:content-type:\n\t in-reply-to:in-reply-to:references:references;\n\tbh=/3jNXVakWdXrmEzJZl0S7Fl91TMBaZIw/pAeShBSRfU=;\n\tb=ALVxJFS1zyEeY2bbR9CsMyPbkCucpas4bT301+rnvmpDzjWuLPkI/6gVcW9okBubrCUS6O\n\t1h8oTzTAZXKszQDw==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_rsa;\n\tt=1778060118;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n\t mime-version:mime-version:content-type:content-type:\n\t in-reply-to:in-reply-to:references:references;\n\tbh=/3jNXVakWdXrmEzJZl0S7Fl91TMBaZIw/pAeShBSRfU=;\n\tb=hK6nSEF6V7SHpd7axWAWAUEtLZaAiu2pf36yQHh9TIzoQhEtXI12JdVvU6gC1bfxO11ewx\n\taG0dQQw18sDhQdLCatmsmO3davEg1U/EwwCPTKcOyx6/o7dDksSCje7s8gZNd8zM8uHyvL\n\tHKOJEu0O3zx0Es9jv98KG73xFr3OazQ=","v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz;\n\ts=susede2_ed25519; t=1778060118;\n\th=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n\t mime-version:mime-version:content-type:content-type:\n\t in-reply-to:in-reply-to:references:references;\n\tbh=/3jNXVakWdXrmEzJZl0S7Fl91TMBaZIw/pAeShBSRfU=;\n\tb=ALVxJFS1zyEeY2bbR9CsMyPbkCucpas4bT301+rnvmpDzjWuLPkI/6gVcW9okBubrCUS6O\n\t1h8oTzTAZXKszQDw=="],"Date":"Wed, 6 May 2026 11:35:17 +0200","From":"Jan Kara <jack@suse.cz>","To":"Baokun Li <libaokun@linux.alibaba.com>","Cc":"linux-ext4@vger.kernel.org, tytso@mit.edu, adilger.kernel@dilger.ca,\n\tjack@suse.cz, yi.zhang@huawei.com, ojaswin@linux.ibm.com,\n\tritesh.list@gmail.com","Subject":"Re: [PATCH] ext4: enable mballoc kunit tests for blocksize >\n PAGE_SIZE","Message-ID":"<xjduwrjb3nlvvfaproth226slnagxhimeln3duhkizbzlh2xpx@zuh56jw5xk3u>","References":"<20260506075900.3649944-1-libaokun@linux.alibaba.com>","Precedence":"bulk","X-Mailing-List":"linux-ext4@vger.kernel.org","List-Id":"<linux-ext4.vger.kernel.org>","List-Subscribe":"<mailto:linux-ext4+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-ext4+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20260506075900.3649944-1-libaokun@linux.alibaba.com>","X-Spam-Level":"","X-Spamd-Result":"default: False [-2.30 / 50.00];\n\tBAYES_HAM(-3.00)[100.00%];\n\tSUSPICIOUS_RECIPS(1.50)[];\n\tNEURAL_HAM_LONG(-1.00)[-1.000];\n\tMID_RHS_NOT_FQDN(0.50)[];\n\tNEURAL_HAM_SHORT(-0.20)[-1.000];\n\tMIME_GOOD(-0.10)[text/plain];\n\tFUZZY_RATELIMITED(0.00)[rspamd.com];\n\tRCVD_VIA_SMTP_AUTH(0.00)[];\n\tARC_NA(0.00)[];\n\tMISSING_XM_UA(0.00)[];\n\tTAGGED_RCPT(0.00)[];\n\tMIME_TRACE(0.00)[0:+];\n\tRCPT_COUNT_SEVEN(0.00)[8];\n\tFREEMAIL_ENVRCPT(0.00)[gmail.com];\n\tTO_DN_SOME(0.00)[];\n\tFROM_HAS_DN(0.00)[];\n\tFREEMAIL_CC(0.00)[vger.kernel.org,mit.edu,dilger.ca,suse.cz,huawei.com,linux.ibm.com,gmail.com];\n\tRCVD_COUNT_THREE(0.00)[3];\n\tFROM_EQ_ENVFROM(0.00)[];\n\tRCVD_TLS_LAST(0.00)[];\n\tTO_MATCH_ENVRCPT_ALL(0.00)[];\n\tDKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519];\n\tDBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.com:email,alibaba.com:email,suse.cz:email]","X-Spam-Score":"-2.30","X-Spam-Status":"No, score=-1.2 required=5.0 tests=ARC_SIGNED,ARC_VALID,\n\tDKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DMARC_MISSING,\n\tHEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,\n\tSPF_PASS autolearn=disabled version=4.0.1","X-Spam-Checker-Version":"SpamAssassin 4.0.1 (2024-03-25) on gandalf.ozlabs.org"}},{"id":3687633,"web_url":"http://patchwork.ozlabs.org/comment/3687633/","msgid":"<65ebc7df-3172-4995-afbc-bb9771b169c1@linux.alibaba.com>","list_archive_url":null,"date":"2026-05-07T08:51:00","subject":"Re: [PATCH] ext4: enable mballoc kunit tests for blocksize >\n PAGE_SIZE","submitter":{"id":92757,"url":"http://patchwork.ozlabs.org/api/people/92757/","name":"Baokun Li","email":"libaokun@linux.alibaba.com"},"content":"Please ignore this patch.\n\nDuring review, Sashiko noticed a potential out-of-bounds write when\nCONFIG_TRANSPARENT_HUGEPAGE is disabled.\n\nThis has been fixed in v2 by adding a CONFIG_TRANSPARENT_HUGEPAGE check:\n\nv2:\nhttps://patch.msgid.link/20260507083754.1646636-1-libaokun@linux.alibaba.com\n\n\nRegards,\nBaokun\n\n在 2026/5/6 15:59, Baokun Li 写道:\n> With Large Block Size (LBS) support, ext4 can now use block sizes larger\n> than PAGE_SIZE. The mballoc kunit tests previously skipped three test\n> cases (test_mb_mark_used, test_mb_free_blocks, test_mb_mark_used_cost)\n> under this configuration because the buddy cache inode's folio mapping\n> order was never initialized in the test harness.\n>\n> The real mount path configures s_min_folio_order and s_max_folio_order\n> in ext4_fill_super(), which allows ext4_set_inode_mapping_order() to\n> set up the correct folio order for the buddy cache inode. The kunit\n> test bypasses ext4_fill_super(), so the mapping order stayed at zero\n> and __filemap_get_folio() allocated order-0 folios too small for LBS.\n>\n> Initialize s_min_folio_order and s_max_folio_order in mbt_init_sb_layout()\n> to mirror ext4_fill_super() behavior, enabling properly sized folio\n> allocations and removing the three blocksize > PAGE_SIZE skips.\n>\n> Signed-off-by: Baokun Li <libaokun@linux.alibaba.com>\n> ---\n>  fs/ext4/mballoc-test.c | 14 ++------------\n>  1 file changed, 2 insertions(+), 12 deletions(-)\n>\n> diff --git a/fs/ext4/mballoc-test.c b/fs/ext4/mballoc-test.c\n> index 90ed505fa4b1..04bc9f773d63 100644\n> --- a/fs/ext4/mballoc-test.c\n> +++ b/fs/ext4/mballoc-test.c\n> @@ -206,6 +206,8 @@ static void mbt_init_sb_layout(struct super_block *sb,\n>  \tsbi->s_desc_per_block_bits =\n>  \t\tsb->s_blocksize_bits - (fls(layout->desc_size) - 1);\n>  \tsbi->s_desc_per_block = 1 << sbi->s_desc_per_block_bits;\n> +\tsbi->s_min_folio_order = get_order(sb->s_blocksize);\n> +\tsbi->s_max_folio_order = sbi->s_min_folio_order;\n>  \n>  \tes->s_first_data_block = cpu_to_le32(0);\n>  \tes->s_blocks_count_lo = cpu_to_le32(layout->blocks_per_group *\n> @@ -791,10 +793,6 @@ static void test_mb_mark_used(struct kunit *test)\n>  \tstruct test_range ranges[TEST_RANGE_COUNT];\n>  \tint i;\n>  \n> -\t/* buddy cache assumes that each page contains at least one block */\n> -\tif (sb->s_blocksize > PAGE_SIZE)\n> -\t\tkunit_skip(test, \"blocksize exceeds pagesize\");\n> -\n>  \tbitmap = kunit_kzalloc(test, sb->s_blocksize, GFP_KERNEL);\n>  \tKUNIT_ASSERT_NOT_ERR_OR_NULL(test, bitmap);\n>  \tbuddy = kunit_kzalloc(test, sb->s_blocksize, GFP_KERNEL);\n> @@ -858,10 +856,6 @@ static void test_mb_free_blocks(struct kunit *test)\n>  \tint i;\n>  \tstruct test_range ranges[TEST_RANGE_COUNT];\n>  \n> -\t/* buddy cache assumes that each page contains at least one block */\n> -\tif (sb->s_blocksize > PAGE_SIZE)\n> -\t\tkunit_skip(test, \"blocksize exceeds pagesize\");\n> -\n>  \tbitmap = kunit_kzalloc(test, sb->s_blocksize, GFP_KERNEL);\n>  \tKUNIT_ASSERT_NOT_ERR_OR_NULL(test, bitmap);\n>  \tbuddy = kunit_kzalloc(test, sb->s_blocksize, GFP_KERNEL);\n> @@ -905,10 +899,6 @@ static void test_mb_mark_used_cost(struct kunit *test)\n>  \tint i, j;\n>  \tunsigned long start, end, all = 0;\n>  \n> -\t/* buddy cache assumes that each page contains at least one block */\n> -\tif (sb->s_blocksize > PAGE_SIZE)\n> -\t\tkunit_skip(test, \"blocksize exceeds pagesize\");\n> -\n>  \tret = ext4_mb_load_buddy_test(sb, TEST_GOAL_GROUP, &e4b);\n>  \tKUNIT_ASSERT_EQ(test, ret, 0);\n>","headers":{"Return-Path":"\n <SRS0=fEe7=DE=vger.kernel.org=linux-ext4+bounces-16335-patchwork-incoming=ozlabs.org@ozlabs.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-ext4@vger.kernel.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","patchwork-incoming@ozlabs.org"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=linux.alibaba.com header.i=@linux.alibaba.com\n header.a=rsa-sha256 header.s=default header.b=Z2PC4KZM;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.org\n (client-ip=2404:9400:2221:ea00::3; helo=mail.ozlabs.org;\n envelope-from=srs0=fee7=de=vger.kernel.org=linux-ext4+bounces-16335-patchwork-incoming=ozlabs.org@ozlabs.org;\n receiver=patchwork.ozlabs.org)","gandalf.ozlabs.org;\n arc=pass smtp.remote-ip=172.234.253.10 arc.chain=subspace.kernel.org","gandalf.ozlabs.org;\n dmarc=pass (p=none dis=none) header.from=linux.alibaba.com","gandalf.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=linux.alibaba.com header.i=@linux.alibaba.com\n header.a=rsa-sha256 header.s=default header.b=Z2PC4KZM;\n\tdkim-atps=neutral","gandalf.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.234.253.10; helo=sea.lore.kernel.org;\n envelope-from=linux-ext4+bounces-16335-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (1024-bit key) header.d=linux.alibaba.com\n header.i=@linux.alibaba.com header.b=\"Z2PC4KZM\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=115.124.30.110","smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=linux.alibaba.com","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=linux.alibaba.com"],"Received":["from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1 raw public key)\n server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4gB5t94F11z1yCg\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 07 May 2026 19:04:49 +1000 (AEST)","from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\tby gandalf.ozlabs.org (Postfix) with ESMTP id 4gB5t93qbqz4wB4\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 07 May 2026 19:04:49 +1000 (AEST)","by gandalf.ozlabs.org (Postfix)\n\tid 4gB5t93VcMz4wBB; Thu, 07 May 2026 19:04:49 +1000 (AEST)","from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby gandalf.ozlabs.org (Postfix) with ESMTPS id 4gB5t44GZJz4wB4\n\tfor <patchwork-incoming@ozlabs.org>; Thu, 07 May 2026 19:04:44 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id C994E303FFB6\n\tfor <patchwork-incoming@ozlabs.org>; Thu,  7 May 2026 08:51:16 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id AA1B039B481;\n\tThu,  7 May 2026 08:51:15 +0000 (UTC)","from out30-110.freemail.mail.aliyun.com\n (out30-110.freemail.mail.aliyun.com [115.124.30.110])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 2FA5E39A7F4\n\tfor <linux-ext4@vger.kernel.org>; Thu,  7 May 2026 08:51:06 +0000 (UTC)","from 30.221.147.97(mailfrom:libaokun@linux.alibaba.com\n fp:SMTPD_---0X2TxetP_1778143860 cluster:ay36)\n          by smtp.aliyun-inc.com;\n          Thu, 07 May 2026 16:51:01 +0800"],"ARC-Seal":["i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1778144689; cv=pass;\n\tb=YujDyjHmzWFn1fo9jNB0ChQ1XHuZ6kjQMKkVzsyNOMjg+2Hdin2hGLFmnmTj9PGBRSchLRq/zib4fidrmF5vh8eKs7q2K2XSMOsk9K/Cm8PQ6ivJKZypjGq52iMnC3nFGbtNJc4DkqOUyO9xFuFBh9cCMVvRLpOxqJfm01wj6hhNMDUUwfFSSeNxVyH3WW1wlHd5KDp7IIjjShEi4gLU7APORLXUYYoYo4+xXyD7z+2yNYnSOQDpLIdtuXRQ7ccBSTfXohiSiSXyCjRflH+7O0W/5Whl+NoyAtxSIFBwPVDzqqlHaotuhdCMfSMXwMnez2+OFZq6G4Rf9m3zxCr0Sg==","i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1778143873; cv=none;\n b=kL9kRMdv0r+Vlv8BAoubR1ZpsLjq6eRxI4jwqeVC7y9UMcoikGG4tu2jV4tdSlecHL8yaKSJ0ekCiueAkRJUfCsF1DhxHIknaSsvhCqJxg291FXpeyUzkhFppRLwJu25udiG3YdlIHUdsNrQUutlp8bNbwFDaHT40lQamjsM720="],"ARC-Message-Signature":["i=2; a=rsa-sha256; d=ozlabs.org; s=201707;\n\tt=1778144689; c=relaxed/relaxed;\n\tbh=I70Fq5k37lefnnORP2ItWeeCvMsO6kgyDskbsVCv5Uo=;\n\th=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:\n\t In-Reply-To:Content-Type;\n b=M9ncMbXtMfezZdcpky7CaMPuG805werEQpVkwEr04MpbUhGXtarVVoCPmnRykAu579CbyhbHCSOBZCJIuPTt8Wgt+VPIhYMRhnewoW9bySZEkIuIFOunFbYGO1lm4EAOCA9zLg8FG7Ac//N3Dkc5An6BadblqbJe/W44c10APkuJ3bFqaoucCEeUXYlyQW7a0AP/OKJzZqouMHVUXO4lZMfmVxSPj66r6ABy3uf/O/77fP+62pYogVTDySiJoOudTQY49k7mYi1qKXNv21bf+TWaPSBHTCqsmrXgdQJeGZcolOP97Qz1tDWDc5K9ZJB8nAfAmIshMyiZy77sB00fnQ==","i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1778143873; c=relaxed/simple;\n\tbh=cAQVoJnAydtUKtF74BY44/TuVaeWsQEy7/X29KzESCA=;\n\th=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:\n\t In-Reply-To:Content-Type;\n b=RkuGDpxXUemJgiyd95FEr87aCe0jk3AKlaFUhEDN876mzbRVsZPEyc2qjyt4+TwMBCD3vQBV6IC7Dm/HFgOWKtO0aA18OUiDkQPPrFEjOAlFnjWkFZZaPusGD4GPJG4924PO/NgICdG9jObFLWHykFbyi36YBkba1v2vXftGSis="],"ARC-Authentication-Results":["i=2; gandalf.ozlabs.org;\n dmarc=pass (p=none dis=none) header.from=linux.alibaba.com;\n dkim=pass (1024-bit key;\n unprotected) header.d=linux.alibaba.com header.i=@linux.alibaba.com\n header.a=rsa-sha256 header.s=default header.b=Z2PC4KZM; dkim-atps=neutral;\n spf=pass (client-ip=172.234.253.10; helo=sea.lore.kernel.org;\n envelope-from=linux-ext4+bounces-16335-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org) smtp.mailfrom=vger.kernel.org","i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=linux.alibaba.com;\n spf=pass smtp.mailfrom=linux.alibaba.com;\n dkim=pass (1024-bit key) header.d=linux.alibaba.com\n header.i=@linux.alibaba.com header.b=Z2PC4KZM;\n arc=none smtp.client-ip=115.124.30.110"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=linux.alibaba.com; s=default;\n\tt=1778143862; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type;\n\tbh=I70Fq5k37lefnnORP2ItWeeCvMsO6kgyDskbsVCv5Uo=;\n\tb=Z2PC4KZM1SVhTnRNYc7BSV4ZWYcPoc5g+vTyzM35lPXPZFBh3ATc4CU3smSgbXihv8Czflo6Y2wvBemWc8awrzUK+IA1d+YW0y0ErWKkr9/WP5xjDjbsawl6Lc2CUj2dyV9UR3FZkb0e9pK2LUut7QNei83Pts+3IRq+tMF3hxA=","X-Alimail-AntiSpam":"\n AC=PASS;BC=-1|-1;BR=01201311R201e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033037033178;MF=libaokun@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0X2TxetP_1778143860;","Message-ID":"<65ebc7df-3172-4995-afbc-bb9771b169c1@linux.alibaba.com>","Date":"Thu, 7 May 2026 16:51:00 +0800","Precedence":"bulk","X-Mailing-List":"linux-ext4@vger.kernel.org","List-Id":"<linux-ext4.vger.kernel.org>","List-Subscribe":"<mailto:linux-ext4+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-ext4+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH] ext4: enable mballoc kunit tests for blocksize >\n PAGE_SIZE","To":"linux-ext4@vger.kernel.org","Cc":"tytso@mit.edu, adilger.kernel@dilger.ca, jack@suse.cz,\n yi.zhang@huawei.com, ojaswin@linux.ibm.com, ritesh.list@gmail.com","References":"<20260506075900.3649944-1-libaokun@linux.alibaba.com>","From":"Baokun Li <libaokun@linux.alibaba.com>","In-Reply-To":"<20260506075900.3649944-1-libaokun@linux.alibaba.com>","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","X-Spam-Status":"No, score=-8.7 required=5.0 tests=ARC_SIGNED,ARC_VALID,\n\tDKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DMARC_PASS,\n\tHEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,\n\tSPF_PASS,UNPARSEABLE_RELAY,USER_IN_DEF_DKIM_WL autolearn=disabled\n\tversion=4.0.1","X-Spam-Checker-Version":"SpamAssassin 4.0.1 (2024-03-25) on gandalf.ozlabs.org"}}]