Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3683684pxb; Mon, 1 Feb 2021 01:43:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJyv8DlcGOq5k85l16d37u2l2yHf7YoTw/QuOYsXeAWGXtCHy7RK47qhLAXF73kjGCJg0BfI X-Received: by 2002:a17:906:1348:: with SMTP id x8mr16476703ejb.81.1612172580844; Mon, 01 Feb 2021 01:43:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612172580; cv=none; d=google.com; s=arc-20160816; b=tNO+yahFS2m33bCfRnQUI5wBlubZ863TUNJULL/jCGUWxruF41cs9KZ3xeOCaDmCAZ 1gRyVgugB34gNaZlOcVle5b+Tp72IWWW0RJHkrR52/BMMH6qPnHbR18esX9j18EeugZk uWaOFhr1qKSzwNuZ0OjEPTlfqrp2qlKde4dkU300LPiWsVucDrOjxGZruYCfBS64WriO /TCneYz52qx/bLyplewpYExUlG92AkZorOuSp2bpfCXmTBHDhr850mkzdTBiGLma5HU8 55IJFl80N8ivCmAd3AgcnOiIYHIGJDMYB8Ee8uBeJULFyq8wg2piS+FwuvHra8Q1SDvq 3e8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=BH9xjiZbh1GmUMP7tYzCkTNjbqAD6smfN3crfUZuLmg=; b=G5V9Ebm/mxcO0sJQYeZVVhq+aOWHAq+s7fpx+svHbFWMH2TOitv/qE7ubIzAvoT4dO EpbfkU7Wa/oVlGMZfU8e3Jm69aZVROnJ10JuvaV8GLbMpZAAhevc6T49K8bK4gydbwAs xrUfdhr22IVGUQxYMnMA8DNNbHwgsJleDec5DwcmBvyhMsbQc8AQ0FfDht44AKIWzW8q rWDf058gwuXKv/EQ/ebVhcgvY4W/tv+qNNriOcFd96sGbB0s9u9qsmn/1QGvyIKWWO0O fEZUMd5LlEn7mQxF3r+wbz4CCzPTFLf/+8tsgtftTH+/VAzIHc2IwHR2qProapswric6 id5w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qq23si9187235ejb.140.2021.02.01.01.42.35; Mon, 01 Feb 2021 01:43:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232884AbhBAJl1 (ORCPT + 99 others); Mon, 1 Feb 2021 04:41:27 -0500 Received: from szxga02-in.huawei.com ([45.249.212.188]:2977 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232648AbhBAJlZ (ORCPT ); Mon, 1 Feb 2021 04:41:25 -0500 Received: from DGGEMM405-HUB.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4DTjZj05Nwz5NJk; Mon, 1 Feb 2021 17:39:25 +0800 (CST) Received: from dggema772-chm.china.huawei.com (10.1.198.214) by DGGEMM405-HUB.china.huawei.com (10.3.20.213) with Microsoft SMTP Server (TLS) id 14.3.498.0; Mon, 1 Feb 2021 17:40:41 +0800 Received: from [10.169.42.93] (10.169.42.93) by dggema772-chm.china.huawei.com (10.1.198.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2106.2; Mon, 1 Feb 2021 17:40:40 +0800 Subject: Re: [PATCH v2] nvme-multipath: Early exit if no path is available To: Hannes Reinecke , Sagi Grimberg , "Daniel Wagner" CC: , , "Jens Axboe" , Keith Busch , Christoph Hellwig References: <20210127103033.15318-1-dwagner@suse.de> <20210128075837.u5u56t23fq5gu6ou@beryllium.lan> <69575290-200e-b4a1-4269-c71e4c2cc37b@huawei.com> <20210128094004.erwnszjqcxlsi2kd@beryllium.lan> <675d3cf7-1ae8-adc5-b6d0-359fe10f6b23@grimberg.me> <59cd053e-46cb-0235-141f-4ce919c93f48@huawei.com> <65392653-6b03-9195-f686-5fe4b3290bd2@suse.de> <81b22bbf-4dd3-6161-e63a-9699690a4e4f@huawei.com> <715dd943-0587-be08-2840-e0948cf0bc62@suse.de> <6ceff3cb-c9e9-7e74-92f0-dd745987c943@huawei.com> <114751ac-1f7d-ce5e-12c5-7d6303bdb999@suse.de> <47a1b796-9d91-5947-4bac-dd8f397041a3@suse.de> From: Chao Leng Message-ID: Date: Mon, 1 Feb 2021 17:40:40 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <47a1b796-9d91-5947-4bac-dd8f397041a3@suse.de> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.169.42.93] X-ClientProxiedBy: dggeme715-chm.china.huawei.com (10.1.199.111) To dggema772-chm.china.huawei.com (10.1.198.214) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/2/1 16:57, Hannes Reinecke wrote: > On 2/1/21 9:47 AM, Chao Leng wrote: >> >> >> On 2021/2/1 15:29, Hannes Reinecke wrote:[ .. ] >>> Urgh. Please, no. That is well impossible to debug. >>> Can you please open-code it to demonstrate where the difference to the current (and my fixed) versions is? >>> I'm still not clear where the problem is once we applied both patches. >> For example assume the list has three path, and all path is not NVME_ANA_OPTIMIZED: >> head->next = ns1; >> ns1->next = ns2; >> ns2->next = head; >> old->next = ns2; >> > And this is where I have issues with. > Where does 'old' come from? > Clearly it was part of the list at one point; so what happened to it? I explained this earlier. In nvme_ns_remove, there is a hole between list_del_rcu and nvme_mpath_clear_current_path. If head->current_path is the "old", and the "old" is removing. The "old" is already removed from the list by list_del_rcu, but head->current_path is not clear to NULL by nvme_mpath_clear_current_path. Find path is race with nvme_ns_remove, use the "old" pass to nvme_round_robin_path to find path. > > Cheers, > > Hannes