Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp884770lqp; Thu, 23 May 2024 03:02:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXlYxjJY5znKWMGd+ChJEz2LNthoBr+RhzmJnyRWDACMjUWolccAdwgXsLvpQV63eQ/C8ODXM1MZCjexfaDfZJLegw1A2Nid5I3xSxqFg== X-Google-Smtp-Source: AGHT+IGj+XgnMFT7e8JJc4/DchIk52wxIIJARRV+57BT6RLBuvgUa2EAPeG/veqCHXJc2QfukW7g X-Received: by 2002:a05:6102:3a06:b0:485:8b2c:15f with SMTP id ada2fe7eead31-48906c58d78mr4448763137.25.1716458563265; Thu, 23 May 2024 03:02:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716458563; cv=pass; d=google.com; s=arc-20160816; b=eNxZJbMtnSKOTJs1WCrt3psZdLU3ubQfdFaHCjjRt0CNYJVA0M9jI8nd+QY36mZvTu aNbYjJ4XGvJZwQNGrTtm4ItD9taVNt91s6nY7pUnH4pBDCX47MaBfFA9lpTU4VDGuARw 8UzY0aksVdk6yvxE4qULRjLUaG5ddSmhFqP2/oHaHj86pZWdX4bh0E+KB4K/nIAW2Dys uyMa/f7oKhr+GVBGa196Eoht6q/JHyMpASzvq3jblfl20nfYI4CJlzQqrFfzEYYzYmmG qQsp18dMakXVOHGekmI0lbVz6uG8zMonZu1ISlixbaq6Wq4L4vUkinBja7MGps0tYIU9 OmqA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=ebL6HaU3GdxWXH9bjbvtlMoHiAW2gcv2Q5qh8IlHrEA=; fh=XZn0EZqPuZukqZXnF6RRIVBx4CrzXVDjaMgPAVtPL3w=; b=ODwuvsHKUbXQA+F1xlB/IH86BoxWvm0xLVxuMV7SPKc9L5klnVSeLGlj++cI8GTr6G A4AaqLvdgYvOy6rgPN0fhAeDlF+5hTw8ETSNB+Ct/mnwwfwwUxX5C+tJYyWD+ejgXGzd X/yf89HiomTI7l0+WJ2xDoTUsNyQ9aViBeqAi/A2hcnQDHVFBBEcp98Zuhbf9VqOacB2 SeESPLF3D0YXLJ2uVoqDbaI5ltZgUCDbRpNFvrMF9VQAsh8+Uuf7toV7KuqD2OZ+y2cg Ahp2PXu6VxOBdhxnTwwUTDxFFhKpw+d8oDALraowjSf22z55kAmN8NmQqkpyox8O8ZLc xyYQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-187299-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187299-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id ada2fe7eead31-48a2f369454si59814137.550.2024.05.23.03.02.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 03:02:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-187299-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-187299-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187299-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id DCF251C227AA for ; Thu, 23 May 2024 10:02:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7C91C13D509; Thu, 23 May 2024 10:02:24 +0000 (UTC) Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5140713B592 for ; Thu, 23 May 2024 10:02:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716458544; cv=none; b=QhbgMpCYsU53s704C3GlF7f18f+zI0aZvJGioEn2hfquU+9XFA0zsJUSAhruezQBtNDuDdK14gpiCA/kV2yX785UloHxN8aM90VhDsGtJhBS7UVVaNx8+xR8CWqjpS9RfWDhYoiiKE3uH0ZbJU6Axwv/4CYAIZca7MstWkEzGA4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716458544; c=relaxed/simple; bh=5gMWlRS41vfYYwjjWOChSkekHr83N8Zpdz0GhxCUzTA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=kOXigFpbk4hfBwR3PeAFjYUtFHLpNhJ/TxrY6lT8KitZLqYYHD7CEhAwRDVQ5tSMOTVlJDWcKr1TpXiM/8i6VhnjHUstPfQVe0TQIiHl4lwAau8ADzFr0c/Kmljxzb4lVmFpArtm7kETgFxLcUz7IuUlJpHC0ZCzzqwVrdNBJ2c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=grimberg.me; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.221.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=grimberg.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-354fa667fb6so69603f8f.0 for ; Thu, 23 May 2024 03:02:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716458540; x=1717063340; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ebL6HaU3GdxWXH9bjbvtlMoHiAW2gcv2Q5qh8IlHrEA=; b=vE0ZPkRClecWWg9m1xtPqB9CALRaYK4opxF779osUmuUrtvg5d1hrOicqu7GJyS/U3 imx3cra8E0AclARM4xBCgmDHmfjwNp8PKCyv08V9787CzuuO7ONlVxoJbvD7unlPF2A5 9suN1ZwupKWCzczcd/Ho+mPOXvhGyhhCsw0XvvvTW6JUev1DQco+4WJKzCJkSsD7bnbV nsH7pGwLhuoA140loM6F/Hx0dGNet8CittOofot5s6SfHkUssvK+fMM4NmSurLQRF0ED SALjlPHZEQTD9Pk3FCZNBOUR+tAh3hzo/OSwRu9rydd4D9MThOypIwQC8vjogPvTYWsI REzA== X-Forwarded-Encrypted: i=1; AJvYcCX6pGURJR51aRVbgxNW38ExC9Mers2OHRR3UQflGwH8UcbLKm2fu+yDBQzhGwp8RCx3Re/0y4yhX7jjBl1al6CpNMHy/StYvd82Dr37 X-Gm-Message-State: AOJu0YxGWAtAJlVJv1sBR70J2weVpPT/xzBRIH1ZEmVjrpFRPXWFw3G+ vVA4MeejhTx0+GNwEFAMW4EGorFVOkNfWbCqLw9kBSW1PQci06kL X-Received: by 2002:a5d:46ca:0:b0:354:fa0d:1421 with SMTP id ffacd0b85a97d-354fa0d15d9mr828698f8f.1.1716458540286; Thu, 23 May 2024 03:02:20 -0700 (PDT) Received: from [10.100.102.74] (85.65.193.189.dynamic.barak-online.net. [85.65.193.189]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-354f5e593dasm1702399f8f.109.2024.05.23.03.02.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 23 May 2024 03:02:20 -0700 (PDT) Message-ID: <98c860ce-57ca-4451-a4fa-1af93834e8f5@grimberg.me> Date: Thu, 23 May 2024 13:02:18 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 1/1] nvme: multipath: Implemented new iopolicy "queue-depth" To: Keith Busch , John Meneghini Cc: hch@lst.de, emilne@redhat.com, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, jrani@purestorage.com, randyj@purestorage.com, hare@kernel.org References: <20240522154212.643572-1-jmeneghi@redhat.com> <20240522154212.643572-2-jmeneghi@redhat.com> Content-Language: en-US From: Sagi Grimberg In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 22/05/2024 19:29, Keith Busch wrote: > On Wed, May 22, 2024 at 12:23:51PM -0400, John Meneghini wrote: >> On 5/22/24 11:56, Keith Busch wrote: >>> On Wed, May 22, 2024 at 11:42:12AM -0400, John Meneghini wrote: >>>> +static void nvme_subsys_iopolicy_update(struct nvme_subsystem *subsys, int iopolicy) >>>> +{ >>>> + struct nvme_ctrl *ctrl; >>>> + int old_iopolicy = READ_ONCE(subsys->iopolicy); >>>> + >>>> + WRITE_ONCE(subsys->iopolicy, iopolicy); >>>> + >>>> + /* iopolicy changes reset the counters and clear the mpath by design */ >>>> + mutex_lock(&nvme_subsystems_lock); >>>> + list_for_each_entry(ctrl, &subsys->ctrls, subsys_entry) { >>>> + atomic_set(&ctrl->nr_active, 0); >>> Can you me understand why this is a desirable feature? Unless you >>> quiesce everything at some point, you'll always have more unaccounted >>> requests on whichever path has higher latency. That sounds like it >>> defeats the goals of this io policy. >> This is true. And as a matter of practice I never change the IO policy when IOs are in flight. I always stop the IO first. >> But we can't stop any user from changing the IO policy again and again. So I'm not sure what to do. >> >> If you'd like I add the 'if (old_iopolicy == iopolicy) return;' here, but >> that's not going to solve the problem of inaccurate counters when users >> start flipping io policies around. with IO inflight. There is no >> synchronization between io submission across controllers and changing the >> policy so I expect changing between round-robin and queue-depth with IO >> inflight suffers from the same problem... though not as badly. >> >> I'd rather take this patch now and figure out how to fix the problem with >> another patch in the future. Maybe we can check the io stats and refuse to >> change the policy of they are not zero.... > The idea of tagging the nvme_req()->flags on submission means the > completion handling the nr_active counter is symmetric with the > submission side: you don't ever need to reset nr_active because > everything is accounted for. Agree. We should probably remove it from the patch.