From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752309AbcHAJ2s (ORCPT ); Mon, 1 Aug 2016 05:28:48 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:49954 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752047AbcHAJ2k (ORCPT ); Mon, 1 Aug 2016 05:28:40 -0400 Subject: Re: [Query] increased latency observed in cpu hotplug path To: Akinobu Mita References: <9e0a5975-4097-2819-3619-af7140ccf77b@codeaurora.org> Cc: "\"axboe"@kernel.dk, akinobu.mita@gmail.com, axboe@fb.com, hch@lst.de, "tom.leiming\""@gmail.com, "\"linux-block"@vger.kernel.org, "linux-kernel\""@vger.kernel.org From: "Khan, Imran" Message-ID: <62d2e666-1ae3-f320-013d-e2cfc98770b8@codeaurora.org> Date: Mon, 1 Aug 2016 14:58:03 +0530 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/30/2016 7:54 AM, Akinobu Mita wrote: > 2016-07-28 22:18 GMT+09:00 Khan, Imran : >> >> Hi, >> >> Recently we have observed some increased latency in CPU hotplug >> event in CPU online path. For online latency we see that block >> layer is executing notification handler for CPU_UP_PREPARE event >> and this in turn waits for RCU grace period resulting (sometimes) >> in an execution time of 15-20 ms for this notification handler. >> This change was not there in 3.18 kernel but is present in 4.4 >> kernel and was introduced by following commit: >> >> >> commit 5778322e67ed34dc9f391a4a5cbcbb856071ceba >> Author: Akinobu Mita >> Date: Sun Sep 27 02:09:23 2015 +0900 >> >> blk-mq: avoid inserting requests before establishing new mapping > > ... > >> Upon reverting this commit I could see an improvement of 15-20 ms in >> online latency. So I am looking for some help in analyzing the effects >> of reverting this or should some other approach to reduce the online >> latency must be taken. > > Can you observe the difference in online latency by removing > get_online_cpus() and put_online_cpus() pair in blk_mq_init_allocated_queue() > instead of full reverting the commit? > Hi Akinobu, I tried your suggestion but could not achieve any improvement. Actually the snippet that is causing the change in latency is the following one : list_for_each_entry(q, &all_q_list, all_q_node) { blk_mq_freeze_queue_wait(q); /* * timeout handler can't touch hw queue during the * reinitialization */ del_timer_sync(&q->timeout); } I understand that this is getting executed now for CPU_UP_PREPARE as well resulting in increased latency in the cpu online path. I am trying to reduce this latency while keeping the purpose of this commit intact. I would welcome further suggestions/feedback in this regard. -- Imran Khan QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a\nmember of the Code Aurora Forum, hosted by The Linux Foundation