Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2463368imm; Thu, 27 Sep 2018 13:19:39 -0700 (PDT) X-Google-Smtp-Source: ACcGV63v1bp5Grlt1hzGZIHU25NBJUFHVqYo97rNSs3lkNeCi9j26jYKNbiKH2QcZ+JhBsOIyYiQ X-Received: by 2002:a62:1f9d:: with SMTP id l29-v6mr12938279pfj.121.1538079578985; Thu, 27 Sep 2018 13:19:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538079578; cv=none; d=google.com; s=arc-20160816; b=EJkrzlQYrko9IaQJO8BCUSIOZ05ycigMuRndFThOPrlyjm6ZR5cKJSohbbPKkQ43tz bXBh6oR4r4rvByy5uccvXPVBFsHz35tdHveIOiEEn17iewTub4leC1fmPz2YCHi3i/od yCzXZFxHGnJCxE9bpLPcFcCPeMs5lHLCRQdi6JEPsAt5ldGCTW4oB2nbFjv6t35CSlcG ShaY+pW6/DvjCFcsU/RB+q6eBjaK0x7u6w3Tl9ZXcPFxY3LPqCwvWBpLZxE6S6TGym0u kyDkj5zBk0PTh+7cP9mUaWh8CeVb4tOT9wg1/JBcG6c8YXG38ON3nd3DtLT9mkqSrWHJ 9i/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:subject:from; bh=VLM4xxyT+hDVVJoF6XTjSQQcWLpmXitRm9mWrVaYgdk=; b=OJJBqWiaFpdEdtLxwV8vbDAtfsRf+g+R6rLGyYHhkHhbC1l9byN4jeft1Nko4gtX4o wbErk4jCsm/EsdAC4GIBTLl0/ND/QBIJKTt6TRj6uSW9fmpJyvUBEOaLAbQbx5GIJlVT a9xyhvf/yZ4sFID0O27pNPFILQCveUmmhA9pXi0S92fGDATVP946bd0a9u6PcnE+oQ7Q g3Bafgajr00NlzCkMDKbewDtL2UnlHX8XBhllVf1Ci7sZrSNnjNSD8oooWyZjVVlz2Ka uNEv7T+SWyAexDaO4TJ9cfhdu6UClzJmy+DMb0Hc1gT7WNLocE58j/wsroHLyZQJtjFo XBng== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e7-v6si2935694plk.122.2018.09.27.13.19.22; Thu, 27 Sep 2018 13:19:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728506AbeI1Ci6 (ORCPT + 99 others); Thu, 27 Sep 2018 22:38:58 -0400 Received: from cloud1-vm154.de-nserver.de ([178.250.10.56]:21045 "EHLO cloud1-vm154.de-nserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727265AbeI1Ci6 (ORCPT ); Thu, 27 Sep 2018 22:38:58 -0400 Received: (qmail 23768 invoked from network); 27 Sep 2018 22:18:56 +0200 X-Fcrdns: No Received: from phoffice.de-nserver.de (HELO [10.242.2.3]) (185.39.223.5) (smtp-auth username hostmaster@profihost.com, mechanism plain) by cloud1-vm154.de-nserver.de (qpsmtpd/0.92) with (ECDHE-RSA-AES256-GCM-SHA384 encrypted) ESMTPSA; Thu, 27 Sep 2018 22:18:56 +0200 From: Stefan Priebe - Profihost AG Subject: [PATCH] bcache: add separate workqueue for journal_write to avoid deadlock To: Eddie Chapman Cc: Coly Li , guoju , kent.overstreet@gmail.com, linux-bcache@vger.kernel.org, linux-kernel@vger.kernel.org References: <1538055919-5757-1-git-send-email-fangguoju@gmail.com> <9b1abe65-c6f5-77b4-290e-e6af21723cfc@ehuk.net> Message-ID: Date: Thu, 27 Sep 2018 22:18:55 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <9b1abe65-c6f5-77b4-290e-e6af21723cfc@ehuk.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: de-DE X-User-Auth: Auth by hostmaster@profihost.com through 185.39.223.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Coly, is this the deadlock I reported some weeks ago? Greets, Stefan Excuse my typo sent from my mobile phone. Am 27.09.2018 um 17:53 schrieb Eddie Chapman >: > On 27/09/18 16:23, Coly Li wrote: >> On 9/27/18 9:45 PM, guoju wrote: >>> After write SSD completed, bcache schedule journal_write work to >>> system_wq, that is a public workqueue in system, without WQ_MEM_RECLAIM >>> flag. system_wq is also a bound wq, and there may be no idle kworker on >>> current processor. Creating a new kworker may unfortunately need to >>> reclaim memory first, by shrinking cache and slab used by vfs, which >>> depends on bcache device. That's a deadlock. >>> >>> This patch create a new workqueue for journal_write with WQ_MEM_RECLAIM >>> flag. It's rescuer thread will work to avoid the deadlock. >>> >>> Signed-off-by: guoju > >> Nice catch, this fix is quite important. I will try to submit to Jens >> ASAP. >> Thanks. >> Coly Li > > Once this goes into 4.19, would this be a candidate for backporting to > any stable kernels, or does it only fix something introduced in this > cycle? > > thanks, > Eddie