Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp492979imm; Wed, 15 Aug 2018 00:26:13 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzVQoIh3sS+rOye4uZQE7AFiQjIEXeSp5X5dyVEwish/LRxtLPTwWKiR0APixEIEkjuU8PW X-Received: by 2002:a62:fc5:: with SMTP id 66-v6mr26976256pfp.237.1534317973648; Wed, 15 Aug 2018 00:26:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534317973; cv=none; d=google.com; s=arc-20160816; b=sl43fYMKpvun8aAjskKMJbyLsYQS0QkJQfRliyKpo67IcBvvbm/rALqQHJjZJrgjc7 +gCf6xdW9F3BlXkV1JnCdMfhN7ZchU2TOR6f2IqKbOBJ8+q7i90WFTUHyjl4Hncfmkgf 183AKpW1tZzIa4wwa/VyxDgAPIjGaPe+A+KRPJZh5LGl9QIvEryaDuJWKhVPitwWcVHB WTOqWsJxW3Qoclukai3X2RnaYvuhGFI6CbKaEna+urCFi0d/QTKBiq82eiyZ3FAWHE4y t7eYQvPirnWAi4Mkp5qkAMdj7RAShqWb6PgrNNFT3zMTqJl7yUGRwgALqvnuNijDsASe XZNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=qM7A7k/0UYrfhKgReQr5Qa/DDuDuBfPg5nNMs2SEYNw=; b=Y9cinULFqky4clm7gnJ9f78BZCZ6YhFK+1bqsQJGvmMBwgeiT5BiO4lnN9nO7u6xL4 DmdpJMPsf4fNbufC6CH2sQqLuzs3bmYAcm3uu2SKkVhZuw1D3/sNy027CL3SGhAGUCh4 Y2pEoKFFWdLvoINKBsrELNoSq1Yo6yllK6f41nGDACYEL3KJCPYJ36hWYig4T1IlE/C4 Kx3h4TPIXg3wKbz0Bqqq0phpb5GhhrEfj2Yy4kCfpCumn/uhuPNpqednuWrgvoM6TGgS JibnSbpcje0bpEe8fIgmv+uH8JUKcf7emosrKpzY06t7ErcRuVNwMt4FYdtuQi/EHt5w qAAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=InA33Hz+; 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 j135-v6si26541124pfd.207.2018.08.15.00.25.58; Wed, 15 Aug 2018 00:26:13 -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=InA33Hz+; 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 S1728814AbeHOKOz (ORCPT + 99 others); Wed, 15 Aug 2018 06:14:55 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:36664 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726628AbeHOKOz (ORCPT ); Wed, 15 Aug 2018 06:14:55 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w7F7Nmr5184661; Wed, 15 Aug 2018 07:23:51 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id; s=corp-2018-07-02; bh=qM7A7k/0UYrfhKgReQr5Qa/DDuDuBfPg5nNMs2SEYNw=; b=InA33Hz+EF/Qp4M4XpE3iXEneHy0Rl7rj/5CGWxZ63tpFUQJcbzSZUjONhwtRFzlXabH rMuTXwtdA5Am6mHYH7VqdujOFrwlKjyO7d3o4F3v8ll3adQap1Ll9Wtqt8R1TM3Vyv/D xzhIDlpHpJU6GW4oW9gotPQvcyck23eo/tKbR+lrYB+4nhwDtp9c1iF/mWmsa3ZCqN0j 0ucysGzzMdKtgrNgrY1TUf1HZbVPE2oasHmlVOc4Zz50E5IW4GMWCxXpuUFwylV1XZCW m5Zpe+pzDB1TkrmL3hbZZwoWEY+KcKEJdvL2sGz4jZyMhIxJ2T6tmNOb4szAp9V7n6fJ dA== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2120.oracle.com with ESMTP id 2ksqrpbdqa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Aug 2018 07:23:50 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w7F7NnMa002593 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Aug 2018 07:23:49 GMT Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w7F7Nknc001910; Wed, 15 Aug 2018 07:23:48 GMT Received: from will-ThinkCentre-M910s.cn.oracle.com (/10.182.70.254) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 15 Aug 2018 00:23:46 -0700 From: Jianchao Wang To: axboe@kernel.dk Cc: tom.leiming@gmail.com, bart.vanassche@wdc.com, keith.busch@linux.intel.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/2] fixes for the updating nr_hw_queues Date: Wed, 15 Aug 2018 15:25:13 +0800 Message-Id: <1534317915-5041-1-git-send-email-jianchao.w.wang@oracle.com> X-Mailer: git-send-email 2.7.4 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8985 signatures=668707 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=762 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1808150081 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Two fixes for updating nr_hw_queues. The first patch fixes the following scenario: Kyber depends on the mapping between cpu and nr_hw_queues. When update nr_hw_queues, elevator_type->ops.mq.init_hctx will be invoked before the mapping is adapted correctly, this would cause panic in kyber. The second patch fixes the following scenario: part_in_flight/rw will invoke blk_mq_in_flight/rw to account the inflight requests. It will access the queue_hw_ctx and nr_hw_queues w/o any protection. When updating nr_hw_queues and blk_mq_in_flight /rw occur concurrently, panic comes up. Jianchao Wang (2) blk-mq: init hctx sched after update cpu & nr_hw_queues blk-mq: sync the update nr_hw_queues with part_in_flight block/blk-mq.c | 40 ++++++++++++++++++++++++++++++++-------- block/blk.h | 2 ++ block/elevator.c | 20 ++++++++++++-------- block/genhd.c | 10 ++++++++-- include/linux/blkdev.h | 4 ++++ 5 files changed, 58 insertions(+), 18 deletions(-) Thanks Jianchao