Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3498993ybl; Tue, 21 Jan 2020 01:48:43 -0800 (PST) X-Google-Smtp-Source: APXvYqzVszbsiZgBr9lJvLeYwHoebJrGETZ1orOvoWRy2LHPBBQh5ZEwzdIsvLvscwQFJsKC4w4B X-Received: by 2002:a05:6830:20d3:: with SMTP id z19mr2748367otq.330.1579600123759; Tue, 21 Jan 2020 01:48:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579600123; cv=none; d=google.com; s=arc-20160816; b=RorL2sGGo8IDEyCt0eBAdt5QkM6zKH5ERmXh2wl2074N9Wl1yE83zXAc7gZb6IosXa vxboa+852J2GpR3Aj288M/3p/xh3wudLUsC1rfU6VnJMOA01XeCRwmFEtq/nCKLome4B e47J9+OnnjCWv/ENEzp7QG8l4pSvjfkH+W5KJTEIQmw4RVMg6L2EPndqnpybv4XAoyxH hV8nGy217NngjyWsbGHFtj7bMmkmkN/BwPPHTs+5VzbQsRKxu17DhYrXd9vUBtwUlXcX R4Z5VQ1vmO2YaqupZhuqhBSEsJ8i9JV0uLBtivRGc9QOtUjIsseW2a2emWTJeyb8Ga8u NKxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=1TlC1QEjs/2kPrjRZeiqnoAmZKU8ggJYfvxHXQ4isd4=; b=Kk11NCs4tzqyQD2tKfx3obG3E9CZuli63seY4bBm9NTY2e9S0iu4qiTNg4WFllvNov DTaYLZvLz7nEXbVNF15WRahiPAfn6ZhSuSLfseT4wuZrx5fVcN9Z6ZeLea/xe/eHnYq4 mJLVY/c1wB0naFTECABQsiZ83s5uD1Lad9LJfC8TKGvRyG5LYqLuECoev2QSwMKYf/rP ScQal1xP1mIw2SXx0jlJbbThDjBv2TukwxXAnqEqywoZ+2BNHUk/AEkKizghoyE9BZW2 /+QcKJO1i8BrwQUckD24RYRPNR3786zosabXMnOBM7dblBIXBdGIptXNxsQqsHJtJbRR rJZQ== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a5si21937797oto.204.2020.01.21.01.48.32; Tue, 21 Jan 2020 01:48:43 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729268AbgAUJra (ORCPT + 99 others); Tue, 21 Jan 2020 04:47:30 -0500 Received: from relay.sw.ru ([185.231.240.75]:55060 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725789AbgAUJra (ORCPT ); Tue, 21 Jan 2020 04:47:30 -0500 Received: from dhcp-172-16-24-104.sw.ru ([172.16.24.104]) by relay.sw.ru with esmtp (Exim 4.92.3) (envelope-from ) id 1itq7p-0005tQ-B0; Tue, 21 Jan 2020 12:47:09 +0300 Subject: Re: [PATCH block v2 2/3] block: Add support for REQ_NOZERO flag To: "Martin K. Petersen" Cc: 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 References: <157917805422.88675.6477661554332322975.stgit@localhost.localdomain> <157917816325.88675.16481772163916741596.stgit@localhost.localdomain> From: Kirill Tkhai Message-ID: <3791a7fa-ea0c-d8ea-4b41-c968454b3787@virtuozzo.com> Date: Tue, 21 Jan 2020 12:47:09 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21.01.2020 09:14, Martin K. Petersen wrote: > > Kirill, > >> + if (flags & BLKDEV_ZERO_NOUNMAP) >> + req_flags |= REQ_NOUNMAP; >> + if (flags & BLKDEV_ZERO_ALLOCATE) >> + req_flags |= REQ_NOZERO|REQ_NOUNMAP; > > 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_?. No problem, I'll rename the modifier. > 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. > > Naming issues aside, your patch looks fine. I'll try to rebase my SCSI > patches on top of your series to see how things fit. Ok, thanks.