linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zhao Lei <zhaolei@cn.fujitsu.com>
To: "'Boaz Harrosh'" <boaz@plexistor.com>,
	"'Christoph Hellwig'" <hch@lst.de>
Cc: <linux-fsdevel@vger.kernel.org>, "'Jan Kara'" <jack@suse.cz>,
	"'Jens Axboe'" <axboe@fb.com>,
	"'LKML'" <linux-kernel@vger.kernel.org>
Subject: RE: Regression caused by using node_to_bdi()
Date: Mon, 13 Apr 2015 15:00:25 +0800	[thread overview]
Message-ID: <02ad01d075b7$84ed3ef0$8ec7bcd0$@cn.fujitsu.com> (raw)
In-Reply-To: <552A839C.4070101@plexistor.com>

Hi, Boaz

> -----Original Message-----
> From: Boaz Harrosh [mailto:boaz@plexistor.com]
> Sent: Sunday, April 12, 2015 10:39 PM
> To: Boaz Harrosh; Zhao Lei; 'Christoph Hellwig'
> Cc: linux-fsdevel@vger.kernel.org; 'Jan Kara'; 'Jens Axboe'; 'LKML'
> Subject: Re: Regression caused by using node_to_bdi()
> 
> On 04/12/2015 02:33 PM, Boaz Harrosh wrote:
> > On 04/10/2015 02:25 PM, Zhao Lei wrote:
> >> Hi, Christoph Hellwig
> >>
> <>
> >>
> >> Is there some way to speed up it(inline, or some access some variant
> >> in struct directly, ...)?
> >>
> >
> > Christoph hi
> >
> > Both node_to_bdi() and sb_is_blkdev_sb()  (and I_BDEV() &&
> > blk_get_backing_dev_info()) Are an exported function calls.
> >
> > Can we not make blockdev_superblock->s_bdi == NULL, and then
> > optimize-out the call to sb_is_blkdev_sb() to only that case.
> > Something like:
> >
> > ---
> >
> > diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index
> > 32a8bbd..e0375e1 100644
> > --- a/fs/fs-writeback.c
> > +++ b/fs/fs-writeback.c
> > @@ -78,7 +78,7 @@ int writeback_in_progress(struct backing_dev_info
> > *bdi)  }  EXPORT_SYMBOL(writeback_in_progress);
> >
> > -struct backing_dev_info *inode_to_bdi(struct inode *inode)
> > +struct backing_dev_info *__inode_to_bdi(struct inode *inode)
> >  {
> >  	struct super_block *sb;
> >
> > @@ -92,7 +92,7 @@ struct backing_dev_info *inode_to_bdi(struct inode
> > *inode)  #endif
> >  	return sb->s_bdi;
> >  }
> > -EXPORT_SYMBOL_GPL(inode_to_bdi);
> > +EXPORT_SYMBOL_GPL(__inode_to_bdi);
> >
> >  static inline struct inode *wb_inode(struct list_head *head)  { diff
> > --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
> > index aff923a..7d172f5 100644
> > --- a/include/linux/backing-dev.h
> > +++ b/include/linux/backing-dev.h
> > @@ -107,7 +107,16 @@ struct backing_dev_info {  #endif  };
> >
> > -struct backing_dev_info *inode_to_bdi(struct inode *inode);
> > +struct backing_dev_info *__inode_to_bdi(struct inode *inode);
> > +
> > +static inline
> > +struct backing_dev_info *inode_to_bdi(struct inode *inode) {
> > +	if (!inode || !inode->i_sb)
> > +		return __inode_to_bdi(inode);
> > +
> > +	return inode->i_sb->s_bdi;
> > +}
> >
> 
> This patch actually boots. Lei could you please test to see if it fixes your
> slowness?
> 
The good news is this patch passed compile and 10-time tests.
The bad news is it have more performance down(strange)...

v3.19-rc1              : io_speed: valcnt=10 avg=214.688 range=[211.460,216.190] diff=  2.24% stdev=1.417 cv=0.66%
v4.0-rc1               : io_speed: valcnt=10 avg=204.917 range=[203.370,205.890] diff=  1.24% stdev=0.663 cv=0.32%
v4.0-rc1_00001_82ad06  : io_speed: valcnt=10 avg=189.337 range=[186.280,192.060] diff=  3.10% stdev=2.305 cv=1.22% *<- this patch

I applied this patch on top of v4.0-rc1.

> Thanks
> Boaz
> 
> >  int __must_check bdi_init(struct backing_dev_info *bdi);  void
> > bdi_destroy(struct backing_dev_info *bdi);
> >

  parent reply	other threads:[~2015-04-13  7:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-10 11:25 Regression caused by using node_to_bdi() Zhao Lei
2015-04-12 11:33 ` Boaz Harrosh
2015-04-12 14:39   ` Boaz Harrosh
2015-04-13  1:20     ` Zhao Lei
2015-04-13  7:00     ` Zhao Lei [this message]
2015-04-13 10:22     ` Zhao Lei
2015-04-13 12:31       ` Boaz Harrosh
2015-04-14 12:14         ` Zhao Lei
2015-04-13 12:21   ` Jan Kara
2015-04-13 12:44     ` Boaz Harrosh
2015-04-13 17:32 ` 'Christoph Hellwig'
2015-04-14 12:27   ` Zhao Lei

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='02ad01d075b7$84ed3ef0$8ec7bcd0$@cn.fujitsu.com' \
    --to=zhaolei@cn.fujitsu.com \
    --cc=axboe@fb.com \
    --cc=boaz@plexistor.com \
    --cc=hch@lst.de \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.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 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).