From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH 10/14] bdi: remove BDI_CAP_SYNCHRONOUS_IO Date: Mon, 27 Jul 2020 09:58:22 +0200 Message-ID: <20200727075822.GA5355@lst.de> References: <20200726150333.305527-1-hch@lst.de> <20200726150333.305527-11-hch@lst.de> <20200726190639.GA560221@google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20200726190639.GA560221-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> Sender: cgroups-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Minchan Kim Cc: Christoph Hellwig , Jens Axboe , Song Liu , Hans de Goede , Richard Weinberger , linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, dm-devel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, linux-block-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, drbd-dev-cunTk1MwBs8qoQakbn7OcQ@public.gmane.org, linux-raid-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: dm-devel.ids On Sun, Jul 26, 2020 at 12:06:39PM -0700, Minchan Kim wrote: > > @@ -528,8 +530,7 @@ static ssize_t backing_dev_store(struct device *dev, > > * freely but in fact, IO is going on so finally could cause > > * use-after-free when the IO is really done. > > */ > > - zram->disk->queue->backing_dev_info->capabilities &= > > - ~BDI_CAP_SYNCHRONOUS_IO; > > + zram->disk->fops = &zram_wb_devops; > > up_write(&zram->init_lock); > > For zram, regardless of BDI_CAP_SYNCHRONOUS_IO, it have used rw_page > every time on read/write path. This one with next patch will make zram > use bio instead of rw_page when it's declared !BDI_CAP_SYNCHRONOUS_IO, > which introduce regression for performance. It really should not matter, as the overhead of setting up a bio is minimal. It also is only used in the legacy mpage buffered I/O code outside of the swap code, which has so many performance issues on its own that even if this made a difference it wouldn't matter. If you want magic treatment for your zram swap code you really need to integrate it with the swap code instead of burding the block layer with all this mess.