All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <Bart.VanAssche@sandisk.com>
To: "dan.j.williams@intel.com" <dan.j.williams@intel.com>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"hch@lst.de" <hch@lst.de>, "axboe@kernel.dk" <axboe@kernel.dk>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"osandov@osandov.com" <osandov@osandov.com>,
	"James.Bottomley@hansenpartnership.com"
	<James.Bottomley@hansenpartnership.com>,
	"jack@suse.cz" <jack@suse.cz>
Subject: Re: [PATCH v2] scsi, block: fix duplicate bdi name registration crashes
Date: Wed, 1 Feb 2017 20:35:20 +0000	[thread overview]
Message-ID: <1485981306.2560.11.camel@sandisk.com> (raw)
In-Reply-To: <148597749824.11392.9598040130844203664.stgit@dwillia2-desk3.amr.corp.intel.com>

On Wed, 2017-02-01 at 11:32 -0800, Dan Williams wrote:
> diff --git a/include/linux/genhd.h b/include/linux/genhd.h
> index 76f39754e7b0..27e7e12c0c2d 100644
> --- a/include/linux/genhd.h
> +++ b/include/linux/genhd.h
> @@ -167,6 +167,22 @@ struct blk_integrity {
>  };
> =20
>  #endif	/* CONFIG_BLK_DEV_INTEGRITY */
> +struct disk_devt {
> +	atomic_t count;
> +	void (*release)(struct disk_devt *disk_devt);
> +};
> +
> +static inline void put_disk_devt(struct disk_devt *disk_devt)
> +{
> +	if (disk_devt && atomic_dec_and_test(&disk_devt->count))
> +		disk_devt->release(disk_devt);
> +}
> +
> +static inline void get_disk_devt(struct disk_devt *disk_devt)
> +{
> +	if (disk_devt)
> +		atomic_inc(&disk_devt->count);
> +}

The <linux/genhd.h> header file is included directly or indirectly in a
huge number of source files. Since neither get_disk_devt() nor
put_disk_devt() are called from the I/O path, please move these functions
from=A0<linux/genhd.h> into block/genhd.c to keep the compilation time of
the kernel as short as possible.

Thanks,

Bart.=

WARNING: multiple messages have this Message-ID (diff)
From: Bart Van Assche <Bart.VanAssche@sandisk.com>
To: "dan.j.williams@intel.com" <dan.j.williams@intel.com>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"hch@lst.de" <hch@lst.de>, "axboe@kernel.dk" <axboe@kernel.dk>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"osandov@osandov.com" <osandov@osandov.com>,
	"James.Bottomley@hansenpartnership.com" 
	<James.Bottomley@hansenpartnership.com>,
	"jack@suse.cz" <jack@suse.cz>
Subject: Re: [PATCH v2] scsi, block: fix duplicate bdi name registration crashes
Date: Wed, 1 Feb 2017 20:35:20 +0000	[thread overview]
Message-ID: <1485981306.2560.11.camel@sandisk.com> (raw)
In-Reply-To: <148597749824.11392.9598040130844203664.stgit@dwillia2-desk3.amr.corp.intel.com>

On Wed, 2017-02-01 at 11:32 -0800, Dan Williams wrote:
> diff --git a/include/linux/genhd.h b/include/linux/genhd.h
> index 76f39754e7b0..27e7e12c0c2d 100644
> --- a/include/linux/genhd.h
> +++ b/include/linux/genhd.h
> @@ -167,6 +167,22 @@ struct blk_integrity {
>  };
>  
>  #endif	/* CONFIG_BLK_DEV_INTEGRITY */
> +struct disk_devt {
> +	atomic_t count;
> +	void (*release)(struct disk_devt *disk_devt);
> +};
> +
> +static inline void put_disk_devt(struct disk_devt *disk_devt)
> +{
> +	if (disk_devt && atomic_dec_and_test(&disk_devt->count))
> +		disk_devt->release(disk_devt);
> +}
> +
> +static inline void get_disk_devt(struct disk_devt *disk_devt)
> +{
> +	if (disk_devt)
> +		atomic_inc(&disk_devt->count);
> +}

The <linux/genhd.h> header file is included directly or indirectly in a
huge number of source files. Since neither get_disk_devt() nor
put_disk_devt() are called from the I/O path, please move these functions
from <linux/genhd.h> into block/genhd.c to keep the compilation time of
the kernel as short as possible.

Thanks,

Bart.

WARNING: multiple messages have this Message-ID (diff)
From: Bart Van Assche <Bart.VanAssche@sandisk.com>
To: "dan.j.williams@intel.com" <dan.j.williams@intel.com>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"hch@lst.de" <hch@lst.de>, "axboe@kernel.dk" <axboe@kernel.dk>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"osandov@osandov.com" <osandov@osandov.com>,
	"James.Bottomley@hansenpartnership.com"
	<James.Bottomley@hansenpartnership.com>,
	"jack@suse.cz" <jack@suse.cz>
Subject: Re: [PATCH v2] scsi, block: fix duplicate bdi name registration crashes
Date: Wed, 1 Feb 2017 20:35:20 +0000	[thread overview]
Message-ID: <1485981306.2560.11.camel@sandisk.com> (raw)
In-Reply-To: <148597749824.11392.9598040130844203664.stgit@dwillia2-desk3.amr.corp.intel.com>

On Wed, 2017-02-01 at 11:32 -0800, Dan Williams wrote:
> diff --git a/include/linux/genhd.h b/include/linux/genhd.h
> index 76f39754e7b0..27e7e12c0c2d 100644
> --- a/include/linux/genhd.h
> +++ b/include/linux/genhd.h
> @@ -167,6 +167,22 @@ struct blk_integrity {
>  };
>  
>  #endif	/* CONFIG_BLK_DEV_INTEGRITY */
> +struct disk_devt {
> +	atomic_t count;
> +	void (*release)(struct disk_devt *disk_devt);
> +};
> +
> +static inline void put_disk_devt(struct disk_devt *disk_devt)
> +{
> +	if (disk_devt && atomic_dec_and_test(&disk_devt->count))
> +		disk_devt->release(disk_devt);
> +}
> +
> +static inline void get_disk_devt(struct disk_devt *disk_devt)
> +{
> +	if (disk_devt)
> +		atomic_inc(&disk_devt->count);
> +}

The <linux/genhd.h> header file is included directly or indirectly in a
huge number of source files. Since neither get_disk_devt() nor
put_disk_devt() are called from the I/O path, please move these functions
from <linux/genhd.h> into block/genhd.c to keep the compilation time of
the kernel as short as possible.

Thanks,

Bart.

  parent reply	other threads:[~2017-02-01 20:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-01 19:32 [PATCH v2] scsi, block: fix duplicate bdi name registration crashes Dan Williams
2017-02-01 20:26 ` Omar Sandoval
2017-02-01 20:35 ` Bart Van Assche [this message]
2017-02-01 20:35   ` Bart Van Assche
2017-02-01 20:35   ` Bart Van Assche

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=1485981306.2560.11.camel@sandisk.com \
    --to=bart.vanassche@sandisk.com \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=axboe@kernel.dk \
    --cc=dan.j.williams@intel.com \
    --cc=hch@lst.de \
    --cc=jack@suse.cz \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=osandov@osandov.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 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.