mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Menzel <pmenzel@molgen.mpg.de>
To: Yu Kuai <yukuai1@huaweicloud.com>
Cc: mariusz.tkaczyk@linux.intel.com, xni@redhat.com, song@kernel.org,
	linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org,
	yukuai3@huawei.com, yi.zhang@huawei.com, yangerkun@huawei.com
Subject: Re: [PATCH md-6.12 v2 29/42] md/md-bitmap: mrege md_bitmap_cond_end_sync() into bitmap_operations
Date: Mon, 26 Aug 2024 10:09:53 +0200	[thread overview]
Message-ID: <dedf0d3b-bc45-4d04-a987-9df498f51661@molgen.mpg.de> (raw)
In-Reply-To: <20240826074452.1490072-30-yukuai1@huaweicloud.com>

Dear Kuai,


Thank you for your patch. (I am still confused, what your given and 
surname is.)

Am 26.08.24 um 09:44 schrieb Yu Kuai:
> From: Yu Kuai <yukuai3@huawei.com>

There is a typo in the summary: mrege → merge.

> So that the implementation won't be exposed, and it'll be possible
> to invent a new bitmap by replacing bitmap_operations.
> 
> Also change the parameter from bitmap to mddev, to avoid access
> bitmap outside md-bitmap.c as much as possible.
> 
> Signed-off-by: Yu Kuai <yukuai3@huawei.com>
> ---
>   drivers/md/md-bitmap.c | 6 ++++--
>   drivers/md/md-bitmap.h | 2 +-
>   drivers/md/raid1.c     | 6 +++---
>   drivers/md/raid10.c    | 2 +-
>   drivers/md/raid5.c     | 2 +-
>   5 files changed, 10 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/md/md-bitmap.c b/drivers/md/md-bitmap.c
> index e1dceff2d9a5..2d9d9689f721 100644
> --- a/drivers/md/md-bitmap.c
> +++ b/drivers/md/md-bitmap.c
> @@ -1690,10 +1690,12 @@ static void bitmap_close_sync(struct mddev *mddev)
>   	}
>   }
>   
> -void md_bitmap_cond_end_sync(struct bitmap *bitmap, sector_t sector, bool force)
> +static void bitmap_cond_end_sync(struct mddev *mddev, sector_t sector,
> +				 bool force)
>   {
>   	sector_t s = 0;
>   	sector_t blocks;
> +	struct bitmap *bitmap = mddev->bitmap;
>   
>   	if (!bitmap)
>   		return;
> @@ -1718,7 +1720,6 @@ void md_bitmap_cond_end_sync(struct bitmap *bitmap, sector_t sector, bool force)
>   	bitmap->last_end_sync = jiffies;
>   	sysfs_notify_dirent_safe(bitmap->mddev->sysfs_completed);
>   }
> -EXPORT_SYMBOL(md_bitmap_cond_end_sync);
>   
>   void md_bitmap_sync_with_cluster(struct mddev *mddev,
>   			      sector_t old_lo, sector_t old_hi,
> @@ -2747,6 +2748,7 @@ static struct bitmap_operations bitmap_ops = {
>   	.endwrite		= bitmap_endwrite,
>   	.start_sync		= bitmap_start_sync,
>   	.end_sync		= bitmap_end_sync,
> +	.cond_end_sync		= bitmap_cond_end_sync,
>   	.close_sync		= bitmap_close_sync,
>   
>   	.update_sb		= bitmap_update_sb,
> diff --git a/drivers/md/md-bitmap.h b/drivers/md/md-bitmap.h
> index 5d919b530317..027de097f96a 100644
> --- a/drivers/md/md-bitmap.h
> +++ b/drivers/md/md-bitmap.h
> @@ -262,6 +262,7 @@ struct bitmap_operations {
>   	bool (*start_sync)(struct mddev *mddev, sector_t offset,
>   			   sector_t *blocks, bool degraded);
>   	void (*end_sync)(struct mddev *mddev, sector_t offset, sector_t *blocks);
> +	void (*cond_end_sync)(struct mddev *mddev, sector_t sector, bool force);
>   	void (*close_sync)(struct mddev *mddev);
>   
>   	void (*update_sb)(struct bitmap *bitmap);
> @@ -272,7 +273,6 @@ struct bitmap_operations {
>   void mddev_set_bitmap_ops(struct mddev *mddev);
>   
>   /* these are exported */
> -void md_bitmap_cond_end_sync(struct bitmap *bitmap, sector_t sector, bool force);
>   void md_bitmap_sync_with_cluster(struct mddev *mddev,
>   				 sector_t old_lo, sector_t old_hi,
>   				 sector_t new_lo, sector_t new_hi);
> diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
> index 52ca5619d9b4..00174cacb1f4 100644
> --- a/drivers/md/raid1.c
> +++ b/drivers/md/raid1.c
> @@ -2828,9 +2828,9 @@ static sector_t raid1_sync_request(struct mddev *mddev, sector_t sector_nr,
>   	 * sector_nr + two times RESYNC_SECTORS
>   	 */
>   
> -	md_bitmap_cond_end_sync(mddev->bitmap, sector_nr,
> -		mddev_is_clustered(mddev) && (sector_nr + 2 * RESYNC_SECTORS > conf->cluster_sync_high));
> -
> +	mddev->bitmap_ops->cond_end_sync(mddev, sector_nr,
> +		mddev_is_clustered(mddev) &&
> +		(sector_nr + 2 * RESYNC_SECTORS > conf->cluster_sync_high));
>   
>   	if (raise_barrier(conf, sector_nr))
>   		return 0;
> diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
> index 5b1c86c368b1..5a7b19f48c45 100644
> --- a/drivers/md/raid10.c
> +++ b/drivers/md/raid10.c
> @@ -3543,7 +3543,7 @@ static sector_t raid10_sync_request(struct mddev *mddev, sector_t sector_nr,
>   		 * safety reason, which ensures curr_resync_completed is
>   		 * updated in bitmap_cond_end_sync.
>   		 */
> -		md_bitmap_cond_end_sync(mddev->bitmap, sector_nr,
> +		mddev->bitmap_ops->cond_end_sync(mddev, sector_nr,
>   					mddev_is_clustered(mddev) &&
>   					(sector_nr + 2 * RESYNC_SECTORS > conf->cluster_sync_high));
>   
> diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
> index d2b8d2517abf..87b8d19ab601 100644
> --- a/drivers/md/raid5.c
> +++ b/drivers/md/raid5.c
> @@ -6540,7 +6540,7 @@ static inline sector_t raid5_sync_request(struct mddev *mddev, sector_t sector_n
>   		return sync_blocks * RAID5_STRIPE_SECTORS(conf);
>   	}
>   
> -	md_bitmap_cond_end_sync(mddev->bitmap, sector_nr, false);
> +	mddev->bitmap_ops->cond_end_sync(mddev, sector_nr, false);
>   
>   	sh = raid5_get_active_stripe(conf, NULL, sector_nr,
>   				     R5_GAS_NOBLOCK);

The diff looks good to me.


Kind regards,

Paul

  reply	other threads:[~2024-08-26  8:10 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-26  7:44 [PATCH md-6.12 v2 00/42] md/md-bitmap: introduce bitmap_operations and make structure internal Yu Kuai
2024-08-26  7:44 ` [PATCH md-6.12 v2 01/42] md/raid1: use md_bitmap_wait_behind_writes() in raid1_read_request() Yu Kuai
2024-08-26  7:44 ` [PATCH md-6.12 v2 02/42] md/md-bitmap: replace md_bitmap_status() with a new helper md_bitmap_get_stats() Yu Kuai
2024-08-26  7:44 ` [PATCH md-6.12 v2 03/42] md: use new helper md_bitmap_get_stats() in update_array_info() Yu Kuai
2024-08-26  7:44 ` [PATCH md-6.12 v2 04/42] md/md-bitmap: add 'events_cleared' into struct md_bitmap_stats Yu Kuai
2024-08-26  7:44 ` [PATCH md-6.12 v2 05/42] md/md-cluster: fix spares warnings for __le64 Yu Kuai
2024-08-26  7:44 ` [PATCH md-6.12 v2 06/42] md/md-bitmap: add 'sync_size' into struct md_bitmap_stats Yu Kuai
2024-08-26  7:44 ` [PATCH md-6.12 v2 07/42] md/md-bitmap: add 'file_pages' " Yu Kuai
2024-08-26  7:44 ` [PATCH md-6.12 v2 08/42] md/md-bitmap: add 'behind_writes' and 'behind_wait' " Yu Kuai
2024-08-26  7:44 ` [PATCH md-6.12 v2 09/42] md/md-cluster: use helper md_bitmap_get_stats() to get pages in resize_bitmaps() Yu Kuai
2024-08-26  7:44 ` [PATCH md-6.12 v2 10/42] md/md-bitmap: add a new helper md_bitmap_set_pages() Yu Kuai
2024-08-26  7:44 ` [PATCH md-6.12 v2 11/42] md/md-bitmap: introduce struct bitmap_operations Yu Kuai
2024-08-26  7:44 ` [PATCH md-6.12 v2 12/42] md/md-bitmap: simplify md_bitmap_create() + md_bitmap_load() Yu Kuai
2024-08-26  7:44 ` [PATCH md-6.12 v2 13/42] md/md-bitmap: merge md_bitmap_create() into bitmap_operations Yu Kuai
2024-08-26  7:44 ` [PATCH md-6.12 v2 14/42] md/md-bitmap: merge md_bitmap_load() " Yu Kuai
2024-08-26  7:44 ` [PATCH md-6.12 v2 15/42] md/md-bitmap: merge md_bitmap_destroy() " Yu Kuai
2024-08-26  7:44 ` [PATCH md-6.12 v2 16/42] md/md-bitmap: merge md_bitmap_flush() " Yu Kuai
2024-08-26  7:44 ` [PATCH md-6.12 v2 17/42] md/md-bitmap: make md_bitmap_print_sb() internal Yu Kuai
2024-08-26  7:44 ` [PATCH md-6.12 v2 18/42] md/md-bitmap: merge md_bitmap_update_sb() into bitmap_operations Yu Kuai
2024-08-26  7:44 ` [PATCH md-6.12 v2 19/42] md/md-bitmap: merge md_bitmap_status() " Yu Kuai
2024-08-26  7:44 ` [PATCH md-6.12 v2 20/42] md/md-bitmap: remove md_bitmap_setallbits() Yu Kuai
2024-08-26  7:44 ` [PATCH md-6.12 v2 21/42] md/md-bitmap: merge bitmap_write_all() into bitmap_operations Yu Kuai
2024-08-26  7:44 ` [PATCH md-6.12 v2 22/42] md/md-bitmap: merge md_bitmap_dirty_bits() " Yu Kuai
2024-08-26  7:44 ` [PATCH md-6.12 v2 23/42] md/md-bitmap: merge md_bitmap_startwrite() " Yu Kuai
2024-08-26  7:44 ` [PATCH md-6.12 v2 24/42] md/md-bitmap: merge md_bitmap_endwrite() " Yu Kuai
2024-08-26  7:44 ` [PATCH md-6.12 v2 25/42] md/md-bitmap: merge md_bitmap_start_sync() " Yu Kuai
2024-08-26  7:44 ` [PATCH md-6.12 v2 26/42] md/md-bitmap: remove the parameter 'aborted' for md_bitmap_end_sync() Yu Kuai
2024-08-26  7:44 ` [PATCH md-6.12 v2 27/42] md/md-bitmap: merge md_bitmap_end_sync() into bitmap_operations Yu Kuai
2024-08-26  7:44 ` [PATCH md-6.12 v2 28/42] md/md-bitmap: merge md_bitmap_close_sync() " Yu Kuai
2024-08-26  7:44 ` [PATCH md-6.12 v2 29/42] md/md-bitmap: mrege md_bitmap_cond_end_sync() " Yu Kuai
2024-08-26  8:09   ` Paul Menzel [this message]
2024-08-26  8:27     ` Yu Kuai
2024-08-26  7:44 ` [PATCH md-6.12 v2 30/42] md/md-bitmap: merge md_bitmap_sync_with_cluster() " Yu Kuai
2024-08-26  7:44 ` [PATCH md-6.12 v2 31/42] md/md-bitmap: merge md_bitmap_unplug_async() into md_bitmap_unplug() Yu Kuai
2024-08-26  7:44 ` [PATCH md-6.12 v2 32/42] md/md-bitmap: merge bitmap_unplug() into bitmap_operations Yu Kuai
2024-08-26  7:44 ` [PATCH md-6.12 v2 33/42] md/md-bitmap: merge md_bitmap_daemon_work() " Yu Kuai
2024-08-26  7:44 ` [PATCH md-6.12 v2 34/42] md/md-bitmap: pass in mddev directly for md_bitmap_resize() Yu Kuai
2024-08-26  7:44 ` [PATCH md-6.12 v2 35/42] md/md-bitmap: merge md_bitmap_resize() into bitmap_operations Yu Kuai
2024-08-26  7:44 ` [PATCH md-6.12 v2 36/42] md/md-bitmap: merge get_bitmap_from_slot() " Yu Kuai
2024-08-26  7:44 ` [PATCH md-6.12 v2 37/42] md/md-bitmap: merge md_bitmap_copy_from_slot() into struct bitmap_operation Yu Kuai
2024-08-26  7:44 ` [PATCH md-6.12 v2 38/42] md/md-bitmap: merge md_bitmap_set_pages() into struct bitmap_operations Yu Kuai
2024-08-26  7:44 ` [PATCH md-6.12 v2 39/42] md/md-bitmap: merge md_bitmap_free() into bitmap_operations Yu Kuai
2024-08-26  7:44 ` [PATCH md-6.12 v2 40/42] md/md-bitmap: merge md_bitmap_wait_behind_writes() " Yu Kuai
2024-08-26  7:44 ` [PATCH md-6.12 v2 41/42] md/md-bitmap: merge md_bitmap_enabled() " Yu Kuai
2024-08-26  7:44 ` [PATCH md-6.12 v2 42/42] md/md-bitmap: make in memory structure internal Yu Kuai
2024-08-26  8:12   ` Paul Menzel
2024-08-26  8:26     ` Yu Kuai
2024-08-27 20:32 ` [PATCH md-6.12 v2 00/42] md/md-bitmap: introduce bitmap_operations and make " Song Liu
2024-08-28  1:15   ` Yu Kuai
2024-08-28  1:31     ` Xiao Ni
2024-08-28  9:13       ` Yu Kuai
2024-08-28 23:50     ` Song Liu
2024-08-29  1:12       ` Yu Kuai

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=dedf0d3b-bc45-4d04-a987-9df498f51661@molgen.mpg.de \
    --to=pmenzel@molgen.mpg.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=mariusz.tkaczyk@linux.intel.com \
    --cc=song@kernel.org \
    --cc=xni@redhat.com \
    --cc=yangerkun@huawei.com \
    --cc=yi.zhang@huawei.com \
    --cc=yukuai1@huaweicloud.com \
    --cc=yukuai3@huawei.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®