Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2992961AbbEEOAJ (ORCPT ); Tue, 5 May 2015 10:00:09 -0400 Received: from mail-qc0-f176.google.com ([209.85.216.176]:36640 "EHLO mail-qc0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2992946AbbEEOAC (ORCPT ); Tue, 5 May 2015 10:00:02 -0400 Date: Tue, 5 May 2015 09:59:58 -0400 From: Tejun Heo To: Ming Lei Cc: Jens Axboe , linux-kernel@vger.kernel.org, "Justin M. Forbes" , Jeff Moyer , Christoph Hellwig , "v4.0" Subject: Re: [PATCH 2/2] block: loop: avoiding too many pending per work I/O Message-ID: <20150505135958.GO1971@htj.duckdns.org> References: <1430826595-5888-1-git-send-email-ming.lei@canonical.com> <1430826595-5888-3-git-send-email-ming.lei@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1430826595-5888-3-git-send-email-ming.lei@canonical.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1168 Lines: 30 On Tue, May 05, 2015 at 07:49:55PM +0800, Ming Lei wrote: ... > diff --git a/drivers/block/loop.c b/drivers/block/loop.c > index 3dc1598..1bee523 100644 > --- a/drivers/block/loop.c > +++ b/drivers/block/loop.c > @@ -725,7 +725,7 @@ static int loop_set_fd(struct loop_device *lo, fmode_t mode, > goto out_putf; > error = -ENOMEM; > lo->wq = alloc_workqueue("kloopd%d", > - WQ_MEM_RECLAIM | WQ_HIGHPRI | WQ_UNBOUND, 0, > + WQ_MEM_RECLAIM | WQ_HIGHPRI | WQ_UNBOUND, 16, It's a bit weird to hard code this to 16 as this effectively becomes a hidden bottleneck for concurrency. For cases where 16 isn't a good value, hunting down what's going on can be painful as it's not visible anywhere. I still think the right knob to control concurrency is nr_requests for the loop device. You said that for linear IOs, it's better to have higher nr_requests than concurrency but can you elaborate why? Thanks. -- tejun -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/