All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
To: Kemeng Shi <shikemeng@huaweicloud.com>,
	tytso@mit.edu, adilger.kernel@dilger.ca,
	linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 11/11] ext4: run mballoc test with different layouts setting
Date: Fri, 01 Sep 2023 20:06:22 +0530	[thread overview]
Message-ID: <87msy6kljt.fsf@doe.com> (raw)
In-Reply-To: <20230826155028.4019470-12-shikemeng@huaweicloud.com>

Kemeng Shi <shikemeng@huaweicloud.com> writes:

> Use KUNIT_CASE_PARAM to run mbalaloc test with different layouts setting.
                              ^^^ mballoc
small nit below
  
>
> Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
> ---
>  fs/ext4/mballoc-test.c | 52 ++++++++++++++++++++++++++++++------------
>  1 file changed, 38 insertions(+), 14 deletions(-)
>
> diff --git a/fs/ext4/mballoc-test.c b/fs/ext4/mballoc-test.c
> index d643c56ac003..af48a39c8ba2 100644
> --- a/fs/ext4/mballoc-test.c
> +++ b/fs/ext4/mballoc-test.c
> @@ -196,21 +196,11 @@ static int ext4_mb_mark_context_stub(struct ext4_mark_context *mc,
>  	return 0;
>  }
>  
> -#define TEST_BLOCKSIZE_BITS 10
> -#define TEST_CLUSTER_BITS 3
> -#define TEST_BLOCKS_PER_GROUP 8192
> -#define TEST_GROUP_COUNT 4
> -#define TEST_DESC_SIZE 64
>  #define TEST_GOAL_GROUP 1
>  static int mbt_kunit_init(struct kunit *test)
>  {
> -	struct mbt_ext4_block_layout layout = {
> -		.blocksize_bits = TEST_BLOCKSIZE_BITS,
> -		.cluster_bits = TEST_CLUSTER_BITS,
> -		.blocks_per_group = TEST_BLOCKS_PER_GROUP,
> -		.group_count = TEST_GROUP_COUNT,
> -		.desc_size = TEST_DESC_SIZE,
> -	};
> +	struct mbt_ext4_block_layout *layout =
> +		(struct mbt_ext4_block_layout *)(test->param_value);
>  	struct super_block *sb;
>  	int ret;
>  
> @@ -218,7 +208,7 @@ static int mbt_kunit_init(struct kunit *test)
>  	if (sb == NULL)
>  		return -ENOMEM;
>  
> -	mbt_init_sb_layout(sb, &layout);
> +	mbt_init_sb_layout(sb, layout);
>  
>  	ret = mbt_ctx_init(sb);
>  	if (ret != 0) {
> @@ -304,9 +294,43 @@ static void test_new_blocks_simple(struct kunit *test)
>  		"unexpectedly get block when no block is available");
>  }
>  
> +static const struct mbt_ext4_block_layout mbt_test_layouts[] = {
> +	{
> +		.blocksize_bits = 10,
> +		.cluster_bits = 3,
> +		.blocks_per_group = 8192,
> +		.group_count = 4,
> +		.desc_size = 64,
> +	},
> +	{
> +		.blocksize_bits = 12,
> +		.cluster_bits = 3,
> +		.blocks_per_group = 8192,
> +		.group_count = 4,
> +		.desc_size = 64,
> +	},
> +	{
> +		.blocksize_bits = 18,

64k blocksize is more common due to platforms with 64k pagesize like
Power and sometimes arm64. I would rather make it 16 here.

I tested it on Power - 

[    2.546687][    T1] KTAP version 1
[    2.547123][    T1] 1..2
[    2.547447][    T1]     KTAP version 1
[    2.547927][    T1]     # Subtest: ext4_mballoc_test
[    2.548562][    T1]     1..1
[    2.548933][    T1]         KTAP version 1
[    2.549457][    T1]         # Subtest: test_new_blocks_simple
[    2.549550][  T108] kunit_try_catch (108) used greatest stack depth: 14512 bytes left
[    2.549644][    T1]         ok 1 block_bits=10 cluster_bits=3 blocks_per_group=8192 group_count=4 desc_size=64
[    2.552780][  T110] kunit_try_catch (110) used greatest stack depth: 14464 bytes left
[    2.552882][    T1]         ok 2 block_bits=12 cluster_bits=3 blocks_per_group=8192 group_count=4 desc_size=64
[    2.555909][    T1]         ok 3 block_bits=18 cluster_bits=3 blocks_per_group=8192 group_count=4 desc_size=64
[    2.557184][    T1]     # test_new_blocks_simple: pass:3 fail:0 skip:0 total:3
[    2.557186][    T1]     ok 1 test_new_blocks_simple
[    2.558083][    T1] # Totals: pass:3 fail:0 skip:0 total:3
[    2.558688][    T1] ok 1 ext4_mballoc_test

Looks good to me. Feel free to add -

Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>

  reply	other threads:[~2023-09-01 14:36 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-26 15:50 [PATCH v6 00/11] cleanups and unit test for mballoc Kemeng Shi
2023-08-26 15:50 ` [PATCH v6 01/11] ext4: factor out codes to update block bitmap and group descriptor on disk from ext4_mb_mark_bb Kemeng Shi
2023-08-31 12:33   ` Ritesh Harjani
2023-08-31 13:42     ` Kemeng Shi
2023-08-31 14:07       ` Ritesh Harjani
2023-09-04  2:50         ` Kemeng Shi
2023-09-04  8:30           ` Ritesh Harjani
2023-08-26 15:50 ` [PATCH v6 02/11] ext4: call ext4_mb_mark_context in ext4_free_blocks_simple Kemeng Shi
2023-08-31 14:25   ` Ritesh Harjani
2023-09-04  2:51     ` Kemeng Shi
2023-08-26 15:50 ` [PATCH v6 03/11] ext4: extent ext4_mb_mark_context to support allocation under journal Kemeng Shi
2023-08-31 15:51   ` Ritesh Harjani
2023-08-26 15:50 ` [PATCH v6 04/11] ext4: call ext4_mb_mark_context in ext4_mb_mark_diskspace_used Kemeng Shi
2023-09-01  3:51   ` Ritesh Harjani
2023-09-04  2:54     ` Kemeng Shi
2023-08-26 15:50 ` [PATCH v6 05/11] ext4: Separate block bitmap and buddy bitmap freeing in ext4_mb_clear_bb() Kemeng Shi
2023-09-01  9:34   ` Ritesh Harjani
2023-09-04  3:00     ` Kemeng Shi
2023-09-12  7:02       ` Kemeng Shi
2023-09-12 10:13         ` Ritesh Harjani
2023-09-12 11:32           ` Kemeng Shi
2023-08-26 15:50 ` [PATCH v6 06/11] ext4: call ext4_mb_mark_context in ext4_mb_clear_bb Kemeng Shi
2023-09-01  9:38   ` Ritesh Harjani
2023-08-26 15:50 ` [PATCH v6 07/11] ext4: Separate block bitmap and buddy bitmap freeing in ext4_group_add_blocks() Kemeng Shi
2023-08-26 15:50 ` [PATCH v6 08/11] ext4: call ext4_mb_mark_context " Kemeng Shi
2023-09-01  9:50   ` Ritesh Harjani
2023-08-26 15:50 ` [PATCH v6 09/11] ext4: add some kunit stub for mballoc kunit test Kemeng Shi
2023-09-01 14:18   ` Ritesh Harjani
2023-08-26 15:50 ` [PATCH v6 10/11] ext4: add first unit test for ext4_mb_new_blocks_simple in mballoc Kemeng Shi
2023-09-01 14:29   ` Ritesh Harjani
2023-08-26 15:50 ` [PATCH v6 11/11] ext4: run mballoc test with different layouts setting Kemeng Shi
2023-09-01 14:36   ` Ritesh Harjani [this message]
2023-09-04  3:01     ` Kemeng Shi
2023-08-29 19:02 ` [PATCH v6 00/11] cleanups and unit test for mballoc Ritesh Harjani
2023-08-30  7:22   ` Kemeng Shi
2023-08-31 14:35     ` Ritesh Harjani

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87msy6kljt.fsf@doe.com \
    --to=ritesh.list@gmail.com \
    --cc=adilger.kernel@dilger.ca \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shikemeng@huaweicloud.com \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.