Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp852445ybg; Mon, 27 Jul 2020 00:59:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6Ch97fB0uRzqtaRZ13BmDnu8yvl5viDllsKYQotxRq5fyAQ1P8NEC2V8I+dk5l2TzgXvK X-Received: by 2002:a17:906:3a4c:: with SMTP id a12mr3395930ejf.306.1595836759704; Mon, 27 Jul 2020 00:59:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595836759; cv=none; d=google.com; s=arc-20160816; b=olInXvl9ms2XgczT+CM+VXrjH06M74G1lzCc+FRwhqgUDIKpwSkIojhiVmgQH18Fns gctLteh9Y8jEicqX19llw+x3uPnYjahYQzaRA3bP16bz8fOCcZsog2hGItVMqZsj8I2l mfvx0AIT8obXKYYP8XuMyb6qYiiS295H5+omVVXEHikectlCq8BcjqyogFbS/t6kL5JS G8IH5oNhQiKgmjMMCRBDFPW6fHTk+GBc68DkCg5a/vkRwnDHuRWHcL2YJP217cM4clId r4vPDFUw2AEBsAWFdJQ1jqmDVDBIbYG3F1eEjspkseb8ei54a7lGtL0J32KVsPiJK6wI zAgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=04Ib+Vp0MgZL+5rSvqFMiQvYjzX2se8rFH+JaluJ2hw=; b=y1b6A9vQhPl1ARwLfua5R+kt0NO7QT+XV53DQai8XdiX0XhuxN5eWX8++Pi916iL5B 73PeXt/svejVJShC6VRnsy6Iyh784XJf0eAujqc3iNsZ7a5T/c/9ClVZYWw+/GTFgHTA lDvhOVSmlEEb2BuYwrPrzaeR/ziIibmbTjzOfSRFtq3oji2ZcLIF0erbXguMk0ogE6k+ w3XgiQSeB1ZH17XryAukbdxxJTQV/PxjuUyHONPHhn9yczInO+g+vKnXh/9pouxFnce1 5cMMh+WDk1+uWrEM3aqstM1WoLQZVILzLhRuPt21g67GDV2mP4bkzpsWg5OvL6weGBEG Sgfg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h24si5206948ejt.451.2020.07.27.00.58.58; Mon, 27 Jul 2020 00:59:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727797AbgG0H60 (ORCPT + 99 others); Mon, 27 Jul 2020 03:58:26 -0400 Received: from verein.lst.de ([213.95.11.211]:42430 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726183AbgG0H60 (ORCPT ); Mon, 27 Jul 2020 03:58:26 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 630C468B05; Mon, 27 Jul 2020 09:58:22 +0200 (CEST) Date: Mon, 27 Jul 2020 09:58:22 +0200 From: Christoph Hellwig To: Minchan Kim Cc: Christoph Hellwig , Jens Axboe , Song Liu , Hans de Goede , Richard Weinberger , linux-mtd@lists.infradead.org, dm-devel@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, drbd-dev@lists.linbit.com, linux-raid@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, cgroups@vger.kernel.org Subject: Re: [PATCH 10/14] bdi: remove BDI_CAP_SYNCHRONOUS_IO 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 Content-Disposition: inline In-Reply-To: <20200726190639.GA560221@google.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.