Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1798032lqa; Mon, 29 Apr 2024 22:10:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU4o8yZmXLQan8Qgmi8HI4Btec17ZJ6lSwLPnwx8E2h1NDjHNHbmAodyU58TocQpuOEiwK/HjQrNUP4GupMMJeyCae+L6oV+PIQqNn9qA== X-Google-Smtp-Source: AGHT+IFrBBp5zZj9YXD9y23T/wAlfSqEbbFIoX6vJdpWNFFfyAAtgTDUrqZKO0ERBF2yh3ADNC95 X-Received: by 2002:ae9:ec1a:0:b0:790:c803:7425 with SMTP id h26-20020ae9ec1a000000b00790c8037425mr8348085qkg.2.1714453834811; Mon, 29 Apr 2024 22:10:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714453834; cv=pass; d=google.com; s=arc-20160816; b=Yqp7+4Tco3JG/Ejmy0DwDWgPFzJLOaA077WhVhC5S2S3CeFnMTrsnVHs3ubHezrQ9g 1jgQIUBqXDlD9TeeMvOJE8o1yg9JzA7Ktpl6YhCQuf778jQVEUWluJoawL8db3lMIy38 5kMP5ocCVSa4PZDYgdxC63hwYkL/K5ZgZ7FPPjjoJpkbAYQYLDVMJRONK+2HEHJM3Kd/ ZSqKU446EPe4VxAbAelptPWUlhUhKRWGNMa6gm4lb3waWUYtxeC1UsgnLf02XJ0VA6/E e0JJvznzOgzqulSH7b/Hg9yMKKRXXIpv+v74WEXONcQAhYMiEqEmIGAqcWmHs/H4xaqU 2GXw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=Nm5KSte9EtNP2GBwmXuE8/J8iLTK3PcKydXJnqqMM4g=; fh=GiTbiFYNCw591V3O+FRe2LlOPtXSaQXzTcODU4zTzaE=; b=mrIRiWP/wYbrr0t9WRtZIX7IYJpsltZpbJLgNyXm6A9wPoPhOUq1bferxrzh+byuiJ 5P17ap8omdabfOD25uo059+aLyfpGT4Mxo760riz44PFwUvs4l/qJGAvbGkmGQ27LfbG kH0sNAizzD5kjkYd3h5IBEDfbR0OMzGaJgjyS2xN5MCtPRhMT2QjwxQ4LbMmOzoWaSwM S2a6pFpNJ6e0rbfGL4MAet/+uPS8KvvN1cK5T1AuouqGADbdSjy2cybgovhcTsgVaDLa IkiIBN6mtBs6CM+VpkjejpRxYgaBmGeE61GXI0tuNS+k4GkK5zERZclRJ7AZw+LpcBNp nTfQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="MkxC/Khp"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-163351-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163351-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id op50-20020a05620a537200b0078f0ee4b1d4si27788597qkn.506.2024.04.29.22.10.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 22:10:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-163351-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="MkxC/Khp"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-163351-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163351-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 7B3E61C21B42 for ; Tue, 30 Apr 2024 05:10:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5B93A17579; Tue, 30 Apr 2024 05:10:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MkxC/Khp" Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (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 D85A014AAD for ; Tue, 30 Apr 2024 05:10:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714453827; cv=none; b=a5PTyHM44BP1V5V5OEXhGp9uYveDwm93PXu0ZkTdVfGa9Omwq0x+HGigeAf2BR3HcnB+Ua+od+dChMhCqhlNXGLsYDIoBRKiwq7lDIIkUIfvuHEDby1wUeDU+DINw4138GOm/NwlF0IzCyArG+9muXyjHGXbvYMCUw+5GRUXU9s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714453827; c=relaxed/simple; bh=SzgFI/v7Mph6bz64Ohfi7yL2xE/FtnoTbuqrAwoH0Ww=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=U34dwmf7Yz5mepS2Qqco22Vw+cUqSILa9mq2C/8lm1MDPxzKl3U7iNx3f2Q0BI6WM1yE+YF6htSw/TvfMP+CeCiANqnB0qS+554SZihJ7RnflfU7ydTxckBiYYNAi4Rt+D+nVBfcJPl0/3LEu6DZ/HxI4vXBl+YfjPYglDx+bzI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=MkxC/Khp; arc=none smtp.client-ip=209.85.167.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-f45.google.com with SMTP id 2adb3069b0e04-51967f75729so6215621e87.0 for ; Mon, 29 Apr 2024 22:10:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714453824; x=1715058624; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Nm5KSte9EtNP2GBwmXuE8/J8iLTK3PcKydXJnqqMM4g=; b=MkxC/KhpfMFWT4uW4IrHjP+iMcb0BZWYnvek7AM9hKYzmMSI87mWWYyZWsEBZFBfvN ToVeITf6ZZW03E/3ZoVqBLWgzwkyaReELSIMmIn7Kr+2ZYCxhNNUMOfV8FGbce6Sn3Zz 9ToA/qdRMpf+9QRQX9KWvT49IYDH+AtPYt9lFgWgOOQOlPgrMMxkLP8MKBi/WxR7WzjF JH9JpREE03yzdRHIriZtKBoaF5Rp5JajWUS7PxZTo3IrUSFymMpJMALyAjVan8VfW00G ec3EXMu/jkU5XLFSPntM55ulCmo6TE0qrtlX0N6fruPvwPGZZ+wgepzXKJoEiUdydPA1 nWZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714453824; x=1715058624; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Nm5KSte9EtNP2GBwmXuE8/J8iLTK3PcKydXJnqqMM4g=; b=vOPXJxqSzDU+B/NmjjTOvLG1bKCyTcOx8NOxcaojx7ksn2bfIh+rtHf0wQKn5IE77Z xCKtfemzoT/JReFpG4rtgZBiogczo3a2vz2Vd//lsdz/fA8jb5c+k+lFbvMDZUOnqFpr g+nA3FvyLNdU+zkok+GQXIwhyIcl6aRzGFbpM/vPpyaaArF9xd/sNymbc5gXea4jUCTd jax1d3AOkU+uothI70VP2qY7DxWYr/fLGkLli2MukWpd1JBHq9YyfIWwwvw5MHTybQCZ ATe5XLvf6VhIMxh6P7mZyLR2xH7nmVz+gCjrsFXg5i4iQyn4zCp26NIJxgtMGTn8cHq/ ZpFA== X-Forwarded-Encrypted: i=1; AJvYcCW8laSuJPGRfKBOJphaqemDsav+loAvvztX9xK/ks33s26ND9GZ0rfNZmyHJ7ultAtxurOFRmZEHymE7uw5YGx/jlXKi9HkNpPviiu0 X-Gm-Message-State: AOJu0YwpRzc33PEM3TmZkyyi10h1gDzWHiJnEh5Mx8uVjEZd73izgQ9d Feue/c4tM0onbA9zybpT8gN0ziW2fBc5dY3TO6bVghINgASfGlwzeUi8WEpmoHDoWFSoW+PA267 EYqtMDWaszmdarlxHdp36DPzvXds= X-Received: by 2002:a05:6512:3294:b0:51b:567e:7ea4 with SMTP id p20-20020a056512329400b0051b567e7ea4mr998553lfe.26.1714453823614; Mon, 29 Apr 2024 22:10:23 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240430021753.385089-1-brookxu.cn@gmail.com> <8379e4a9-3114-4d35-9d1f-81ca61351b85@nvidia.com> In-Reply-To: <8379e4a9-3114-4d35-9d1f-81ca61351b85@nvidia.com> From: =?UTF-8?B?6K645pil5YWJ?= Date: Tue, 30 Apr 2024 13:10:11 +0800 Message-ID: Subject: Re: [PATCH] nvme-fabrics: use reserved tag for reg read/write command To: Chaitanya Kulkarni Cc: "linux-nvme@lists.infradead.org" , "hch@lst.de" , "kbusch@kernel.org" , "linux-kernel@vger.kernel.org" , "axboe@kernel.dk" , "sagi@grimberg.me" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Chaitanya Kulkarni =E4=BA=8E2024=E5=B9=B44=E6=9C=88= 30=E6=97=A5=E5=91=A8=E4=BA=8C 11:47=E5=86=99=E9=81=93=EF=BC=9A > > On 4/29/2024 7:17 PM, brookxu.cn wrote: > > From: Chunguang Xu > > > > In some scenarios, if too many commands are issued by nvme command in > > the same time by user tasks, this may exhaust all tags of admin_q. If > > a reset (nvme reset or IO timeout) occurs before these commands finish, > > reconnect routine may fail to update nvme regs due to insufficient tags= , > > which will cause kernel hang forever. In order to workaround this issue= , > > maybe we can let reg_read32()/reg_read64()/reg_write32() use reserved > > tags. This maybe safe for nvmf: > > > > 1. For the disable ctrl path, we will not issue connect command > > 2. For the enable ctrl / fw activate path, since connect and reg_xx() > > are called serially. > > > > Given the complexity of the scenario described above, is it possible to > write a script for this scenario that will trigger this and submit to > blktest ? not that this is a blocker to get this patch reviewed, but > believe it is needed in long run, WDYT ? Thanks for you reply, I can easily reproduce it in my VMs by following step= s: STEP 1. In order to reduce the complexity of reproduction, I reduce NVME_AQ_MQ_TAG_DEPTH from 31 to 8 STEP 2. Create a nvme device by NVMe over tcp, such as following command: nvme connect -t tcp -a 192.168.122.20 -s 4420 -n nqn.2014-08.org.nvmexpress.mytest STEP 3. Buind and run the c++ program issues nvme commands as followed: #include #include #include #include #include #include #include #include const int concurrency =3D 64; std::set chlds; int __exit =3D 0; void sigint_proc(int signo) { __exit =3D 1; } int main(int argc, char **argv) { signal(SIGINT, sigint_proc); for (auto i =3D 0; i < concurrency; i++) { auto pid =3D fork(); if (!pid) { while (true) { system("nvme list -o json 2>&1 > /dev/null"= ); } } chlds.insert(pid); } while (!__exit) { if (chlds.empty()) break; for (auto pid : chlds) { int wstatus, ret; ret =3D waitpid(pid, &wstatus, WNOWAIT); if (ret > 0) { chlds.erase(pid); break; } } usleep(1000); } // exit for (auto pid : chlds) kill(pid, SIGKILL); return 0; } STEP 4. Open a new console, running the followed command: while [ true ]; do nvme reset /dev/nvme0; sleep `echo "$RANDOM%1" | bc`; do= ne We will reproduce this issue soon. > > > So the reserved tags may still be enough while reg_xx() use reserved ta= gs. > > > > Signed-off-by: Chunguang Xu > > --- > > -ck > >