From patchwork Wed Aug 31 22:03:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 9307945 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3F0FE607D6 for ; Wed, 31 Aug 2016 22:18:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 20A91291F8 for ; Wed, 31 Aug 2016 22:18:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 152F7291FD; Wed, 31 Aug 2016 22:18:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AA5D6291F8 for ; Wed, 31 Aug 2016 22:18:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760036AbcHaWSm (ORCPT ); Wed, 31 Aug 2016 18:18:42 -0400 Received: from mail-dm3nam03on0058.outbound.protection.outlook.com ([104.47.41.58]:12704 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1759519AbcHaWSc (ORCPT ); Wed, 31 Aug 2016 18:18:32 -0400 X-Greylist: delayed 898 seconds by postgrey-1.27 at vger.kernel.org; Wed, 31 Aug 2016 18:18:32 EDT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sandiskcorp.onmicrosoft.com; s=selector1-sandisk-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=PZrdrIVqwqTFI6CCjK0A1nKswanMqLD2XulJw7PMFME=; b=Fs5ePpcOxGXNqvbp0v9i/2dIC3y2uOZnMc/cJ14gXuHl1szPJu1r7oALpaf+BAH070q61UEPY6jiyMs0VzjXQ8g0tqHecQCFPtczLIWnsq7J4jlB4kn9xfVyS6+MTTvNvYwSkoIZnG2jncTpSS19Ud0C2BISlrtMLSYBAfqeUIU= Received: from BY2PR02CA0099.namprd02.prod.outlook.com (10.163.44.153) by BY2PR02MB411.namprd02.prod.outlook.com (10.141.143.17) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.549.15; Wed, 31 Aug 2016 22:03:31 +0000 Received: from BY2FFO11FD009.protection.gbl (2a01:111:f400:7c0c::145) by BY2PR02CA0099.outlook.office365.com (2a01:111:e400:5261::25) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.609.9 via Frontend Transport; Wed, 31 Aug 2016 22:03:30 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) smtp.mailfrom=sandisk.com; lst.de; dkim=none (message not signed) header.d=none;lst.de; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.21 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.21; helo=milsmgep15.sandisk.com; Received: from milsmgep15.sandisk.com (63.163.107.21) by BY2FFO11FD009.mail.protection.outlook.com (10.1.14.73) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.587.6 via Frontend Transport; Wed, 31 Aug 2016 22:03:30 +0000 Received: from MILHUBIP03.sdcorp.global.sandisk.com (Unknown_Domain [10.201.67.162]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by (Symantec Messaging Gateway) with SMTP id 62.40.26959.B1257C75; Wed, 31 Aug 2016 14:54:38 -0700 (PDT) Received: from milsmgip11.sandisk.com (10.177.8.100) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.301.0; Wed, 31 Aug 2016 15:03:27 -0700 X-AuditID: 0ac94369-b97ff7000001694f-e1-57c7521bbf6c Received: from exp-402881.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id 83.1F.02783.C2457C75; Wed, 31 Aug 2016 15:03:27 -0700 (PDT) To: Jens Axboe CC: Christoph Hellwig , Sagi Grimberg , "linux-block@vger.kernel.org" From: Bart Van Assche Subject: [PATCH] blk-mq: Use non-atomic operations to manipulate the sw-ctx busy bits Message-ID: Date: Wed, 31 Aug 2016 15:03:24 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2 MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrMLMWRmVeSWpSXmKPExsXCddJ5ka5c0PFwg6MHxC3+7znGZrFy9VEm i723tC3WvX7P4sDiMbH5HbvH+XsbWTx232xg8/i8SS6AJYrLJiU1J7MstUjfLoEr41jDJZaC CcIVi75MZW1g/MrfxcjBISFgIrFkWWQXIxeHkMBSJombz28yQjg7GCVun7jI3MXICVa0b99z dqgqRolnk+8xgSREBGQlvu9+zQaSYBZoZpR4+/sDG0iCTcBI4tv7mSwgK4QFwiVOrJQFCfMK 2El82j4drJdFQFXixo5eMFtUIExi2t237BA1ghInZz4Ba2UW0JRYv0sfJMwsIC+x/e0cZpBV EgKTWCX+rV4MVi8koC5xcsl8pgmMgrOQtM9CaJ+FpH0BI/MqRrHczJzi3PTUAkNTveLEvJTM 4my95PzcTYyQoM7cwXj3ifchRgEORiUe3hcvj4ULsSaWFVfmHmKU4GBWEuEVDz4eLsSbklhZ lVqUH19UmpNafIhRmoNFSZzX7d6XMCGB9MSS1OzU1ILUIpgsEwenVAPjvo8lzafc0u7WSFs2 e2ebzWFut1j9NktwQlW67JPtOcdOX2S8w2P83WqzlpXVHsY9PBEmu02j5/XP2/NRi+VnecMq U8flmx0+pJtxiC9oeKxRfkRYqW9Xk9P5jbE6x+aG3fGpOpQ265Fk8eyFykyvVzD4K8zmvpI2 /dZ1NU8x1bcrkzL7Fm1SYinOSDTUYi4qTgQAM3/M1WYCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrFJMWRmVeSWpSXmKPExsXCtZEjRVc/5Hi4wYbfKhb/9xxjs1i5+iiT xd5b2hbrXr9ncWDxmNj8jt3j/L2NLB67bzaweXzeJBfAEsVlk5Kak1mWWqRvl8CVcazhEkvB BOGKRV+msjYwfuXvYuTkkBAwkdi37zk7iC0ksJhRYtNsRhBbREBW4vvu12xdjFwczALNjBKf Vn1gAkmwCRhJfHs/k6WLkYNDWCBc4sRKWZAwr4CdxKft08FKWARUJW7s6AWzRQXCJKbdfcsO USMocXLmExYQm1lAXeLPvEvMELa8xPa3c5gnMPLMQlI2C0nZLCRlCxiZVzGK5WbmFOemZxYY GuoVJ+alZBZn6yXn525iBIcWZ+QOxqcTzQ8xMnFwSjUwFm9Zo/dDTOSmSzWrZrOq90pDzuyV HFpXLxhPVIjOnn53FrM4z5cjVskyc60OxBfeDNngL8wSv4b5aqr669S9v5i2rqt16ZHkOleu drX1WJ3zde3HfFar9R24RRbWs2otyW4y3Pnh0/fb+/MvvC1eyPraeD9X1urWVx6fxP5FTe+M 8ha+aKOvxFKckWioxVxUnAgAaZZOdN0BAAA= X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.21; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(438002)(199003)(189002)(50466002)(305945005)(65826007)(47776003)(5660300001)(2270400002)(64126003)(4326007)(23676002)(83506001)(7696003)(2906002)(4001350100001)(97736004)(356003)(68736007)(7846002)(106466001)(110136002)(65956001)(54356999)(229853001)(65806001)(36756003)(189998001)(8676002)(31696002)(626004)(69596002)(19580395003)(87936001)(81156014)(81166006)(33646002)(19580405001)(8936002)(586003)(92566002)(53416004)(77096005)(86362001)(11100500001)(50986999)(230700001)(31686004); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR02MB411; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD009; 1:iF2Ia3LZS4GomH6No38/sELBL5PIM2GaR8ZfSrzhoSp2y08zbTvFFumMmJEkb5gxmZzoPQKhRCkAMxKl1HK69gW81v/9oN3LulFRM14tumnY06oj5KJR2ND6EmhlsXhi0372yhwwJzVp78aolAlM7WOCWgIT2bATVY5SYF977FXloZScb4VYzM3wMBMhgYalx7JZ29oejlOnTrmEkRmfhIXJIRnE1HALjAik9ycGqj94x6x4U0BLlPWveNLx6VWGLHK3d20dou8ndfrYOBtH0ZkTuehvBOysBq4gFx/uzvdDpO9OmK6ivT6PqxIYeRcFEOmIqv6poMLnFQvkbhOpeN38Qac2/1bhkUvUs3IoqIxfiwo3LJ6zDBfHst/MUG0OXAhu74mOrafioR7b6RdIbcLQtEMzdPQ2Kfe58L49ncgW0SOWDx+JgeIbRXFGsBvP2Dtrr/7Cczw2qEkLh0nmzhyWaZQwC8S+0uyCqiLlUfdJpDXmBtpb7O0oXxnkTracjiXWTSi5NW2oID2OrudgxQ== X-MS-Office365-Filtering-Correlation-Id: 37f874cf-1cfe-40f4-052e-08d3d1eaa4ea X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB411; 2:/JufNaLAevoQ04WIpd+nkW3xzrCj2pYr46meErGWieIjvxFmIoxF2uvSevoRRY+MLxI+YEp0YFbvf8PwAxFQdtE6U1oSpHw1lURKiV8M9Ob5Z4/qKLvYK7AQs4p2mX4J/yqlDn9aGPQ/aOp2Qw2f8+bLHd3IDmizPLPm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KZxPHDWOBhJmg=; 20:8df9ksEJc2aPTsLAesbyc6Q3PfErF5aMWJE6zMGchatWxUPvnn8W52HOFDPzKyXbbZQftq2woeUoa0Z03KqUikarwwjzIOcNie4yMsdJPYWJzIsv7L8w1nvoCPou4/D7gm9+/4uQ9yod6NfQLQI+DJQSqT6ncYuFFqAohyDfSeijnBfnshITreeZEzzRkR/goUNafnWqoapN3GWcJyAnHOWzYn56C5n2ZVtKtzxAfrjpX+tViFsB+Cd1UqNaKjGbn450yfvWGo0V3FMC1yZkA+89cYzY0Dh/SBgxqXmx/NhuQmcuDsiBivReH0tLCPTdRsqVdMAkVbVR3HMyt7t160GZQOtJk7RCv4oVndj+BjcLSVEFGzexpZVqNBHIIw7MCirVGmxd4xq3p6rxp0om24y3K3Qlr4w5hxPqx1RdCvatjAiMaoqUaldUtQOlZ/D2yf3qRALlquX7869mMhPFCPxnY9tTVlruXcuM88LaFdHMTgvQnusRLyykSDN9Y09V X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(13018025)(13016025)(3002001)(10201501046)(6055026); SRVR:BY2PR02MB411; BCL:0; PCL:0; RULEID:; SRVR:BY2PR02MB411; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB411; 4:Rc02ckX764tspGOpmkNLfPPJp5hxc29bAw6AwxYY3HUkeXF2mXxO7YlGdq25BRMIalwOUtf4Ln0IS8Y+ur+8M/w8k5ys/yaaBrvodj+kBq/LXtOAy5lXvBZ9A0q+nX5Sa00nZpujdEInElFsE4ZDGMZE4G4jU5a9uaRYT0RPH97yIf7SJ1on0tb5d3aKMnmqLAGw9YlbIkOdwhry8xvg/WVcy759cKx2q82XZVBCLpwkbTR7O7lLJAd2XTmkaDssXn+q4BGuzXsu4kNxAdr7Mz+PP3ApFvwO7r1HlvjC7xj75tG2Vx6Qe9QnfeFL6yh+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rQmJzVytaNS9PVzJjd0RsL2xUc0o0bHkydUxZWEx0?= =?utf-8?B?MkpqQ3VUZUh6RnltR3ZtRmF4K2lSNHhOZ3pkY1l5SzZ3cE1TUFM2MUE9PQ==?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB411; 6:iNq93mj1G5H1TmkaFGYc06h0wUYCeNeM22WeZG+K2xRGlMbBJLTVYi9GBwHIbph3C6t75N85DQRYkuuXH6gkWQTLd59tT4JipyD40OAh2tf9tolEdElJtdjrvOqJej0tHNYao4f88MPcBcoYr932StVpaCsRK7WDUcdnwc7vr6SNaqmpg6/SgnashByIcPey8uTGdJ2DXu//lFvZDHSyaufCeh39SyzkogsyFy0kOGuiBdHMcccV5vgBo93sMdoqkSanaj9DOXCrZrtFyfK9hUhg9wntL8j5k5tQyId0N6HlfxTeJIPXqki85Ej3u65w7shKdtyqmcq8KoxyQntnww==; 5:Jv70Hj6vA/g1yleQmmkwP5asYIX1FU/2mjQq1jPPaM+IxPPYctquC8x7IiAjarzYXe9bDWSpilR8h1Bm1oRG8K/PtojIWv8svD/u9iik9LS0oWIK+1ROgB5ecxE2965ya+rjVWIMro2ikuRGEFfLcQ==; 24:RRnZPo720RQJu8RTN0zyPs45sRdVhYe4WuHUdCzq665tKiG3b+kqLTnlLlhYMLSKDlQ5bXPVcZd/ArW2ueO+DaML0B7kdKK2Uhblo7JR6rw=; 7:PvSjzVD5yKgqrmrCruGeJ0d3UIqtD/nhJniXO0kbwHmPDoR7/4MyvqK2wePJD7s+oz0WVH7VA4GPxq8IQtt7DnqBT30UbTlU/9yXes3+3BI3BUX6ppjxwDNYr5aWcbY/JISQh6FCoOqNw6J8ONAFXcWPVUQZ7I3HAYObXlNtTb2Pfaiw9FtEci8U1QuaBEVU9gTT0gMTxG4jNf6ZFQyeez4QcrXuLsmBzwJmsVwAqwSxSwBrSc5bvjE5pP/pVIT/ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB411; 20:bTdJOORJ2q8Y/y5p1vjn73ubyiEVe+PPuboeGGNyS5ng4okBnAbjW7FFeeu/jcrgStzHM9uE0+Heq93ILwbHVQTaDBkCdFsL9+Ceae5KQga2UDBZMNnD4vkWbuUkcK4MwG3nLsou8v5j6Fborz3M9PjKbZLIF91M+GGDxxLI/3g8gZT9r0r8tRXF779gMD2D0fhH51gGeShug/1ppXvCtJCJdW6w0/v+bxy13cbgQFJ8hVJ2EGC3V91msZGJLhEw X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2016 22:03:30.8412 (UTC) X-MS-Exchange-CrossTenant-Id: fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d; Ip=[63.163.107.21]; Helo=[milsmgep15.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR02MB411 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Protect sw-ctx busy bit manipulations via the sw queue lock. This allows to convert the atomic bit operations into slightly faster non-atomic operations. Document that blk_mq_run_hw_queues() tests these bits without holding the sw queue lock. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Sagi Grimberg --- block/blk-mq.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 13f5a6c..0dcafa6 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -66,8 +66,9 @@ static void blk_mq_hctx_mark_pending(struct blk_mq_hw_ctx *hctx, { struct blk_align_bitmap *bm = get_bm(hctx, ctx); + lockdep_assert_held(&ctx->lock); if (!test_bit(CTX_TO_BIT(hctx, ctx), &bm->word)) - set_bit(CTX_TO_BIT(hctx, ctx), &bm->word); + __set_bit(CTX_TO_BIT(hctx, ctx), &bm->word); } static void blk_mq_hctx_clear_pending(struct blk_mq_hw_ctx *hctx, @@ -75,7 +76,8 @@ static void blk_mq_hctx_clear_pending(struct blk_mq_hw_ctx *hctx, { struct blk_align_bitmap *bm = get_bm(hctx, ctx); - clear_bit(CTX_TO_BIT(hctx, ctx), &bm->word); + lockdep_assert_held(&ctx->lock); + __clear_bit(CTX_TO_BIT(hctx, ctx), &bm->word); } void blk_mq_freeze_queue_start(struct request_queue *q) @@ -768,8 +770,8 @@ static void flush_busy_ctxs(struct blk_mq_hw_ctx *hctx, struct list_head *list) break; ctx = hctx->ctxs[bit + off]; - clear_bit(bit, &bm->word); spin_lock(&ctx->lock); + __clear_bit(bit, &bm->word); list_splice_tail_init(&ctx->rq_list, list); spin_unlock(&ctx->lock); @@ -940,6 +942,13 @@ void blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx, bool async) &hctx->run_work, 0); } +/** + * blk_mq_run_hw_queues - run all hardware queues + * + * Note: this function checks the SW and HW busy status without serialization + * against the functions that modify that status information. The caller is + * responsible for realizing that serialization. + */ void blk_mq_run_hw_queues(struct request_queue *q, bool async) { struct blk_mq_hw_ctx *hctx; @@ -1055,6 +1064,7 @@ static void __blk_mq_insert_request(struct blk_mq_hw_ctx *hctx, { struct blk_mq_ctx *ctx = rq->mq_ctx; + lockdep_assert_held(&ctx->lock); __blk_mq_insert_req_list(hctx, rq, at_head); blk_mq_hctx_mark_pending(hctx, ctx); }