Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2846898lqo; Tue, 14 May 2024 10:54:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXwh85OYgNuewY4midquCregDh+1cfeCo+LZHYCogbkhWCEAshUVJZsgea7TS24Z8ElOdcUOYSSEm5iM1Y7xv6x1XsnL0B/yLrLHnkYTA== X-Google-Smtp-Source: AGHT+IGJP3n3PmBHUlyBumU8mL+/dH1YOfhEU7wuGMoNez1b7+/gowJUUfCb936S/MBm4ANNoEIl X-Received: by 2002:a05:6a20:f3a3:b0:1af:ac8c:4366 with SMTP id adf61e73a8af0-1afde1c571emr14426702637.30.1715709257293; Tue, 14 May 2024 10:54:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715709257; cv=pass; d=google.com; s=arc-20160816; b=UDffDcbivTqdrAeLYXgq12yqy3VWy+yhqLweePTnKbQ2hUPcN1gue6k4F+nqNEfAbp j43bRbq64KxsFb151BFzH8hOjGJn+6k5dACE297/vMi4jGiUWCX06l0X8cLT8sAmuXMK Dbykppmauuhdzy2n8ni3JGZs0IuCRJaULGPbkfuyJ45hdc7ZLRznk7kr7ZxFu3hbftwC TIoRLOKBhx0nAUe1dVA4HSVbZEvmd0T/FxUEr7E4sBasJQpc3WQoKa489pgluf0d7Vk6 kcI7dnEShIRYdJSxETAN+BAPbm09HLfEfvYmlWf2llthlUOOP0+A5YPxjwL2hfj2ZI7G QmDA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=vFxooJ/Wd2kSlfPg0r+rfS28FX2xdaR0dGl5yZTVUZc=; fh=Vp5A/OTKD3gdjg3xHfOo+qidg2bVYgeElaNdFREia74=; b=Lx5yi1/uoziJLmdPdgNtQ+WRp3qvd6S1yReFi4l1boDN/0BHClAGQ3PhJONtUnR5L7 bYziS61VCqPgp66GL6wyDvAQMHNxzsOO9LD+cHmw5ZMDGYFVEBA563UV97M9dWtTO6wc Nqm6AJ+/dpbbC1MZU2gnsJoYvcFe5Zb4zykd4xWnnnUdT6i7+GukfBMn/o6qkPzYgkWb 7nR1QbWjBmXlw6EQhQhMUeF2SMQd7tEsycl2G4U2vSvOMlCFpubFXVhGidLs7ASVuMQ0 GgWJy+hcyUp2VVqb80llChzFjQD3/vPPd0CQ3TGjRgWBv4iODMM7dfUMwBdyTm79U4Fl J2VQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="h4Uz/GOd"; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-179022-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179022-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6341404f9dfsi12276020a12.899.2024.05.14.10.54.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 10:54:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-179022-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="h4Uz/GOd"; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-179022-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179022-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id DF1FB2821C0 for ; Tue, 14 May 2024 17:54:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3B71018130B; Tue, 14 May 2024 17:53:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="h4Uz/GOd" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0382B180A80 for ; Tue, 14 May 2024 17:53:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715709220; cv=none; b=dIxeuAz4W61HGs+SM7dWmOyZ9aIqZnZorjYysIqJvwLkrGJywRubrekwSMVrLUx4+UE0i2Sf74dQhlpqQkKV0FCmIsoZL9EW3c6H43fx6xP/6rs2zybcLvOxhwBz/tl5sUZNUP2WRN/BaWmENTvkEN0f35p0RGgGPR5FeLZikvo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715709220; c=relaxed/simple; bh=b6e8Dnh3maUD9lwtp1+zI5BEIk5U7b2o4S0cX74JYYs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-type; b=Kz/fpe3P0OOKT1SHr5bl2iEs0Pu+PDhk8KrT+57FNfgUySiGu+WUOdZxxAOnWZ2NnlnNC0dF2cqOHaa6eHUJhpaQ7C2cTHqrSoDVpaXL/w2iCkfc3+NQR2lZsJa6WMLM9QLMxyZU6DjIacsaDSPcLKS+L7aZVyPYWEbgWGqTi44= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=h4Uz/GOd; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1715709218; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vFxooJ/Wd2kSlfPg0r+rfS28FX2xdaR0dGl5yZTVUZc=; b=h4Uz/GOdvHsKHGwX5hFhNrTyJ0i+YKiTX5vdWUGK3ji/0cCfulbWS5giGzvvL4KxmYL/Z0 2L3ku8HOl7/MDRNKOljy038RwdBQfuSU71VNUzKLa8hOQrQK5KppZaMLgFVx2GeDsm7/OC 1RZWDzpcMVFTrNWYBq3Matq+Ngluulw= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-222-cAwzDMOuML6LGk8vAbX-0g-1; Tue, 14 May 2024 13:53:32 -0400 X-MC-Unique: cAwzDMOuML6LGk8vAbX-0g-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 118E08001F7; Tue, 14 May 2024 17:53:32 +0000 (UTC) Received: from jmeneghi.bos.com (unknown [10.2.17.24]) by smtp.corp.redhat.com (Postfix) with ESMTP id E87CC400059; Tue, 14 May 2024 17:53:30 +0000 (UTC) From: John Meneghini To: tj@kernel.org, josef@toxicpanda.com, axboe@kernel.dk, kbusch@kernel.org, hch@lst.de, sagi@grimberg.me, emilne@redhat.com, hare@kernel.org Cc: linux-block@vger.kernel.org, cgroups@vger.kernel.org, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, jmeneghi@redhat.com, jrani@purestorage.com, randyj@purestorage.com Subject: [PATCH v4 3/6] nvme: multipath: Invalidate current_path when changing iopolicy Date: Tue, 14 May 2024 13:53:19 -0400 Message-Id: <20240514175322.19073-4-jmeneghi@redhat.com> In-Reply-To: <20240514175322.19073-1-jmeneghi@redhat.com> References: <20240514175322.19073-1-jmeneghi@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 From: "Ewan D. Milne" When switching back to numa from round-robin, current_path may refer to a different path than the one numa would have selected, and it is desirable to have consistent behavior. Tested-by: John Meneghini Signed-off-by: Ewan D. Milne Reviewed-by: Christoph Hellwig --- drivers/nvme/host/multipath.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c index 1e9338543ded..8702a40a1971 100644 --- a/drivers/nvme/host/multipath.c +++ b/drivers/nvme/host/multipath.c @@ -861,6 +861,7 @@ void nvme_subsys_iopolicy_update(struct nvme_subsystem *subsys, int iopolicy) mutex_lock(&nvme_subsystems_lock); list_for_each_entry(ctrl, &subsys->ctrls, subsys_entry) { atomic_set(&ctrl->nr_active, 0); + nvme_mpath_clear_ctrl_paths(ctrl); } mutex_unlock(&nvme_subsystems_lock); } -- 2.39.3