Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3139051pxk; Mon, 7 Sep 2020 04:30:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZUuLLPRXiSRA1EhvPEAJOAXiTUCEQ/1wmYEp5u4GieWr4a6jYVhb1+bAtoR6DdC6tm1pa X-Received: by 2002:aa7:cb05:: with SMTP id s5mr20802659edt.212.1599478246607; Mon, 07 Sep 2020 04:30:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599478246; cv=none; d=google.com; s=arc-20160816; b=uHJHFyIwmGmfwRmYokU4dTC+wrqJwLssbsHfyUnZ8++eJCksojMHrBkfBupU3HlN0k 3ZYvFBlWPYH+WrU3M066I/KMmiPf10LGHiulOw7bnawnXdxlKyqN34YkYwQZlt8Fb/az NcsEHuD0sMUAPhR7Y6ZyReWLozraQwx9vb+FHn1P1n0s+5Xoz9bUuCcM9TUl8Ylk+1RP pZEiH/EDIbTVWfOxeG7vgZk+xyeg5iudurxqxKFqWONrrG8heDyjVxJW1RYiseslGw9e 9TxwF71WVA1AnPIaHQAscRqtxWmKAGRIzrfy2evsUuprB6L+yNwQ0XBmLGfg7tcDKQW0 9MpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=bNFvxhnA0NnzUC7lrNJrUKsLLmz7/HC2qOyPmU9vUl0=; b=yKbA0KqS0axNwAjpQo33adOo7AOIhQ0XpaDCK/OzGcczZXJSvAjh4rN1GNPYy63IeV 4W8Pyy5OljMOSphiMurTLHvt2Yg656e6pA7jJn7YkeQOKLiBUOoiowhk8deDAx7kkYXe ohxwKzhcuefDI5osq0Fa/nfKDa8PqLc+8Fh+vPv3Z7LEal1Yz0lxHyyb6Plt+vvmcEhb yomTMre7Bj26nSRhlkQweWyqysirKKs3nckZSnBXXoDBCrpkqRC5+7VlNZpsrwF/lbi8 6EK8Ngpr9EkROknaHQzBw7OW4pTfxrcxWHNPpn4/tGwl2/hYBDTMh8gbmlU02IwpJc11 w5oQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uzUc11E0; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lc19si10016010ejb.192.2020.09.07.04.30.24; Mon, 07 Sep 2020 04:30:46 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uzUc11E0; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728952AbgIGL32 (ORCPT + 99 others); Mon, 7 Sep 2020 07:29:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728780AbgIGLYU (ORCPT ); Mon, 7 Sep 2020 07:24:20 -0400 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4351EC061575 for ; Mon, 7 Sep 2020 04:24:16 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id x14so15374742wrl.12 for ; Mon, 07 Sep 2020 04:24:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bNFvxhnA0NnzUC7lrNJrUKsLLmz7/HC2qOyPmU9vUl0=; b=uzUc11E0gok7gl6O5NNy2E0O4w9nQRfSU0c4U5Pb0vlWerd2W52/oGEaCOOf21VZvz qbUWgc2jjvIpozWCfp5pFMHduvVHPw9c48sqGnfyIUUgJG8BtPryhVoO1vbQrZt1/2t5 BGv5rA9Q15nMiYW8wLCBNm91gw329WdwEEbDzBSo09EzeCoL4z5eMUY/Mab/sG1oaIfF 7eTtOIxJhimNEA8xKA/QRtsNsbmswuWJftIDEE+4nua2bEgR1PPGWBqjJRJd5dr51Jy+ m2vaxKwhT9k2SZY3Dh7QIltaGj2udCVRKw+lhS67Vb9tGQFVsD564QdWXYAzA5u+OU1S EBDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bNFvxhnA0NnzUC7lrNJrUKsLLmz7/HC2qOyPmU9vUl0=; b=FzknNLtQXdPBWbMi9oiABKGTy5kgSlh0zzEQDwFIVMpW6lyVrCA5UzbA2eERA10ltc sYp7o46PodIDXwXFKg+r5dLZ4WNvZd067HNL6/yRYbAnb3+VfqJ1ivZYOZ2bgopIOtYz 4gC0Yiiu4s3a2W+rHqKcfAM/JwGM1aLaFwVVm8vMoBFvTqpnt3bnzanpvg1i0RToY1ye hbdF0wdkSXqxMxCn+fp/b9IupCKDc5n+jpIeUupbaFMibAOAax+7rP4aewkqMAflFbOf vrfFuniJqnoT80P52gZj6eU6rYsQE/VRf6xToVwOlctGi1/QeikXTXxNtbebMivjVOje So0w== X-Gm-Message-State: AOAM530bRpRF1AEEnOKSy7E29rF1EkwD9pq7G1TClZFly28r87+ACJUi P6Q1Mm06Gt3FBb7P/+Sj8alsDO8QSG4Vr38Tp1k= X-Received: by 2002:a5d:630a:: with SMTP id i10mr20495093wru.137.1599477853937; Mon, 07 Sep 2020 04:24:13 -0700 (PDT) MIME-Version: 1.0 References: <20200818052936.10995-1-joshi.k@samsung.com> <20200818052936.10995-2-joshi.k@samsung.com> <20200818071141.GA2544@lst.de> In-Reply-To: From: Kanchan Joshi Date: Mon, 7 Sep 2020 16:53:47 +0530 Message-ID: Subject: Re: [PATCH 1/2] nvme: set io-scheduler requirement for ZNS To: Damien Le Moal Cc: Christoph Hellwig , Kanchan Joshi , Jens Axboe , "sagi@grimberg.me" , Johannes Thumshirn , "linux-kernel@vger.kernel.org" , "linux-nvme@lists.infradead.org" , Keith Busch , Selvakumar S , Javier Gonzalez , Nitesh Shetty Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 7, 2020 at 1:52 PM Damien Le Moal wrote: > > On 2020/09/07 16:01, Kanchan Joshi wrote: > >> Even for SMR, the user is free to set the elevator to none, which disables zone > >> write locking. Issuing writes correctly then becomes the responsibility of the > >> application. This can be useful for settings that for instance use NCQ I/O > >> priorities, which give better results when "none" is used. > > > > Was it not a problem that even if the application is sending writes > > correctly, scheduler may not preserve the order. > > And even when none is being used, re-queue can happen which may lead > > to different ordering. > > "Issuing writes correctly" means doing small writes, one per zone at most. In > that case, it does not matter if the block layer reorders writes. Per zone, they > will still be sequential. > > >> As far as I know, zoned drives are always used in tightly controlled > >> environments. Problems like "does not know what other applications would be > >> doing" are non-existent. Setting up the drive correctly for the use case at hand > >> is a sysadmin/server setup problem, based on *the* application (singular) > >> requirements. > > > > Fine. > > But what about the null-block-zone which sets MQ-deadline but does not > > actually use write-lock to avoid race among multiple appends on a > > zone. > > Does that deserve a fix? > > In nullblk, commands are executed under a spinlock. So there is no concurrency > problem. The spinlock serializes the execution of all commands. null_blk zone > append emulation thus does not need to take the scheduler level zone write lock > like scsi does. I do not see spinlock for that. There is one "nullb->lock", but its scope is limited to memory-backed handling. For concurrent zone-appends on a zone, multiple threads may set the "same" write-pointer into incoming request(s). Are you referring to any other spinlock that can avoid "same wp being returned to multiple threads". -- Kanchan