From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753925AbaDQPJe (ORCPT ); Thu, 17 Apr 2014 11:09:34 -0400 Received: from mail-ve0-f172.google.com ([209.85.128.172]:58543 "EHLO mail-ve0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753117AbaDQPIA (ORCPT ); Thu, 17 Apr 2014 11:08:00 -0400 MIME-Version: 1.0 In-Reply-To: <20140417145705.GA14787@lst.de> References: <1397464212-4454-1-git-send-email-hch@lst.de> <1397464212-4454-6-git-send-email-hch@lst.de> <20140417145705.GA14787@lst.de> Date: Thu, 17 Apr 2014 23:07:59 +0800 Message-ID: Subject: Re: [PATCH 5/7] blk-mq: initialize request on allocation From: Ming Lei To: Christoph Hellwig Cc: Jens Axboe , Matias Bjorling , Linux Kernel Mailing List , Linux SCSI List Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 17, 2014 at 10:57 PM, Christoph Hellwig wrote: > On Thu, Apr 17, 2014 at 10:54:23PM +0800, Ming Lei wrote: >> On Mon, Apr 14, 2014 at 4:30 PM, Christoph Hellwig wrote: >> > If we want to share tag and request allocation between queues we cannot >> > initialize the request at init/free time, but need to initialize it >> > at allocation time as it might get used for different queues over its >> > lifetime. >> >> Could you explain the use pattern? Looks you mean there are >> still users of the tag/req even after it is freed, that looks a bit >> weird since the tag/req can still be reallocated in another path >> after it is freed. > > No difference in use pattern. But blk_rq_init initializes the rq->q field, > and a request might get reused for a different queue. If so, it may be better to only initialize the rq->q in allocation because Jens said 'It's done that way because of presumed cache hotness on completion'. Thanks, -- Ming Lei