From: Jens Axboe <axboe@suse.de>
To: Andrew Morton <akpm@osdl.org>
Cc: dm-devel@redhat.com, linux-kernel@vger.kernel.org,
Dave Olien <dmo@osdl.org>,
agk@sourceware.org
Subject: Re: [PATCH] add local bio pool support and modify dm
Date: Thu, 3 Feb 2005 08:08:07 +0100 [thread overview]
Message-ID: <20050203070803.GA8094@suse.de> (raw)
In-Reply-To: <20050202181924.395165fe.akpm@osdl.org>
On Wed, Feb 02 2005, Andrew Morton wrote:
> Dave Olien <dmo@osdl.org> wrote:
> >
> > +extern inline void zero_fill_bio(struct bio *bio)
> > +{
> > + unsigned long flags;
> > + struct bio_vec *bv;
> > + int i;
> > +
> > + bio_for_each_segment(bv, bio, i) {
> > + char *data = bvec_kmap_irq(bv, &flags);
> > + memset(data, 0, bv->bv_len);
> > + flush_dcache_page(bv->bv_page);
> > + bvec_kunmap_irq(data, &flags);
> > + }
> > +}
>
> heavens. Why was this made inline? And extern inline?
>
> It's too big for inlining (and is super-slow anyway) and will cause all
> sorts of unpleasant header file dependencies for all architectures. bio.h
> now needs to see the implementation of everyone's flush_dcache_page(), for
> example.
>
>
> Something like this?
>
> --- 25/include/linux/bio.h~add-local-bio-pool-support-and-modify-dm-uninline-zero_fill_bio 2005-02-02 18:17:18.225901376 -0800
> +++ 25-akpm/include/linux/bio.h 2005-02-02 18:17:18.230900616 -0800
> @@ -286,6 +286,7 @@ extern void bio_set_pages_dirty(struct b
> extern void bio_check_pages_dirty(struct bio *bio);
> extern struct bio *bio_copy_user(struct request_queue *, unsigned long, unsigned int, int);
> extern int bio_uncopy_user(struct bio *);
> +void zero_fill_bio(struct bio *bio);
>
> #ifdef CONFIG_HIGHMEM
> /*
> @@ -335,18 +336,4 @@ extern inline char *__bio_kmap_irq(struc
> __bio_kmap_irq((bio), (bio)->bi_idx, (flags))
> #define bio_kunmap_irq(buf,flags) __bio_kunmap_irq(buf, flags)
>
> -extern inline void zero_fill_bio(struct bio *bio)
> -{
> - unsigned long flags;
> - struct bio_vec *bv;
> - int i;
> -
> - bio_for_each_segment(bv, bio, i) {
> - char *data = bvec_kmap_irq(bv, &flags);
> - memset(data, 0, bv->bv_len);
> - flush_dcache_page(bv->bv_page);
> - bvec_kunmap_irq(data, &flags);
> - }
> -}
> -
> #endif /* __LINUX_BIO_H */
> diff -puN fs/bio.c~add-local-bio-pool-support-and-modify-dm-uninline-zero_fill_bio fs/bio.c
> --- 25/fs/bio.c~add-local-bio-pool-support-and-modify-dm-uninline-zero_fill_bio 2005-02-02 18:17:18.227901072 -0800
> +++ 25-akpm/fs/bio.c 2005-02-02 18:17:18.231900464 -0800
> @@ -182,6 +182,21 @@ struct bio *bio_alloc(int gfp_mask, int
> return bio_alloc_bioset(gfp_mask, nr_iovecs, fs_bio_set);
> }
>
> +void zero_fill_bio(struct bio *bio)
> +{
> + unsigned long flags;
> + struct bio_vec *bv;
> + int i;
> +
> + bio_for_each_segment(bv, bio, i) {
> + char *data = bvec_kmap_irq(bv, &flags);
> + memset(data, 0, bv->bv_len);
> + flush_dcache_page(bv->bv_page);
> + bvec_kunmap_irq(data, &flags);
> + }
> +}
> +EXPORT_SYMBOL(zero_fill_bio);
> +
> /**
> * bio_put - release a reference to a bio
> * @bio: bio to release reference to
> _
Yep looks good, thanks Andrew.
--
Jens Axboe
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
WARNING: multiple messages have this Message-ID (diff)
From: Jens Axboe <axboe@suse.de>
To: Andrew Morton <akpm@osdl.org>
Cc: Dave Olien <dmo@osdl.org>,
linux-kernel@vger.kernel.org, agk@sourceware.org,
dm-devel@redhat.com
Subject: Re: [PATCH] add local bio pool support and modify dm
Date: Thu, 3 Feb 2005 08:08:07 +0100 [thread overview]
Message-ID: <20050203070803.GA8094@suse.de> (raw)
In-Reply-To: <20050202181924.395165fe.akpm@osdl.org>
On Wed, Feb 02 2005, Andrew Morton wrote:
> Dave Olien <dmo@osdl.org> wrote:
> >
> > +extern inline void zero_fill_bio(struct bio *bio)
> > +{
> > + unsigned long flags;
> > + struct bio_vec *bv;
> > + int i;
> > +
> > + bio_for_each_segment(bv, bio, i) {
> > + char *data = bvec_kmap_irq(bv, &flags);
> > + memset(data, 0, bv->bv_len);
> > + flush_dcache_page(bv->bv_page);
> > + bvec_kunmap_irq(data, &flags);
> > + }
> > +}
>
> heavens. Why was this made inline? And extern inline?
>
> It's too big for inlining (and is super-slow anyway) and will cause all
> sorts of unpleasant header file dependencies for all architectures. bio.h
> now needs to see the implementation of everyone's flush_dcache_page(), for
> example.
>
>
> Something like this?
>
> --- 25/include/linux/bio.h~add-local-bio-pool-support-and-modify-dm-uninline-zero_fill_bio 2005-02-02 18:17:18.225901376 -0800
> +++ 25-akpm/include/linux/bio.h 2005-02-02 18:17:18.230900616 -0800
> @@ -286,6 +286,7 @@ extern void bio_set_pages_dirty(struct b
> extern void bio_check_pages_dirty(struct bio *bio);
> extern struct bio *bio_copy_user(struct request_queue *, unsigned long, unsigned int, int);
> extern int bio_uncopy_user(struct bio *);
> +void zero_fill_bio(struct bio *bio);
>
> #ifdef CONFIG_HIGHMEM
> /*
> @@ -335,18 +336,4 @@ extern inline char *__bio_kmap_irq(struc
> __bio_kmap_irq((bio), (bio)->bi_idx, (flags))
> #define bio_kunmap_irq(buf,flags) __bio_kunmap_irq(buf, flags)
>
> -extern inline void zero_fill_bio(struct bio *bio)
> -{
> - unsigned long flags;
> - struct bio_vec *bv;
> - int i;
> -
> - bio_for_each_segment(bv, bio, i) {
> - char *data = bvec_kmap_irq(bv, &flags);
> - memset(data, 0, bv->bv_len);
> - flush_dcache_page(bv->bv_page);
> - bvec_kunmap_irq(data, &flags);
> - }
> -}
> -
> #endif /* __LINUX_BIO_H */
> diff -puN fs/bio.c~add-local-bio-pool-support-and-modify-dm-uninline-zero_fill_bio fs/bio.c
> --- 25/fs/bio.c~add-local-bio-pool-support-and-modify-dm-uninline-zero_fill_bio 2005-02-02 18:17:18.227901072 -0800
> +++ 25-akpm/fs/bio.c 2005-02-02 18:17:18.231900464 -0800
> @@ -182,6 +182,21 @@ struct bio *bio_alloc(int gfp_mask, int
> return bio_alloc_bioset(gfp_mask, nr_iovecs, fs_bio_set);
> }
>
> +void zero_fill_bio(struct bio *bio)
> +{
> + unsigned long flags;
> + struct bio_vec *bv;
> + int i;
> +
> + bio_for_each_segment(bv, bio, i) {
> + char *data = bvec_kmap_irq(bv, &flags);
> + memset(data, 0, bv->bv_len);
> + flush_dcache_page(bv->bv_page);
> + bvec_kunmap_irq(data, &flags);
> + }
> +}
> +EXPORT_SYMBOL(zero_fill_bio);
> +
> /**
> * bio_put - release a reference to a bio
> * @bio: bio to release reference to
> _
Yep looks good, thanks Andrew.
--
Jens Axboe
next prev parent reply other threads:[~2005-02-03 7:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-02 6:47 [PATCH] add local bio pool support and modify dm Dave Olien
2005-02-02 6:47 ` Dave Olien
2005-02-03 2:19 ` Andrew Morton
2005-02-03 2:19 ` Andrew Morton
2005-02-03 7:08 ` Jens Axboe [this message]
2005-02-03 7:08 ` Jens Axboe
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=20050203070803.GA8094@suse.de \
--to=axboe@suse.de \
--cc=agk@sourceware.org \
--cc=akpm@osdl.org \
--cc=dm-devel@redhat.com \
--cc=dmo@osdl.org \
--cc=linux-kernel@vger.kernel.org \
/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.