From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751765AbcACN6p (ORCPT ); Sun, 3 Jan 2016 08:58:45 -0500 Received: from mail-yk0-f172.google.com ([209.85.160.172]:32881 "EHLO mail-yk0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751398AbcACN6m (ORCPT ); Sun, 3 Jan 2016 08:58:42 -0500 Date: Sun, 3 Jan 2016 08:58:39 -0500 From: Tejun Heo To: "Michael S. Tsirkin" Cc: Petr Mladek , Rusty Russell , Jeff Epler , Jiri Kosina , virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Petr Mladek Subject: Re: [PATCH v4 2/2] virtio_balloon: Use a workqueue instead of "vballoon" kthread Message-ID: <20160103135839.GF3660@htj.duckdns.org> References: <1449236271-10133-1-git-send-email-pmladek@suse.com> <1449236271-10133-3-git-send-email-pmladek@suse.com> <20160101121432-mutt-send-email-mst@redhat.com> <20160102114316.GC3660@htj.duckdns.org> <20160102213603.GA1703@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160102213603.GA1703@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, Michael. On Sat, Jan 02, 2016 at 11:36:03PM +0200, Michael S. Tsirkin wrote: > > Why so? As long as the maximum concurrently used workers are not > > high, 1/5 second or even a lot longer sleeps are completely fine. > > I always thought the right way to defer executing a work queue item > is to queue delayed work, not sleep + queue work. That works too and is preferable if there are gonna be a lot of work items sleeping but it isn't different from any other blocking. > Doing a sleep ties up one thread for 1/5 of a second, does it not? It does. > If so, as long as it's the only driver doing this, we'll be fine, > but if many others copy this pattern, things will > start to break, will they not? The maximum concurrency on the system_wq is 256 which is pretty high, so for most use cases, it's fine. If high concurrency is expected, it's better to break it out to a separate workqueue. Thanks. -- tejun