Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp363702pxa; Wed, 19 Aug 2020 03:36:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzA0z2SZ9T3sQ5Jmmscv48LVu4fYygcTfKNMc44tXwKa1MP58slNJYcCFJCnj9Vy3bvukvp X-Received: by 2002:a17:906:6004:: with SMTP id o4mr25466978ejj.411.1597833360468; Wed, 19 Aug 2020 03:36:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597833360; cv=none; d=google.com; s=arc-20160816; b=OOWsB7aA7q7VZso0FY/zRtLrkzE6Kp89ZghNZhefGkzUHB11xQxIqKSr9HA9/stUkq miYaQ6Vlv2WSCJ83zl4MqO0MFndde7abHDblmaOh8hjcNHPWjAaHirw2x9mNOmLLG5MT b6VhA2vStD+jvdq3Tsi1VYebeRzUMmVX5sWmuiKfxJKMW1FC02upmQvCYll6zG6hWyTI UIZuXN8F4VE8D/2XLxZxA4vYJi4I4xx2WZlDZJCohXjdfBVk2FvDnReeqRyX3boycTar Ky03eRrKM/GOkU5SWq8FO8irf5eMgqMdzo6FMcUmEF44XFg0sAISm6KMz2TJG7QU5bVF 0DjA== 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=NV+AsSWtKgo9V3/Cia9q0raOuFNDesH+Q29wP1zWBh4=; b=UlVhC6AzC9c7Ci4raddr/EF/MMvxikAmbA5OfV/irhQI9e8Wzb9fQWLa3ocmw7SkHX N11h+wiSjV0t3g7GdWSsn0b6FgfvQkBw/bxWjz/C+3QYVJbQS1DOaK1s6b7fOQFXoM80 H82TRTTBXdIxr9TvzZDsaQwVb4jW+yUOLG92d8bP5N/lWlfu2sHJJfFapgmw4pxAYNB2 /tSe3aS0kfUP1AHZBoG98LkTE1jUgU07U/NXY7ONeMV4fAueTLQ99N3g0kbBJhfJamA6 9yubWbf92cfGLaGTgbU4vPep5Wd022kxamKkN4j3dmzOWv3UlyHjsoGsqyUwunHT3WwP 26rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=B5lGJ4Vj; 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 q21si15096477edg.71.2020.08.19.03.35.35; Wed, 19 Aug 2020 03:36:00 -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=B5lGJ4Vj; 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 S1726782AbgHSKc2 (ORCPT + 99 others); Wed, 19 Aug 2020 06:32:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727042AbgHSKcW (ORCPT ); Wed, 19 Aug 2020 06:32:22 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86683C061757 for ; Wed, 19 Aug 2020 03:32:22 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id 9so1549105wmj.5 for ; Wed, 19 Aug 2020 03:32:22 -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=NV+AsSWtKgo9V3/Cia9q0raOuFNDesH+Q29wP1zWBh4=; b=B5lGJ4VjjJ0e8bFa5P9jabfVMJ2SDPRUYFM7GR79AU7H5PS7dHY0qLWGNgYNE40kxe KdNa5QE2zFmlsilJf1GOdlQECUEqFBq/M/SuwI4dKc0/AwbNc6/TGn1E62JqjyCvgHAq 1PV8a8aEEwQ3ZwcumuPpv6ZMGZaJO6iWY/dJoQe6+0EdXyQw+DbdSkjssIMQQRIBMc6b s2VS0Jrye6Qzif4pBIJmA33Ab0sbcl7kPqSKP9mTjvhz6j8c5uRHGQ07fBMz/U2aRWeU fC26cTKMUYAuZYk9iwCvOelEWfptsBVaQ7Uw4GnyOMY76lP8PMBOOgsNWEBE9DVw4R6Y GHJA== 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=NV+AsSWtKgo9V3/Cia9q0raOuFNDesH+Q29wP1zWBh4=; b=rvYC8ZJMW4yc6DQhb7ComUif98siOF2EWS7AbfN7NSpqxmy0ftFsRU1SKniiRdJO0w kj1gB78eY2nh72pcCUQiAs8rQFDUDWcuvir4WC2rpFa+jLKEnvdgE9Qvf7pQ+ngNIx/Q zH/uXB84JU/Wm49f+ba3AKp2praf0wCzGim3W2qZ6K8+rCDZPSzUtddb+29+YQhv0WOl XmI4Qsphoe8uKVCIU+nspb++JRRM4D47pLrpoBZP+Lf0EaU/icpn43kYVD14o/zG77CC F6CApLjTYQ4CSuZMzUclMRfMQMhqIhq3XuR9x9gr1LfKT63u1/KcFK1eUcpeCP6x9BXG ywsQ== X-Gm-Message-State: AOAM532ToNwa21zUrIN8a5eBanjXJnaSmqH+3Y0DSbELXM9v0zvrOybr +S26qjX5xtULqfUJZrToPHN9FmcgelhzPMP8xWY= X-Received: by 2002:a7b:c0c8:: with SMTP id s8mr4446682wmh.4.1597833140938; Wed, 19 Aug 2020 03:32:20 -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: Wed, 19 Aug 2020 16:01:54 +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 Wed, Aug 19, 2020 at 3:08 PM Damien Le Moal wrote: > > On 2020/08/19 18:27, Kanchan Joshi wrote: > > On Tue, Aug 18, 2020 at 12:46 PM Christoph Hellwig wrote: > >> > >> On Tue, Aug 18, 2020 at 10:59:35AM +0530, Kanchan Joshi wrote: > >>> Set elevator feature ELEVATOR_F_ZBD_SEQ_WRITE required for ZNS. > >> > >> No, it is not. > > > > Are you saying MQ-Deadline (write-lock) is not needed for writes on ZNS? > > I see that null-block zoned and SCSI-ZBC both set this requirement. I > > wonder how it became different for NVMe. > > It is not required for an NVMe ZNS drive that has zone append native support. > zonefs and upcoming btrfs do not use regular writes, removing the requirement > for zone write locking. I understand that if a particular user (zonefs, btrfs etc) is not sending regular-write and sending append instead, write-lock is not required. But if that particular user or some other user (say F2FS) sends regular write(s), write-lock is needed. Above block-layer, both the opcodes REQ_OP_WRITE and REQ_OP_ZONE_APPEND are available to be used by users. And I thought write-lock is taken or not is a per-opcode thing and not per-user (FS, MD/DM, user-space etc.), is not that correct? And MQ-deadline can cater to both the opcodes, while other schedulers cannot serve REQ_OP_WRITE well for zoned-device. > In the context of your patch series, ELEVATOR_F_ZBD_SEQ_WRITE should be set only > and only if the drive does not have native zone append support. Sure I can keep it that way, once I get it right. If it is really not required for native-append drive, it should not be here at the place where I added. > And even in that > case, since for an emulated zone append the zone write lock is taken and > released by the emulation driver itself, ELEVATOR_F_ZBD_SEQ_WRITE is required > only if the user will also be issuing regular writes at high QD. And that is > trivially controllable by the user by simply setting the drive elevator to > mq-deadline. Conclusion: setting ELEVATOR_F_ZBD_SEQ_WRITE is not needed. Are we saying applications should switch schedulers based on the write QD (use any-scheduler for QD1 and mq-deadline for QD-N). Even if it does that, it does not know what other applications would be doing. That seems hard-to-get-right and possible only in a tightly-controlled environment. -- Joshi