From patchwork Wed Feb 15 17:58:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 9574661 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 942286045F for ; Wed, 15 Feb 2017 17:58:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7E014284DE for ; Wed, 15 Feb 2017 17:58:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 70EA828503; Wed, 15 Feb 2017 17:58:29 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI 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 D7D7A284DE for ; Wed, 15 Feb 2017 17:58:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752460AbdBOR62 (ORCPT ); Wed, 15 Feb 2017 12:58:28 -0500 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:46037 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752441AbdBOR6Z (ORCPT ); Wed, 15 Feb 2017 12:58:25 -0500 Received: from pps.filterd (m0109332.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v1FHohMd001737; Wed, 15 Feb 2017 09:58:18 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=subject : to : references : cc : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=facebook; bh=zeCbxLHwT9JQL2JLGu2dgXAMcU/u9eGns6bbP2J4+O8=; b=GoHXvtF3PaLysb7Hqh7uBh4X/71I1HxDRpPT7I38HxoTR11dJOkWdzcwTjiu3jvRF7Gy j3gHEWMB3MJJ3GzTmtBU4e6hEjNGfjEx/813IY+ZOMJXa9ajAdH0WU2/xMi5K0p8LFgF ScsFiF9X1uuRdtQPUxyFdtPePykjeaJCRVo= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 28murc00vj-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 15 Feb 2017 09:58:18 -0800 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (192.168.54.28) by o365-in.thefacebook.com (192.168.16.12) with Microsoft SMTP Server (TLS) id 14.3.294.0; Wed, 15 Feb 2017 09:58:17 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.onmicrosoft.com; s=selector1-fb-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=zeCbxLHwT9JQL2JLGu2dgXAMcU/u9eGns6bbP2J4+O8=; b=Rm80WKk1whtekYCPj+qlBww7JrQRyGM+E7CgjeElNfr2+BL8fr2qlKJSSEAix83YF59/Zwft0vaGCUYAPnPQBCRef8JlISLPzTQlv3zTZN2SSHMhBYo6iYKU0763qXY9jUTA2Gd8ASYOVIVympapH+kythZZpDcUQDgMQR5EKdE= Received: from [192.168.1.154] (216.160.245.98) by DM5PR15MB1193.namprd15.prod.outlook.com (10.173.209.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.16; Wed, 15 Feb 2017 17:58:14 +0000 Subject: Re: [PATCH] blk-mq-sched: don't hold queue_lock when calling exit_icq To: Paolo Valente , Omar Sandoval References: <73cd0cf484e8b75a771d908c172cd3a931dc00a3.1486751329.git.osandov@fb.com> CC: , From: Jens Axboe Message-ID: Date: Wed, 15 Feb 2017 10:58:12 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: X-Originating-IP: [216.160.245.98] X-ClientProxiedBy: CY4PR1701CA0010.namprd17.prod.outlook.com (10.171.208.20) To DM5PR15MB1193.namprd15.prod.outlook.com (10.173.209.11) X-MS-Office365-Filtering-Correlation-Id: b7a5f371-7bfe-444c-5c4a-08d455cc370e X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:DM5PR15MB1193; X-Microsoft-Exchange-Diagnostics: 1; DM5PR15MB1193; 3:Rn8cqzD4Is1tOwa2kz822FKApo8bWE1QaRHyClPQtqs8HAuJGe245PS8kypHXuBZRGRwPIAJJjR+YJOtYPRfNb674t0KDI1J4aWDrIg5SL1aVdVR9nStv1l5M5PsFLguGC2eNyjYSauEIij6/+Aq1KUEBLIwwTzKTKXKdKuHPDoPt5dEkgD4wPPFkhTOh1+oE3/WvporGzV1FYuXxFJgB/H1EaFqKvnqbmnVKxMo//a9yc0NWwORteelNXrj/P2L/lb9nHxDjemeekTYfaMDXQ==; 25:pdVZFv74CTgzJkQ/jL7yPmfYo7/qqgmsB4OO+No5wIFrSYDNn7aRixKJ3MEcu2BLUazkV0lNKwVqRPjpPpLSjyX0chlgXa5aZ1R7XW2eqqtSv+CXJeLTTNulGNGMvL+VG49hqVZIFRVVaKGiWlZUFmzx8/zQl+9iyZOfb7ztMrbyonRdoLwGiGPw8/WaFWfWPNX1b8H8Ct2u+kjFxM5pq1fzcu8lm2hhArXkQC2DqMST/JgJwJMkAQY7HbPyjP+YhgaXq+100ZlTWGILTmXLDAlnVeDWaEiqlikUxbYhep76l6nGqr+bOltO3vu7/UYfsLl5YCcMhiw+74tLPaG7cnBqoeXGNrDr0jEN32LWJcmiYhHD1vuWR+jBVp5XISnSzw/AgKgx2df0ASppXSLp3sZO+36ZHZnGIC7e8Nc/C6DdJVyn4aeyYuFYkC+VfDRW+YI/GBJsTETSR/V51uzj4A== X-Microsoft-Exchange-Diagnostics: 1; DM5PR15MB1193; 31:Na2iFud+3Iea1DV+GFpxYHkaZdV5DYLtS8cpC132k05Yp+FxJhE07ARs1huP4yIu0/DXHFVGoV11dUhbhQ/F6mQtJemqML7UoC4ANi9HmrLCUeF9aCGpuqcVEaWtU73arWWaD0fGZHh1Crhe/0Ww0sGKPs1/32GE0TSUv/2YLYcl1LewJQ2pwDg1+g8AOEJ+XaHjMkVaFzEZrnJi+BcSP4G7UgIderl1qn7ax4mqgag=; 20:cOJiuHgtsjtrvUCbJ/uaUHW6lB21C1ykvbMMa3X2qeuD9nJfWYyX2I7F5oRdMU43pt3FZB/AB7SFvD5RM9/KNh6ZUyj/XAtfDdck/jLHMQ2BxEkQhkcrUpm+S+zyaG8UjEdgSU5drX8S6Fzr6RDxOjzNLM5kJQO6F2i41i98U7gJd0O/OuIX27gqAm9gXmmcPg368F/D5v6wBu/W4PQzw+v26+kTcGL4VysaXolD4VFDk5QeeeIn9QGMYN5AgoOVh++Tsg0TlXNhaDiAf4sE0DI5cZPdPY2jJFCghZOmczVGBwGPveqr7hR/zbcK8BEt8wN6Kt+DhzkcWrbOzvf1u6puaxaEmehUpbLnLcmOON2TT8cG1Jpb1QFOyEWas1gnPcxstOYsL1c0B1Wq0+f+53U9vqIqQL3Rk5yLZgeoQ65EWliyYkQPe5h0XVyiT1agSLBftpRwMX/xtr8NrAz6BnS3PpToWh+lk07cBgFSEUMQ6FobhDhEzKwIR1EU4l8h X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(67672495146484)(17755550239193); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6041248)(20161123555025)(20161123558025)(20161123564025)(20161123562025)(20161123560025)(6072148); SRVR:DM5PR15MB1193; BCL:0; PCL:0; RULEID:; SRVR:DM5PR15MB1193; X-Microsoft-Exchange-Diagnostics: 1; DM5PR15MB1193; 4:pRYtqgscHA787tzcBSywCyZwYtWapyMY/p0zFIob6RmGEsR4gEBiHMEjYnmtZd5216qc/buh1lHNkE4aZpaNfyv+DpWG+dY5Uf6E5EsuKd1b/D4UP1ZUNpSKKTclw+Lkqky9d3ToO3DcQdef+/RoR7ovBQvwOQA7ch2ny2HFxQDmrYdiav6W7GbzmZ4Plkj6WnyMFeWdbpEB/MZfTBIu8METzHi+xqU94nrulbY6J/uexU6yM3L4nqTVkfbbzknR81ntDOecbej+LZLUSvLJ/mfma8jnp96TIdIBpX/T+8tjN06jhtMQHyklqPRRfpiX0K5+qb4Fzutncew8FQ0f7iviU76DSeSWKBml/IdQM1EyCRp0/HYnECk3PnmbPivrUBm7Q+3Zz8+aqArv16tRDTSk3egESKrluGrhKIXwh7kZXWHffVxYjv0PRgc0LBDUri+ZYdzQKU+D+ph8GJgjR9qFjoOC2tPbnTIV6LJwPdHt8N30+ziTioDFOtlmtD2aNHl3sFq1Q7rQW6Xe2KtvFffdDTrNFcxXli9pMVrwApGeLQ76kkS/S8vrhhqgBAQIjdUbeMLzLrBkcw90j8OuJ4XT+SvxTutnZObplo2VGf4SFofeFb6LUPcfNcb5IX8i3S4Ggs425P8DK9UxedfJ+vFD8k0lsXwZJuzCqoAHuVune4tYZP22UZCTJA1N4iSH X-Forefront-PRVS: 021975AE46 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6049001)(6009001)(7916002)(39830400002)(39410400002)(39450400003)(189002)(377454003)(199003)(24454002)(7736002)(5660300001)(101416001)(229853002)(36756003)(92566002)(68736007)(4326007)(54906002)(65826007)(4001350100001)(38730400002)(53936002)(6116002)(2950100002)(23746002)(305945005)(6486002)(3846002)(2906002)(83506001)(77096006)(25786008)(90366009)(53546003)(65806001)(76176999)(50986999)(54356999)(42186005)(47776003)(66066001)(33646002)(189998001)(97736004)(230700001)(65956001)(6246003)(8676002)(86362001)(50466002)(81156014)(106356001)(81166006)(230783001)(31696002)(64126003)(105586002)(31686004)(389900002)(117156001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR15MB1193; H:[192.168.1.154]; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: fb.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; DM5PR15MB1193; 23:qFDsIX8BfDy1rNCJsCwSX6BhlRKRtqaWYGc3B?= =?Windows-1252?Q?J0xx+1x9HebKGAFM4yjsLBOuJREECWFUM6Fyb0DA6gnmR4kYCdLxsbkX?= =?Windows-1252?Q?QoACx+m6CRlIqfyNEwruEsu7Kp6da+den95Dzuz8oT68Fvid6JxdYR4i?= =?Windows-1252?Q?zP/DLIsqN/4kmbBiBY9J5JU54Jr/WFanI8itWsIBfnzqLh/ZNbj3x7R5?= =?Windows-1252?Q?YNbHiXlFuUJeFtCVmxqOmB91ES7RZT16V/syoPKcukx1mhXojoOAeI5y?= =?Windows-1252?Q?h8UpsByOQ9kUkzAl+J1GZ2+ttFsfD+hUaFR5eIOOEcT8ukoMGY0zHhvE?= =?Windows-1252?Q?KJmxchWE50gaJaoEhJLARfjbda33HxfN9lVUFq/PfFbl7D2Hrh2cevEm?= =?Windows-1252?Q?4rYvuarnvZ1McbUuWMzaUqAsS6sDcrn+rSEeba3V7NP8kFtZJHYu98Oa?= =?Windows-1252?Q?HQDJkH7sQjwA9fM6B8fKKlyxM4U4ZVTqNpfolbWytn6sppPcdc+IxI4H?= =?Windows-1252?Q?tGYuGJT3m1Fw7Q0ztas5x4AOLFMhYeq7zXMhCa1lFCjpIpSEFB9N9Own?= =?Windows-1252?Q?c9d7hRIz1hmlZ2RXpBemOvO04wwbnbt/7mFfoFJ3+CS5whoMXbxnPgQg?= =?Windows-1252?Q?famp+RssVt+Gp+V/eH/vgOwbkdheYefAooZetuzWTRDLRsE+IZd9rzLU?= =?Windows-1252?Q?lMIgFlEULc1eghnIt0JgGQxApJJIGBLMAVlW6oUd14h4afyK+1OO+laB?= =?Windows-1252?Q?yt+D9SufEtuV8PjFhtpwcgPzc1+t6PNsRVaugxDraMjOUOaaFhOdUgFb?= =?Windows-1252?Q?jOacCs10Tg7vGKL4tTZSKlB/7qGxbiwQhiISHqRqlXX0tBI+5ezzOhgF?= =?Windows-1252?Q?NyRTpFQwKfzVCwxcgdWzYaU4AT4EasVfZWYg5MJNXJndS8X9+bLrcuGq?= =?Windows-1252?Q?ifI2q9vQLsmbQwCg1NxaQV5uePVSgT+EBuHWK7PFoK9hk6ldhaGSdAon?= =?Windows-1252?Q?Q56fVLJbdbT/b0p5SUjNFhYnzMo506S7OiIPP+eugBGUxHJkvCA2Gj+J?= =?Windows-1252?Q?SSgM5Nhh/JBOeDzKQ3KBnmJtf9yfFQpa5olP54F1SmdcR5tQ/9CNJ0No?= =?Windows-1252?Q?SqttN6h6gTbIh6PSNsEF4iAJud3jzoD7ExZPs7Vx6imgX6p0E7NmcI9L?= =?Windows-1252?Q?X3ijoylNPmmDns3x1PQitGJkezRQfz7TbuB65B2D8HloWnMRGK9HcRTv?= =?Windows-1252?Q?OYQ3F9SucXIvxfh0z4VMrufoiuuC1Zn1xfhOChBNRxBy/eF4t/neg6bM?= =?Windows-1252?Q?sOjXZtfvyL0/cKp8ECkswFmLbxAAJNEx+82pKZ16lsScJIf5oUSeRju+?= =?Windows-1252?Q?7Oxiw3bwEC8HavhOQV9McVswP1bQ5IEOHhttme5jUbDT5rK2Yt097wKd?= =?Windows-1252?Q?ZydKmXhFh7h481RmwquK5obafb7XZFM1zghorDqCQ6Dw2vlCFOkscgT7?= =?Windows-1252?Q?bBVu24EQLh3l6hsyhiKXE7wln13C+/QlkNtJWM32+Nd63kf4Z7YucWss?= =?Windows-1252?Q?vjrsN3pV3BoeKaKSqSAN1RwNXdAQP5jyoAi3kIZaiML9Ctbi6GQw2ubA?= =?Windows-1252?B?QT09?= X-Microsoft-Exchange-Diagnostics: 1; DM5PR15MB1193; 6:ZtNp087KE7p1UZgmEdhj3YSIIwKbGDjdJiNjuJGQMLTQlnoeVkuMaxxA6dDAZn3TzAKk1YeI+DW/u6ukI16+hmBAPtOXaqPBmVsnOPcVxkv+rNqKftcH5YtATwJlzuOcK9L801G86SD9xiGf8JRAezYhZ2sSpYe+657voQL8ed8O1eCHSw3sfBkQj0BmE/MRuhML0bTmNM0Ys4Cbjj/He6/3kkDJNRJeFaFffStViUsA8Bcw9/JSZUnQTRwjIkxyhoxhHEVBKIy2iv4TK1U2rp2EbdvVIbGyEbYYc97eeUsma2hKazYzSsEkewgz7RWWPRNQjFt+g3mJl5GQ9Dzv4xI82omfipAYU15MSZVtMi1e+s9tN44NNjBgdQz4tJ/7RD50TXy6JQChLEFq6sKthQ==; 5:TLybRHt+W2k5FKvLRtlnENrspKsd63EVJ8fXFF0AqMUXK/grZpjXZvt/4vNkp3z5S7oH8PtnsIUKZMuruyHZnOZ8CtNj+VI41nA20lOX44fXg6iDm+0LrOK7i3vFmw/pL8D1lkD1dEk13TIjUaZHNg==; 24:ZU9QIicmi24SQ+inubf2jl/yHoVC3vPHzXzP98SHD/m3qJGRkGgoI8dt3rMiuPM4YtIzHahWKvf6sT3KBQbCJlBL9kpcQ4lxUFpSWITi5ks= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR15MB1193; 7:dGhAUsTDKRM9IpWrQzWrUDoJ4sy0USco9DLX1NnSeQHsJ3TLrV9aVKxKvsaOLiDP8xh/8G7XADRXQHfeI85woVyC6bOI/GSDL7tGVru4lqE3WyRyna9kYY70L5tjoj90Q1+137GxoqTRMD1IPA3K30FX0zSNr2IEqwNPdRXGHQwOF1I8NSGufFeKYrn4PwcIYrJSgaauV6bI8wsC/zBSRJOhltxtFZSh/ud/Ft8ER+MMewXpM1eYqqi9HDEn7gTzdT9WzPLwTsAxPCdipuDHoF5a11aaYVEPWWR6KDSRmgR0FLm5rBqUAjbYMcGmwDZdnXyuM0qfMo7WZ2sk0x9u1o1f1Xeo5hGvjvSmaEABhJH6ja4D3fgb6DQD/BcSlu1ZzCgqlierV5YZCuT3XzkGeb2HYovgBJGkmFwrc6CVLlmakesN6lDb9DPwCGxRIxDDb7DI03NKRCYJMZi7xMshv9o9t9qxJPahad7sdS+uLMmTczb7v6Raz9EryAqcCdDuQiq+lgM2qSj20WBzYy0f9A==; 20:9kk5PzRnSIM4T1i+GK1ZcO3c3bBHXxjuAIvipvbR4CrS9Yn/cbN4oYuktGuOtBQpJ6BZS06fkl8THX7ilHh7lyZqRAvQjLnILI3eLT95gET6AtBpylUfPVMT5pTZQNke45OqbX1jjaEJDqmzUURkMhKYWIg+cvbffQ+NCkA9XYw= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2017 17:58:14.9428 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR15MB1193 X-OriginatorOrg: fb.com X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-02-15_09:, , signatures=0 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 On 02/15/2017 10:24 AM, Paolo Valente wrote: > >> Il giorno 10 feb 2017, alle ore 19:32, Omar Sandoval ha scritto: >> >> From: Omar Sandoval >> >> None of the other blk-mq elevator hooks are called with this lock held. >> Additionally, it can lead to circular locking dependencies between >> queue_lock and the private scheduler lock. >> > > Hi Omar, > I'm sorry but it seems that a new potential deadlock has showed up. > See lockdep splat below. > > I've tried to think about different solutions than turning back to > deferring the body of exit_icq, but at no avail. Looks like a interaction between bfqd->lock and q->queue_lock. Since the core has no notion of you bfqd->lock, the naturally dependency here would be to nest bfqd->lock inside q->queue_lock. Is that possible for you? Looking at the code a bit, maybe it'd just be simpler to get rid of holding the queue lock for that spot. For the mq scheduler, we really don't want places where we invoke with that held already. Does the below work for you? diff --git a/block/blk-ioc.c b/block/blk-ioc.c index b12f9c87b4c3..0f50b1296cf9 100644 --- a/block/blk-ioc.c +++ b/block/blk-ioc.c @@ -222,25 +222,34 @@ void exit_io_context(struct task_struct *task) put_io_context_active(ioc); } +static void __ioc_clear_queue(struct list_head *icq_list) +{ + while (!list_empty(icq_list)) { + struct io_cq *icq = list_entry(icq_list->next, + struct io_cq, q_node); + struct io_context *ioc = icq->ioc; + + spin_lock_irq(&ioc->lock); + ioc_destroy_icq(icq); + spin_unlock_irq(&ioc->lock); + } +} + /** * ioc_clear_queue - break any ioc association with the specified queue * @q: request_queue being cleared * - * Walk @q->icq_list and exit all io_cq's. Must be called with @q locked. + * Walk @q->icq_list and exit all io_cq's. */ void ioc_clear_queue(struct request_queue *q) { - lockdep_assert_held(q->queue_lock); + LIST_HEAD(icq_list); - while (!list_empty(&q->icq_list)) { - struct io_cq *icq = list_entry(q->icq_list.next, - struct io_cq, q_node); - struct io_context *ioc = icq->ioc; + spin_lock_irq(q->queue_lock); + list_splice_init(&q->icq_list, &icq_list); + spin_unlock_irq(q->queue_lock); - spin_lock(&ioc->lock); - ioc_destroy_icq(icq); - spin_unlock(&ioc->lock); - } + __ioc_clear_queue(&icq_list); } int create_task_io_context(struct task_struct *task, gfp_t gfp_flags, int node) diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index 070d81bae1d5..1944aa1cb899 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c @@ -815,9 +815,7 @@ static void blk_release_queue(struct kobject *kobj) blkcg_exit_queue(q); if (q->elevator) { - spin_lock_irq(q->queue_lock); ioc_clear_queue(q); - spin_unlock_irq(q->queue_lock); elevator_exit(q->elevator); } diff --git a/block/elevator.c b/block/elevator.c index a25bdd90b270..aaa1e9836512 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -985,9 +985,7 @@ static int elevator_switch(struct request_queue *q, struct elevator_type *new_e) if (old_registered) elv_unregister_queue(q); - spin_lock_irq(q->queue_lock); ioc_clear_queue(q); - spin_unlock_irq(q->queue_lock); } /* allocate, init and register new elevator */