Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3348069ybl; Mon, 20 Jan 2020 22:15:55 -0800 (PST) X-Google-Smtp-Source: APXvYqytc8WVNqbR8LaDh9SgwDvEUwmhDpieJUPCwRISYninTRVbapfYV9AX/3OQjjAP+o0WMp0F X-Received: by 2002:a9d:6211:: with SMTP id g17mr2383829otj.168.1579587355122; Mon, 20 Jan 2020 22:15:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579587355; cv=none; d=google.com; s=arc-20160816; b=QVkd0tOPdzJvlywuQMLp3jWmnPRWXPQ4jTn2R9rHuUmS8zqzx3bbIMIasF1VC7Hkm9 6laD49aF0MFQWF3jsVSRQUU+PGjuPwdj8kqoMeIJ5PdztqAxHcxH/dQh1AMsBQe1BGoi PrJ4ky1g2rYMIIKB9LURfUhYghkqdsVhjg/PlsKvIWIGQQiWsBOpuDK8kzW/cl2Kd6QB 847JnwAJ+dpbFvo2KtDcEhwIb9XYcykm4IglO+qPes8ch7Pfjm6xVobxzIvDBnt6x8b7 4p2UhXi0WJToajyibZJJDfKJhvPP8BCGevsPzoLU4DSTQ+5udUiE5qBFGJu+UMWEK2wv z/lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:organization:from:subject:cc:to :dkim-signature; bh=/qzG8cVh/rpF6yH6YERpeOBRx7eeia2tnSf+GgPT6IE=; b=IQmwQ3G/A+evgjv9NelPJFQbvWuaGUSWVlvo276u+ixyNKI6qn6sZmHs3Tl1lgmZ1N vvlISA6Wba6bb0n+V1lQI0+qgPqbrrPmTPhyeU5+OWPL/xNjYYavl60QfeLvUWcWDc8C sT0vtPk2uY0nxt4EiOXuKjHDZZWMoPFySIxW4xoNEPhpi54+Q4epJ4n6QW7P8hU58/94 ncuUNZrbbRDYhvuCxD+umacPHPunSH+C8mTKrn7LTTb6ndqDYR/caS4u9zFK5lKGNx03 x6gJbA5Fx8HjtDBh1gzA7aFzWIatltuzaV5gkklXg5p8WOrrBil3DBqZPXlnWzNbZMM4 Af3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2019-08-05 header.b=JTYYbWWD; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r15si9846884otp.211.2020.01.20.22.15.44; Mon, 20 Jan 2020 22:15:55 -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=pass header.i=@oracle.com header.s=corp-2019-08-05 header.b=JTYYbWWD; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728741AbgAUGOd (ORCPT + 99 others); Tue, 21 Jan 2020 01:14:33 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:50870 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725789AbgAUGOc (ORCPT ); Tue, 21 Jan 2020 01:14:32 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id 00L69BAe157535; Tue, 21 Jan 2020 06:14:11 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=to : cc : subject : from : references : date : in-reply-to : message-id : mime-version : content-type; s=corp-2019-08-05; bh=/qzG8cVh/rpF6yH6YERpeOBRx7eeia2tnSf+GgPT6IE=; b=JTYYbWWDhenZG8I7zkVpSLKsqWXMPSyCtgd68u1DQeXaCd6J5DdPizjWY4Ecw7ppmoOP z0FiquchfcL94QlsAVI/PTlN6fpdgULf2puepSFD2Cokdtjs5kDg1wBAgKR6bKtmhiTz c7dxj66aif2jOgZksQdkeS5qUqCy9+MZhv7T6ZSYn8bci7Q0AwR8KwcJ1tfvHSIoiwSY XS/mwFJqrdnb0m4xVCY8sJnevAJ0SRIB9QHeEQtN39hyp5BVdLs+0XNQiJqQw4AN2/Jb iLEUbinOB0VBRbsTNsbl5jsy08qPimfYDBJL2Ac98TWoGmCp73jpQHfDuO2TjQr0c+YS +g== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2130.oracle.com with ESMTP id 2xkseuawe9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 21 Jan 2020 06:14:11 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id 00L699lq079053; Tue, 21 Jan 2020 06:14:11 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userp3030.oracle.com with ESMTP id 2xnsa7y05k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 21 Jan 2020 06:14:11 +0000 Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 00L6E9rS026928; Tue, 21 Jan 2020 06:14:09 GMT Received: from ca-mkp.ca.oracle.com (/10.159.214.123) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 20 Jan 2020 22:14:09 -0800 To: Kirill Tkhai Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, martin.petersen@oracle.com, 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 From: "Martin K. Petersen" Organization: Oracle Corporation References: <157917805422.88675.6477661554332322975.stgit@localhost.localdomain> <157917816325.88675.16481772163916741596.stgit@localhost.localdomain> Date: Tue, 21 Jan 2020 01:14:05 -0500 In-Reply-To: <157917816325.88675.16481772163916741596.stgit@localhost.localdomain> (Kirill Tkhai's message of "Thu, 16 Jan 2020 15:36:03 +0300") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9506 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=997 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-2001210054 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9506 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-2001210054 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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_?. 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. -- Martin K. Petersen Oracle Linux Engineering