Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2202888imm; Thu, 27 Sep 2018 09:00:25 -0700 (PDT) X-Google-Smtp-Source: ACcGV63M5r3AcpWClTutfFNeA9vaD6SLKE843ehBfY9fh7a7b2IrTFGaoS84xbUGHQ7IzrdeCq5F X-Received: by 2002:a63:3152:: with SMTP id x79-v6mr11136886pgx.323.1538064025815; Thu, 27 Sep 2018 09:00:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538064025; cv=none; d=google.com; s=arc-20160816; b=bdaVVMs/4lZeK4d9iLCPKdJDVvzCuU3SsxWf0n+0/H7qNmGARpiGyhO2J7atfeY4Kd 0gmBpW9fZtgjB+gtgq8KCq38ulOZIzXDdUjfWuaaJnRaKbq259glLxLhyATpUChE8fal /APKzwnHMmD7TKRav986IzDK2oBkqfW6gKXvut58pO1Jy1PjmkM26+uaiCls+LAuOBR4 hgFzCZP6Uf0tWpo451NvHrh9+/goCsa0Bk8rSiWD4Y46TkQewrxAG6X9Ie9zXXgaMa+Z +zxjyDMFZng0AGU+McueB9+GBtKyu4UBt7E+U1+2SVbbJ8RsHnnOFQQ0UiJjsnbW0El1 8XQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:reply-to:from:references:cc:to:subject:dkim-signature :dkim-filter; bh=WNEFfHpCfyRzcbusg4oaXRZRRFlQ4V1L/pGtXbDijko=; b=nBD5OrQDQUmHcfjHsXKaG8WwbwFUqIvBrokmokMZ85TuRVZHrrq+I5w4xJrnzqvtHi rrfIMW+X517UWRWj1HvQ7tNvaFdsz82SemEUdsfVp+1Ne35tSR+JX7aF+Koveb0tgXrU kphglMnNaNUvP5c51NU8TpBD4K8yC+gYlsiv+kwoN7L0chp2HkzF+sbcwB5MD+qnZzTg JDEeXypqiRmcRSjzceMwhGRwVkCH9r+5njw0nxacKwwR2BVH59z00msPtOOAfxhuZZar gLbiexqfWWna/PVmD0TdObVBPNnw4jPpL7ZOl4WxcmQtuFNsd5UIWCQMOmFsxgPi4kIw NvlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ehuk.net header.s=default header.b=Yplx7gBg; 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 l14-v6si2214580pgi.34.2018.09.27.09.00.08; Thu, 27 Sep 2018 09:00:25 -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; dkim=pass header.i=@ehuk.net header.s=default header.b=Yplx7gBg; 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 S1728231AbeI0WSm (ORCPT + 99 others); Thu, 27 Sep 2018 18:18:42 -0400 Received: from schatzi.steelbluetech.co.uk ([92.63.139.240]:20293 "EHLO schatzi.steelbluetech.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727262AbeI0WSl (ORCPT ); Thu, 27 Sep 2018 18:18:41 -0400 X-Greylist: delayed 400 seconds by postgrey-1.27 at vger.kernel.org; Thu, 27 Sep 2018 18:18:41 EDT Received: from [10.0.5.25] (tv.ehuk.net [10.0.5.25]) by schatzi.steelbluetech.co.uk (Postfix) with ESMTP id 38930BFD9D; Thu, 27 Sep 2018 16:53:07 +0100 (BST) DKIM-Filter: OpenDKIM Filter v2.10.3 schatzi.steelbluetech.co.uk 38930BFD9D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ehuk.net; s=default; t=1538063587; bh=WNEFfHpCfyRzcbusg4oaXRZRRFlQ4V1L/pGtXbDijko=; h=Subject:To:Cc:References:From:Reply-To:Date:In-Reply-To:From; b=Yplx7gBgq+WvL/cmCZ+hWrQoa1cPMGXTDGswt/yPq7c2qIWhZaFim/nZYYtQQUkHb UwqVKDSxcFDiVi9tUlnqEHCKN6JKcS7cqKRD9xQb0tDE/lfAYbziNBPUNxTTyaM2U/ 8genTI1YdA2YHv2WC0K+Cvxc9SS8ppLiI3nVEHiY= Subject: Re: [PATCH] bcache: add separate workqueue for journal_write to avoid deadlock To: Coly Li , guoju Cc: kent.overstreet@gmail.com, linux-bcache@vger.kernel.org, linux-kernel@vger.kernel.org References: <1538055919-5757-1-git-send-email-fangguoju@gmail.com> From: Eddie Chapman Reply-To: Eddie Chapman Message-ID: <9b1abe65-c6f5-77b4-290e-e6af21723cfc@ehuk.net> Date: Thu, 27 Sep 2018 16:53:06 +0100 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: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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