Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp292025ybl; Thu, 30 Jan 2020 22:25:05 -0800 (PST) X-Google-Smtp-Source: APXvYqwVl5+F22l9Oc9DTzwxawZGaOvOB+x6bC8s4XppEUslvshRrhhirsn9kbin/f1Tdwiw7IGI X-Received: by 2002:a9d:de9:: with SMTP id 96mr6643697ots.222.1580451905015; Thu, 30 Jan 2020 22:25:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580451905; cv=none; d=google.com; s=arc-20160816; b=ZnGLE4AwVhR84wEmrkSoq5rxOkcNDgJ6pXpZHVxTH6gDb1b1egKO96HiS6bNxhHDv8 NXlTpyGzdJsANLMU7PsoN2PJDOo4HL06kZqAMU7IsOpOgHTqTQvA1xoemC/hJEjnaHLB rWrpAh6Q7K65ucyZK6QhUQiGs9a3VJqtIc7qVc1FDFvoMJQ2w93J18LdjdA1VRP3QWgA 5MaUxNuqiWh+M503+4LmtPp6U/ZAnI+DiJYgp1UZ6c9BYbbKbIVzpCOyxjWy8l55rX/y feOe1WYsjaUvWGa8VvL/5GaBjJWvm9RuH2RHkMfL7Kzpy4jX/1FSpnsgwYCDb1+ru/6m uLDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=1++zzGV6QkWMWMT/4u5YKU2pHSpkvi0FTAouJWOgaWQ=; b=JXeaZjtUClrNoH5hTxCEgTOrR4TNI7TYrLw7yB7gZ8y7iwyABaEFDUXmw22BSDVl11 4oVNw7+CFzgmsxIc/H/9/0R6oclcrHMspv99/43v9a3r2FrkU/v5lvR17MAb7yN/vK6K BsdFMISqZ70EXh3OxYzXF1GnJBSltcgbuZQPmXHh+Hg5o+PiJ2O3gVP0fR9iwapfT3FH YoxmO4qGzLVdPf2UcSZ1bWxXeFF41Zw5c6onwxsS8KE6eyyWJpCy28vKGyDANGvs7+yD NPQUOAYvPaeF9EFDw9CleQgVJ24SA13+IcShxOmjvA54GMxfd6k7kq/Hi60IBB1yiTx2 /bjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=g3y+GoEc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l11si4288573otn.189.2020.01.30.22.24.51; Thu, 30 Jan 2020 22:25:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=g3y+GoEc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726488AbgAaGXv (ORCPT + 99 others); Fri, 31 Jan 2020 01:23:51 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:52778 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725832AbgAaGXv (ORCPT ); Fri, 31 Jan 2020 01:23:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=1++zzGV6QkWMWMT/4u5YKU2pHSpkvi0FTAouJWOgaWQ=; b=g3y+GoEc9kZTB4RdA+dfNTO81 uUCGBV1IhvklrE4xmWsd4chMSgGQWP6SH3n/sUs/WPFsuKy7IIRUh/V1k9kPdtDQ7+wQbrmjWe4M/ T8I0xGaxhl5YjTX3lVaUjsyiPjadjjskrO/WWhx1LBWbbhisFz/Xla4o9iyc4XhqFxGs07rOqGhdS A3tT2BCG+xi8mSPFFK8Fpyvz2Q6NpfrgGjtne7EJ00Db828M/dFnk7o+CyRmWC95pDm4Zk/BTdsl6 iAJvpmRLeCtEoQIm+Jm8HGeOldA3TRKdURn5y6VcDavodgzVtyENQe+MIF6ciY3Mx1sE7uUcVWyds NChhE2kPw==; Received: from hch by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1ixPiR-00036o-HH; Fri, 31 Jan 2020 06:23:43 +0000 Date: Thu, 30 Jan 2020 22:23:43 -0800 From: Christoph Hellwig To: "Martin K. Petersen" Cc: Kirill Tkhai , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@kernel.dk, tytso@mit.edu, adilger.kernel@dilger.ca, Chaitanya.Kulkarni@wdc.com, darrick.wong@oracle.com, ming.lei@redhat.com, osandov@fb.com, jthumshirn@suse.de, minwoo.im.dev@gmail.com, damien.lemoal@wdc.com, andrea.parri@amarulasolutions.com, hare@suse.com, tj@kernel.org, ajay.joshi@wdc.com, sagi@grimberg.me, dsterba@suse.com, bvanassche@acm.org, dhowells@redhat.com, asml.silence@gmail.com Subject: Re: [PATCH block v2 2/3] block: Add support for REQ_NOZERO flag Message-ID: <20200131062343.GA6267@infradead.org> References: <157917805422.88675.6477661554332322975.stgit@localhost.localdomain> <157917816325.88675.16481772163916741596.stgit@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 21, 2020 at 01:14:05AM -0500, Martin K. Petersen wrote: > I find there is some dissonance between using BLKDEV_ZERO_ALLOCATE to > describe this operation in one case and REQ_NOZERO in the other. > > I understand why not zeroing is important in your case. However, I think > the allocation aspect is semantically more important. Also, in the case > of SCSI, the allocated blocks will typically appear zeroed. So from that > perspective REQ_NOZERO doesn't really make sense. I would really prefer > to use REQ_ALLOCATE to describe this operation. I agree that "do not > write every block" is important too. I just don't have a good suggestion > for how to express that as an additional qualifier to REQ_ALLOCATE_?. Agreed. Nevermind the problem of a REQ_OP_WRITE_ZEROES operations with a NOZERO flag causing a massive confusion to the reader. > Also, adding to the confusion: In the context of SCSI, ANCHOR requires > UNMAP. So my head hurts a bit when I read REQ_NOZERO|REQ_NOUNMAP and > have to translate that into ANCHOR|UNMAP. > > Longer term, I think we should consider introducing REQ_OP_SINGLE_RANGE > or something like that as an umbrella operation that can be used to > describe zeroing, allocating, and other things that operate on a single > LBA range with no payload. Thus removing both the writiness and the > zeroness from the existing REQ_OP_WRITE_ZEROES conduit. What is the benefit of a multipler there? Given all this flags confusion I'm almost tempted to just split up REQ_OP_WRITE_ZEROES into REQ_OP_ALLOCATE ("cheap") and REQ_OP_WRITE_ZEROES ("potentially expensive") and just let the caller handle the difference. Everytime we try to encode semantic differences into flags we're eventually running into trouble. Sais the person that added REQ_UNMAP..