From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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 EE12B40DFC7 for ; Tue, 10 Mar 2026 13:34:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773149651; cv=none; b=EiQF8iJ8DEeHpuY95PTi3L5zy6fTmQ+6CNQzaQUwx43Ez+klLTyiZmljSTohKMbOFp/BLJsVpJM7/RyNJNpnPmaNwPysWqgh5/PWLH5DSbxKFG9sFtWlvP4HY4HeNLIa4jV1o8jT/1/wf593Ggg4v9sgv3mMupZvqZdkKE+k4CI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773149651; c=relaxed/simple; bh=VTkD031qPJOSGpZBGmc3+BQ8Cgl4lzlmo7twwWZLZW4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=RTeiVElJD48Yvjty/R8UxDI24Hcjk5slbsiLCTtt3nF9S0poZYuyGHAtzjFZjDX9BrnqkFSkpYVBJvP0ODkMVmqy1S5KrLbjIvCMBmROJ1mwH3Ka8FdFikjOB9xOMAP/1Q0iao/ItrvBt9UYuA30hM8Tn+9Br5MSJxjNwZP937Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=OLAACw8J; arc=none smtp.client-ip=209.85.128.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="OLAACw8J" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4853f2826f7so19452225e9.1 for ; Tue, 10 Mar 2026 06:34:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1773149648; x=1773754448; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=n1929U+2B2jsF7SJZ2DGFfE2DUFLxK1sQO/tNgjnO0w=; b=OLAACw8JCPcjIbWK0+Pg1tYwzzixgcugefVbTyfBQ0F8k9dYci/v+U3ct5/VAMtInn CHun2AV8LInHdn6K9eVXtbM4pjdVmfWmTfzvy9o8QNrU/PsQ9CcJwKqKEfPK3Jtkpi1s HyNqAx7PVS40yGHKVB3XHRfryNGoVvHJIl97s7gomHv3eCsSFQdDXP19NyiXWypS1wTp aW6B11xrfVnIBa4umQNRLN9sf8mF0fnOIHmP57HitmyubLQ6z4V0F+R+kSPg2dEARSPj Aj0dV2uEfw7I7mtLaI5/ReHQizU9wAPau2kNjV3n4Yaljaia/eLtecq/X+44lxmXvbv/ pspQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773149648; x=1773754448; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=n1929U+2B2jsF7SJZ2DGFfE2DUFLxK1sQO/tNgjnO0w=; b=FZFvm5M5Qc8dVgxA9mzaoN4fmPy1Gvzu3g9mgnCkvO4NaiTWl/T1EUz9YhXODPdVqd GQmfn+YakSPhykyMyQQcRH7zth/F5Us/hgAIO0iqXyEcqWRIDEcQfniVMrszBPzmKoMV WjdOM9CCgeSr7/yWwu0CYUVD8VigJHM6+oJqPf5Asmix1cIUUSLNWM78rPdhlNrS9ukH HYwZ5/gUeD+QjfV52SvxPY8LYiIS9YBBCMqSCZIDPMEAYy4olBLuK4CIB+FvmI1pS/rx mhEw4bFIlZ3Jh3WPzR6Y4HTgnwgH6dSObp1AW3NGVXw2LZvMD5IYQxZay6teErn8nGaj As6A== X-Forwarded-Encrypted: i=1; AJvYcCUBPLuOM2QHYKEAq4LByvnJ4BJNa284Dnw7jE/7HjMjDq2e/v74Luwys5VqA3KO1s/yl1jNWIWCNsg+6/Q=@vger.kernel.org X-Gm-Message-State: AOJu0YytPcG2wyDArwV2sismP4/u3dFkuChB35ZhkFg0hVqgtGNIAh56 Lp+J64/hWm2qGLFQRyupqUjEbCo/At7DEhofWo71OohURiotu8GEIfMGz8HA5T9IKPg= X-Gm-Gg: ATEYQzzHqpldEJrr2+ZAVUi0W038pl8CfxhQri7irMoz/bu4xuYTkMwBYI1tjCfMIpY 5UHNw7b/Sf16oKSA87XZMS+D8pAVhuV2wlZJ/mlrM5qMI/9Wwb15RKpXGDTEBKMLll5EHpAl5mb 9Wl2xEkxDdVOGT3HQQBJ09h6pUKcsvlZWG8IYaJZrDKEEe+8/m96ZyYDxhtmFlJABH36hlrEB2W d+F8xkQNv/Kg57RLLPLwfTedmal+GoRmfFC2Q0SsFYnietz5d4MF9AjbUu0tIQTL+pJfLIXPZhc hh3LRfmChY/KnTMgulOhZUUWFK7q3jZjLxuEwMHHMvNRZpazKbNZSierZXuM7eSytl/3KCb8mhm fiodUPp5hkU7yVr/qxcgeoyZGtA/+LHwZLD+t3WTVYfKD1yeZFgc2yTg1WX5aML0s9+dC4XZziY fUZxSCz/48262Ck3rhCDlRhQjOeK6yilyeJuynu8qzyra5qPFGWfo3QuWp X-Received: by 2002:a05:600c:8b86:b0:485:3473:d4a1 with SMTP id 5b1f17b1804b1-4853473d6dcmr153991525e9.34.1773149648155; Tue, 10 Mar 2026 06:34:08 -0700 (PDT) Received: from ?IPV6:2a07:de40:a101:3:ce70:3e6f:3b9c:9125? ([2a01:4a0:2e:ffff:ffff:ffff:ffff:ffff]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-439dae2b9ccsm35566642f8f.19.2026.03.10.06.34.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 Mar 2026 06:34:07 -0700 (PDT) Message-ID: Date: Tue, 10 Mar 2026 14:34:06 +0100 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 7/8] scsi: scsi-multipath: Issue a periodic TUR per path To: John Garry , hch@lst.de, kbusch@kernel.org, martin.petersen@oracle.com, james.bottomley@hansenpartnership.com, bmarzins@redhat.com Cc: jmeneghi@redhat.com, linux-nvme@lists.infradead.org, sagi@grimberg.me, axboe@fb.com, linux-scsi@vger.kernel.org, michael.christie@oracle.com, snitzer@kernel.org, dm-devel@lists.linux.dev, linux-kernel@vger.kernel.org, nilay@linux.ibm.com References: <20260310114925.1222263-1-john.g.garry@oracle.com> <20260310114925.1222263-8-john.g.garry@oracle.com> Content-Language: en-US From: Hannes Reinecke In-Reply-To: <20260310114925.1222263-8-john.g.garry@oracle.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 3/10/26 12:49, John Garry wrote: > To allow the initiator know of any ALUA configuration changes, issue a > periodic TUR. > > multipathd does something similar for dm-multipath in terms of issuing > a periodic read per path. > > The purpose of the TUR is that the target can update UA info in the TUR > response and the INI can handle it, but currently we don't for SCSI > multipath. > > Signed-off-by: John Garry > --- > drivers/scsi/scsi_multipath.c | 36 +++++++++++++++++++++++++++++++++++ > include/scsi/scsi_multipath.h | 1 + > 2 files changed, 37 insertions(+) > > diff --git a/drivers/scsi/scsi_multipath.c b/drivers/scsi/scsi_multipath.c > index 0c34b1151f5bf..2b916c7af4bd7 100644 > --- a/drivers/scsi/scsi_multipath.c > +++ b/drivers/scsi/scsi_multipath.c > @@ -4,6 +4,7 @@ > * > */ > > +#include > #include > #include > #include > @@ -124,6 +125,7 @@ static void scsi_mpath_head_release(struct device *dev) > container_of(dev, struct scsi_mpath_head, dev); > struct mpath_head *mpath_head = scsi_mpath_head->mpath_head; > > + WARN_ON_ONCE(kthread_stop(scsi_mpath_head->kua)); > scsi_mpath_delete_head(scsi_mpath_head); > bioset_exit(&scsi_mpath_head->bio_pool); > ida_free(&scsi_multipath_dev_ida, scsi_mpath_head->index); > @@ -514,6 +516,29 @@ struct mpath_head_template smpdt_pr = { > .device_groups = mpath_device_groups, > }; > > +static void scsi_mpath_cb_ua_thread(struct mpath_device *mpath_device) > +{ > + struct scsi_mpath_device *scsi_mpath_dev = > + to_scsi_mpath_device(mpath_device); > + > + if (alua_tur(scsi_mpath_dev->sdev)) > + sdev_printk(KERN_NOTICE, scsi_mpath_dev->sdev, > + "%s: No target port descriptors found\n", > + __func__); > +} > + > +static int scsi_mpath_ua_thread(void *data) > +{ > + struct scsi_mpath_head *scsi_mpath_head = data; > + > + while (!kthread_should_stop()) { > + mpath_call_for_all_devices(scsi_mpath_head->mpath_head, > + scsi_mpath_cb_ua_thread); > + msleep(5000); > + } > + return 0; > +} > + > static struct scsi_mpath_head *scsi_mpath_alloc_head(void) > { > struct scsi_mpath_head *scsi_mpath_head; > @@ -548,6 +573,17 @@ static struct scsi_mpath_head *scsi_mpath_alloc_head(void) > goto out_free_ida; > } > > + scsi_mpath_head->kua = kthread_create(scsi_mpath_ua_thread, > + scsi_mpath_head, "scsi-multipath-kua-%d", > + scsi_mpath_head->index); > + if (IS_ERR(scsi_mpath_head->kua)) { > + put_device(&scsi_mpath_head->dev); > + goto out_free_ida; > + } > + > + set_user_nice(scsi_mpath_head->kua, 10); > + wake_up_process(scsi_mpath_head->kua); > + > return scsi_mpath_head; > > out_free_ida: > diff --git a/include/scsi/scsi_multipath.h b/include/scsi/scsi_multipath.h > index 7c7ee2fb7def7..d30f2c41e17de 100644 > --- a/include/scsi/scsi_multipath.h > +++ b/include/scsi/scsi_multipath.h > @@ -30,6 +30,7 @@ struct scsi_mpath_head { > struct mpath_head *mpath_head; > struct device dev; > int index; > + struct task_struct *kua; > }; > > struct scsi_mpath_device { Please, don't. We should _not_ go into the business of doing TUR path checkers. Path checkers turned out to be a major issue for multipathing, and are mostly pointless for things like FC where you get reliable path information via RSCNs. Additionally I would advocate for scsi-multipath to be a _simple_ implementation, restricting to the most common scenarios. Namely implicit ALUA only and reliable fabric notifications. If you have anything else, fine, use dm-multipath. Cheers, Hannes -- Dr. Hannes Reinecke Kernel Storage Architect hare@suse.com +49 911 74053 688 SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich