Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp94857lqo; Thu, 9 May 2024 13:47:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVWkveQqcJtRrAUqlwq8kxkbWjJjLaE2TM8+iG7TTTzn/quP47LWtK3aBDlZBsoqo/9aRk3ZPL2DUQPF+tZ9CWUBlmKwxGXlVB+zyOjmg== X-Google-Smtp-Source: AGHT+IHlWgfUsWqPf3dSTIOiE55PWCswA4eumANMS0gK4uT3/FWdrTgbyzi5Bj2kq6x0MrNRLdZ4 X-Received: by 2002:a05:6a20:914f:b0:1ad:89e:21b5 with SMTP id adf61e73a8af0-1afde0d4ce4mr1077670637.15.1715287621157; Thu, 09 May 2024 13:47:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715287621; cv=pass; d=google.com; s=arc-20160816; b=U2+WDuMHnE4wckvM9isNkC9PHgLs8lxMXd6t/k4q5gKn4LO8Mz2ubOgUkCfwcrpKZT o6zcrRbXXFXrPDTjuLLGK2ADdzDMHJh/1iy4pDDcSN1fTvA+ArsdEazTGYyG3RjJNyYJ G9mW1r78b3q5ZKz4FB1GOB+no8pKouzp4iLauZ5CA37XbZrqBaSxVK0fYpeWNkQAk74g Q9R1qQoD7UNrpOcKKlf3z8xNlFOkS3tStxzOOMhMFJvFx6CY/HIpw/2JIZKrwE+WXsjt xUAar0dm18PnpEmPuIevI8YzRR+5yP0p4h33YxXB05bqOZ+x1e/qh7r5UTiezf4MgXJB ErxQ== 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=u1GlnK+q8TY5qrTbDgo/iJ68l+D3mRMbytA6rZ1uGIY=; fh=uNH6WxBhyDpr+4H8LOkkbq8hsUJA7MPuRO27lML+arU=; b=FmMPf8tG7Fxlw+poDkam2lCa2bIAEgv8mfwDUXFaYx02vc8aVpMkH34LWukFgUQaAp Lz6AD608HPAWbMC8RdrxV3W1uRdyUOT0vmuHD+NyIdynbxS9tnId4LsqYXD+ZYNWNCFd 3W3bNUy7CPPorF7hXj77S0mbYCgOSXS2Oclw76K6Lq3NNKxyLhKSW4NlQob+cGcVOf8T B6PkA6cPJiHap1Xz+ISFUEQlrz+A1sfkmQqceYHn8wOmnBkpfSYDb8E72gopwSCXOPHt kYCLCnNPtiEXsTrn2mj3/9+zc3RyGItyjy6kl+oIZDlie6VodbSSmozzDX11xBfqefuS LLpQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FbYCwU4s; 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-174925-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174925-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-634103f6abcsi2145172a12.335.2024.05.09.13.47.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 13:47:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-174925-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FbYCwU4s; 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-174925-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174925-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 1EE22B20F8D for ; Thu, 9 May 2024 20:30:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9207D7FBC1; Thu, 9 May 2024 20:29:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="FbYCwU4s" 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 26FEC81ACB for ; Thu, 9 May 2024 20:29:37 +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=1715286593; cv=none; b=Vf9KR7tcUgw5kemI4FIL88iDv1aNg5YxFrVBZ/OcJZ5SJn50oFG9sOJAD2KTpaC2GT6PsoxrBF+mvNCzjWNeF0eWPlSP5Q8+CILXdjkGJ5sIRWQGp7c+M6Z63BD9P5qAkIg7pEqKFgy1gMKAJOIvaibyLvcs8cZ218WhuSvwpBs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715286593; c=relaxed/simple; bh=5bx11u028iFBoNUssXgxzpOSCuhJJkvpiX5GDQ7rks8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-type; b=tfEETYwk1RCZwRAGO2x4pEmgnb4uMULXxSZES4UtD8yfw4SAymD+DHo+OdYSv+GIcVZIuQ0zS+678mODf/uGaAKABbHPMnbPVof3kzEgzFtc/395ZlbdtRTLgfwOh8HZMX7vZFMAirW4t8xpp0c5Qd11v3CJOt7BGHk8E136WTA= 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=FbYCwU4s; 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=1715286576; 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=u1GlnK+q8TY5qrTbDgo/iJ68l+D3mRMbytA6rZ1uGIY=; b=FbYCwU4syjmVTHqxj7rNAAyjccVX4Kc96OVw8Pt0QdTNZv/viIZFVTdOkEppO3V/QkK076 3idjdaCrznMDmqYLALf35HbjRH7FZurSJ0AVCTmsAaB362ONTAiYH1waSbPZODSrXaUTfU hCQ36GrgpnB4y8lBqoVLtQXVHiMxIRg= 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-594-bcSsqWtJOcuOP4joco4laQ-1; Thu, 09 May 2024 16:29:35 -0400 X-MC-Unique: bcSsqWtJOcuOP4joco4laQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (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 AEA7A8030A6; Thu, 9 May 2024 20:29:34 +0000 (UTC) Received: from jmeneghi.bos.com (unknown [10.22.16.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 30C4620A4CC4; Thu, 9 May 2024 20:29:34 +0000 (UTC) From: John Meneghini To: kbusch@kernel.org, hch@lst.de, sagi@grimberg.me, emilne@redhat.com Cc: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, jmeneghi@redhat.com, jrani@purestorage.com, randyj@purestorage.com, hare@kernel.org, constg@il.ibm.com, aviv.coro@ibm.com Subject: [PATCH v2 3/3] nvme: multipath: Invalidate current_path when changing iopolicy Date: Thu, 9 May 2024 16:29:29 -0400 Message-Id: <20240509202929.831680-4-jmeneghi@redhat.com> In-Reply-To: <20231107212331.9413-1-emilne@redhat.com> References: <20231107212331.9413-1-emilne@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.4 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 02baadb45c82..d916a5ddf5d4 100644 --- a/drivers/nvme/host/multipath.c +++ b/drivers/nvme/host/multipath.c @@ -862,6 +862,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