linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@redhat.com>
To: Anton Suvorov <warwish@yandex-team.ru>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	dmtrmonakhov@yandex-team.ru, linux-block@vger.kernel.org,
	viro@zeniv.linux.org.uk
Subject: Re: [PATCH 04/10] dm: reduce stack footprint dealing with block device names
Date: Wed, 23 Jun 2021 16:20:52 -0400	[thread overview]
Message-ID: <YNOXpHyBAD+C3Utt@redhat.com> (raw)
In-Reply-To: <20210602152903.910190-5-warwish@yandex-team.ru>

On Wed, Jun 02 2021 at 11:28P -0400,
Anton Suvorov <warwish@yandex-team.ru> wrote:

> Stack usage reduced (measured with allyesconfig):
> 
> ./drivers/md/dm-cache-target.c	cache_ctr	392	328	-64
> ./drivers/md/dm-cache-target.c	cache_io_hints	208	72	-136
> ./drivers/md/dm-clone-target.c	clone_ctr	416	352	-64
> ./drivers/md/dm-clone-target.c	clone_io_hints	216	80	-136
> ./drivers/md/dm-crypt.c	crypt_convert_block_aead	408	272	-136
> ./drivers/md/dm-crypt.c	kcryptd_async_done	192	56	-136
> ./drivers/md/dm-integrity.c	integrity_metadata	872	808	-64
> ./drivers/md/dm-mpath.c	parse_priority_group	368	304	-64
> ./drivers/md/dm-table.c	device_area_is_invalid	216	80	-136
> ./drivers/md/dm-table.c	dm_set_device_limits	200	72	-128
> ./drivers/md/dm-thin.c	pool_io_hints	216	80	-136
> 
> Signed-off-by: Anton Suvorov <warwish@yandex-team.ru>
> ---
>  drivers/md/dm-cache-target.c | 10 ++++------
>  drivers/md/dm-clone-target.c | 10 ++++------
>  drivers/md/dm-crypt.c        |  6 ++----
>  drivers/md/dm-integrity.c    |  4 ++--
>  drivers/md/dm-mpath.c        |  6 ++----
>  drivers/md/dm-table.c        | 34 ++++++++++++++++------------------
>  drivers/md/dm-thin.c         |  8 +++-----
>  7 files changed, 33 insertions(+), 45 deletions(-)
> 

<snip>

> diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c
> index 20f2510db1f6..d2fec41635ff 100644
> --- a/drivers/md/dm-integrity.c
> +++ b/drivers/md/dm-integrity.c
> @@ -1781,8 +1781,8 @@ static void integrity_metadata(struct work_struct *w)
>  						checksums_ptr - checksums, dio->op == REQ_OP_READ ? TAG_CMP : TAG_WRITE);
>  			if (unlikely(r)) {
>  				if (r > 0) {
> -					char b[BDEVNAME_SIZE];
> -					DMERR_LIMIT("%s: Checksum failed at sector 0x%llx", bio_devname(bio, b),
> +					DMERR_LIMIT("%pg: Checksum failed at sector 0x%llx",
> +						    bio->bi_bdev,
>  						    (sector - ((r + ic->tag_size - 1) / ic->tag_size)));
>  					r = -EILSEQ;
>  					atomic64_inc(&ic->number_of_mismatches);
> diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
> index bced42f082b0..678e5bb0fa5a 100644
> --- a/drivers/md/dm-mpath.c
> +++ b/drivers/md/dm-mpath.c
> @@ -900,10 +900,8 @@ static int setup_scsi_dh(struct block_device *bdev, struct multipath *m,
>  	if (m->hw_handler_name) {
>  		r = scsi_dh_attach(q, m->hw_handler_name);
>  		if (r == -EBUSY) {
> -			char b[BDEVNAME_SIZE];
> -
> -			printk(KERN_INFO "dm-mpath: retaining handler on device %s\n",
> -			       bdevname(bdev, b));
> +			pr_info("dm-mpath: retaining handler on device %pg\n",
> +				bdev);
>  			goto retain;
>  		}
>  		if (r < 0) {

Would appreciate it if you just left the arguments on the same line,
for this dm-mpath.c change and the dm-integrity.c change, don't worry
about 80 column.

Also, would prefer you use DMINFO() instead of pr_info().  DMINFO()
achieves the same but will add "device-mapper: multipath: " prefix for
you, also you then don't need to add the newline. So use:

     DMINFO("retaining handler on device %pg", bdev);


> diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
> index 7e88e5e06922..175b9c7b1c48 100644
> --- a/drivers/md/dm-table.c
> +++ b/drivers/md/dm-table.c
> @@ -282,20 +281,20 @@ static int device_area_is_invalid(struct dm_target *ti, struct dm_dev *dev,
>  		return 0;
>  
>  	if (start & (logical_block_size_sectors - 1)) {
> -		DMWARN("%s: start=%llu not aligned to h/w "
> -		       "logical block size %u of %s",
> +		DMWARN("%s: start=%llu not aligned to h/w logical block size %u of %pg",
>  		       dm_device_name(ti->table->md),
>  		       (unsigned long long)start,
> -		       limits->logical_block_size, bdevname(bdev, b));
> +		       limits->logical_block_size,
> +		       bdev);
>  		return 1;
>  	}
>  
>  	if (len & (logical_block_size_sectors - 1)) {
> -		DMWARN("%s: len=%llu not aligned to h/w "
> -		       "logical block size %u of %s",
> +		DMWARN("%s: len=%llu not aligned to h/w logical block size %u of %pg",
>  		       dm_device_name(ti->table->md),
>  		       (unsigned long long)len,
> -		       limits->logical_block_size, bdevname(bdev, b));
> +		       limits->logical_block_size,
> +		       bdev);
>  		return 1;
>  	}
>  

Again, please just leave 'bdev' on the previous lines.

If you make those few tweaks, please add:

Acked-by: Mike Snitzer <snitzer@redhat.com>

  reply	other threads:[~2021-06-23 20:20 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-02 15:28 [PATCH 00/10] reduce stack footprint printing bdev names Anton Suvorov
2021-06-02 15:28 ` [PATCH 01/10] drbd: reduce stack footprint in drbd_report_io_error() Anton Suvorov
2021-06-02 15:28 ` [PATCH 02/10] dax: reduce stack footprint dealing with block device names Anton Suvorov
2021-06-02 17:18   ` Matthew Wilcox
2021-06-22 17:44     ` [PATCH v2 00/10] reduce stack footprint printing bdev names Anton Suvorov
2021-06-22 17:44       ` [PATCH v2 01/10] drbd: reduce stack footprint in drbd_report_io_error() Anton Suvorov
2021-06-22 17:44       ` [PATCH v2 02/10] dax: reduce stack footprint dealing with block device names Anton Suvorov
2021-06-22 17:44       ` [PATCH v2 03/10] raid-md: " Anton Suvorov
2021-06-23  8:26         ` Guoqing Jiang
2021-06-22 17:44       ` [PATCH v2 04/10] dm: " Anton Suvorov
2021-06-22 17:44       ` [PATCH v2 05/10] block: " Anton Suvorov
2021-06-23  7:45         ` Christoph Hellwig
2021-06-22 17:44       ` [PATCH v2 06/10] target: reduce stack footprint in iblock_show_configfs_dev_params() Anton Suvorov
2021-06-22 17:44       ` [PATCH v2 07/10] vfs: reduce stack footprint in __blkdev_put() Anton Suvorov
2021-06-22 17:44       ` [PATCH v2 08/10] ext4: reduce stack footprint in ext4_end_bio() Anton Suvorov
2021-06-22 17:44       ` [PATCH v2 09/10] security: reduce stack footprint in loadpin_read_file() Anton Suvorov
2021-06-22 17:45     ` [PATCH v2 10/10] block: remove unused symbol bio_devname() Anton Suvorov
2021-06-02 15:28 ` [PATCH 03/10] raid-md: reduce stack footprint dealing with block device names Anton Suvorov
2021-06-02 15:28 ` [PATCH 04/10] dm: " Anton Suvorov
2021-06-23 20:20   ` Mike Snitzer [this message]
2021-06-02 15:28 ` [PATCH 05/10] block: " Anton Suvorov
2021-06-02 15:28 ` [PATCH 06/10] target: reduce stack footprint in iblock_show_configfs_dev_params() Anton Suvorov
2021-06-02 15:29 ` [PATCH 07/10] vfs: reduce stack footprint in __blkdev_put() Anton Suvorov
2021-06-02 15:29 ` [PATCH 08/10] ext4: reduce stack footprint in ext4_end_bio() Anton Suvorov
2021-06-02 15:29 ` [PATCH 09/10] security: reduce stack footprint in loadpin_read_file() Anton Suvorov
2021-06-02 15:29 ` [PATCH 10/10] block: remove unused symbol bio_devname() Anton Suvorov

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=YNOXpHyBAD+C3Utt@redhat.com \
    --to=snitzer@redhat.com \
    --cc=dmtrmonakhov@yandex-team.ru \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=warwish@yandex-team.ru \
    /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;
as well as URLs for NNTP newsgroup(s).