From patchwork Thu Mar 30 05:20:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Minchan Kim X-Patchwork-Id: 9652911 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 313456034C for ; Thu, 30 Mar 2017 05:21:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 28D6E28556 for ; Thu, 30 Mar 2017 05:21:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1DA2428578; Thu, 30 Mar 2017 05:21:06 +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=-5.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, URIBL_BLACK 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 83A2F28571 for ; Thu, 30 Mar 2017 05:21:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932361AbdC3FUy (ORCPT ); Thu, 30 Mar 2017 01:20:54 -0400 Received: from LGEAMRELO11.lge.com ([156.147.23.51]:58681 "EHLO lgeamrelo11.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932196AbdC3FUu (ORCPT ); Thu, 30 Mar 2017 01:20:50 -0400 Received: from unknown (HELO lgeamrelo02.lge.com) (156.147.1.126) by 156.147.23.51 with ESMTP; 30 Mar 2017 14:20:47 +0900 X-Original-SENDERIP: 156.147.1.126 X-Original-MAILFROM: minchan@kernel.org Received: from unknown (HELO localhost.localdomain) (10.177.223.161) by 156.147.1.126 with ESMTP; 30 Mar 2017 14:20:47 +0900 X-Original-SENDERIP: 10.177.223.161 X-Original-MAILFROM: minchan@kernel.org From: Minchan Kim To: Jens Axboe Cc: kernel-team@lge.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Minchan Kim , Sagi Grimberg , Omar Sandoval Subject: [PATCH] block: do not put mq context in blk_mq_alloc_request_hctx Date: Thu, 30 Mar 2017 14:20:45 +0900 Message-Id: <1490851245-32245-1-git-send-email-minchan@kernel.org> X-Mailer: git-send-email 2.7.4 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 In blk_mq_alloc_request_hctx, blk_mq_sched_get_request doesn't get sw context so we don't need to put the context with blk_mq_put_ctx. Unless, we will see preempt counter underflow. Cc: Sagi Grimberg Cc: Omar Sandoval Cc: Jens Axboe Signed-off-by: Minchan Kim Reviewed-by: Sagi Grimberg --- Maybe, it would be fixed by someone but I have noticed preempt counter undeflow problem a few weeks ago and still see the problem with linux-next. block/blk-mq.c | 1 - 1 file changed, 1 deletion(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index a4546f060e80..a6f3998dc4ee 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -321,7 +321,6 @@ struct request *blk_mq_alloc_request_hctx(struct request_queue *q, int rw, rq = blk_mq_sched_get_request(q, NULL, rw, &alloc_data); - blk_mq_put_ctx(alloc_data.ctx); blk_queue_exit(q); if (!rq)