Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp927575img; Mon, 18 Mar 2019 18:23:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqyNTX39GiZ6LIHUnAfx50nfi/wR0aoBw4cQVYjagKwVLFgX8Ft5wYlMqLJvVlcKRjS5kzRy X-Received: by 2002:aa7:9313:: with SMTP id 19mr21831691pfj.173.1552958600671; Mon, 18 Mar 2019 18:23:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552958600; cv=none; d=google.com; s=arc-20160816; b=SWhXRvZ5lanvTiF4EUwspPeDp7r6e+PTLsLuHAp7+nhkHdFSPH8pwcYrt+xDhPREcZ Yiju3vhhNbqt5zk7P9TvO44gqWdMvYXSGMbadsFJn1E3DuKJXh51FxKbdI09tF9LaTOa ldE0Ukownfqo70wO5LWt9G9oPNd4NuzThdCDnrxFU52YtirAjCm5kpCJMcKYP98+9Nas +rd55SbhlCM7qAQdbOEzIfHP22pFIt1y9WJBWkHgCwc+GKMhJCp/UD6hstA1AsVa6iTY BGtWsfS5i3KZmY1SXrSR47ZsLpyeYzxuwRtoNxQKQ0yQHtGEVMuRbSsAuBPL6PO2w+6W G7og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=vu5KNKQNVWCeTbLREMTDuW5pfSLe3uuLgNbKbCc9gBs=; b=bpD0v9ls5IuNph/iF0t7l2q5Tv5CHXp/5Bcu2E9aYQUqqn8COxWwFUrZ6EDkKWiGfh AiVbJHq4kesrDJ0cMKXtTRWDCZoealt0S3LWuHKOGpkqBmjc1WTAb4wgFM/wMwqBMFK+ 9lZKe1JurJQhw74AxCdwEhn5NRwPGlPfPQfFO++37xLKmtqoLkr2oqnkFzcrRGYToXaN alZvU8Q4S9vzggVfk0tMiYi0FsyNWIvYQ4onIMySYBzmfF+91JY4fC01rdETIzSoZkFB /jy0GO4eklMZfcey6/qPIbF7ratbL1PBq96lV3Adovo60/9Aq4FB+OfXee/Hs3frKNfN I7xQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=xJJ0zNmQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m15si9955658pgv.212.2019.03.18.18.23.03; Mon, 18 Mar 2019 18:23:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=xJJ0zNmQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726898AbfCSBWZ (ORCPT + 99 others); Mon, 18 Mar 2019 21:22:25 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:38030 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726817AbfCSBWZ (ORCPT ); Mon, 18 Mar 2019 21:22:25 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x2J1J4Ea192372; Tue, 19 Mar 2019 01:21:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=vu5KNKQNVWCeTbLREMTDuW5pfSLe3uuLgNbKbCc9gBs=; b=xJJ0zNmQ0y1KUGxtwRVPHxth6g4ldJsXP/F+gq9fJV4PeGrQfXyAAwBEV4XZ5WJCY/m/ 3wN28ZKpH07ao6bdywBeEwHGiFE+gc3EhBiXy0J5bwATK/p1cc6WNRj9J0/+aJSVuGhv i0ZcWP6N5gcXf91PlHhQiND7611mjhOUljhHb+De8t5AZjs1qQBbMx9rIUnE+vkG+9lt /SO9bzaSqmkX5li0P/J/uFFSx+ShkXsc/qKVGqQggxJKZ26KHAYYkySfvcAomL/eVhp5 Z/j8SltVEFViOPi6Ey7+wR5SWlAp+pMbbvnnXviTDXtsmmv8iyn3Vun8DYPOSf44Uldy XA== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2120.oracle.com with ESMTP id 2r8ssr9nj2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 19 Mar 2019 01:21:59 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x2J1LwjL017977 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 19 Mar 2019 01:21:58 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x2J1Lu8s022738; Tue, 19 Mar 2019 01:21:56 GMT Received: from [10.182.69.118] (/10.182.69.118) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 18 Mar 2019 18:21:56 -0700 Subject: Re: [PATCH 0/8]: blk-mq: use static_rqs to iterate busy tags To: Bart Van Assche , axboe@kernel.dk Cc: linux-block@vger.kernel.org, jsmart2021@gmail.com, sagi@grimberg.me, josef@toxicpanda.com, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, keith.busch@intel.com, hare@suse.de, jthumshirn@suse.de, hch@lst.de References: <1552640264-26101-1-git-send-email-jianchao.w.wang@oracle.com> <1552930085.152266.36.camel@acm.org> From: "jianchao.wang" Message-ID: <3cd58454-eda3-de9a-0eed-b6a7edbce28f@oracle.com> Date: Tue, 19 Mar 2019 09:25:04 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <1552930085.152266.36.camel@acm.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9199 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903190008 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Bart Thanks for your kindly and detailed comment on this. On 3/19/19 1:28 AM, Bart Van Assche wrote: > On Fri, 2019-03-15 at 16:57 +0800, Jianchao Wang wrote: >> [2] https://urldefense.proofpoint.com/v2/url?u=https-3A__marc.info_-3Fl-3Dlinux-2Dblock-26m-3D154526189023236-26w-3D2&d=DwICAg&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=7WdAxUBeiTUTCy8v-7zXyr4qk7sx26ATvfo6QSTvZyQ&m=_8Zz6iRpso8g7WlZ-WB50qqNkI2X2GRfySSBWyFKuI4&s=ZVNqSClQ_47hVGJpSrF5rbTh3X32cAlY-GFF2BPkGx0&e= > > Hi Jianchao, > > That is a reference to the "BUG: KASAN: use-after-free in bt_iter" issue. > I think that issue can be fixed in another way than modifying all code that > iterates over tags, namely by adding an rcu_read_lock() / rcu_read_unlock() > pair in bt_for_each() and bt_tags_for_each() and by changing the calls in > blk_mq_free_rqs() and blk_free_flush_queue() that free the data structures > used by the tag iteration functions into kfree_rcu() or call_rcu() calls. Do you mean this patch from Jens ? https://marc.info/?l=linux-block&m=154534605914798&w=2 + rcu_read_lock(); sbitmap_for_each_set(&bt->sb, bt_iter, &iter_data); + rcu_read_unlock(); The busy_iter_fn could sleep for nvme blk_mq_check_expired -> blk_mq_rq_timed_out -> q->mq_ops->timeout nvme_timeout -> nvme_dev_disable -> mutex_lock dev->shutdown_lock Thanks Jianchao