Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp213558imm; Thu, 27 Sep 2018 19:34:50 -0700 (PDT) X-Google-Smtp-Source: ACcGV630kF25mqRPYGOljBAHgoinplDmWYbozIs0EUhJ0QhOmTKYS6uwicYiUA0Ln4pz9QCTh5Zx X-Received: by 2002:a62:b209:: with SMTP id x9-v6mr14497921pfe.148.1538102090263; Thu, 27 Sep 2018 19:34:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538102090; cv=none; d=google.com; s=arc-20160816; b=j99aO3baQqDhQM2hCZQbKtsg4ZHMPzJZ3ODFw860eAcG7jCf5Ddvdlxju8ENaIAlsO NZosw6jn9jIuR+pfp0ndJHmYBAoeJFxfldJqrdVC4VsimBX8PiH0NO9/X5N+VifW3s3D T7mof3Y6hSHn+IjH88EDEubluygdOMbjmQipDcdAqVkJLExnYW19lSSYMBvle1OlPlbW M4e1M2Pv4ARSWYZXUNcBJbO2FDsAAJ1LM9TiRHa2UyvPa3ibdjPnG4n90PpAENJExswq kBNoxbxB+gvEqyUvSidM3a6G2F/T0bGQwUl//plWZJYvFKq71nZZVHIosBO6pe6Uw8K4 Q2hQ== 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:from:references:cc:to:subject; bh=llJiFjJDVH1FrSD560h0cI6Cj3utVnYJ6p84QBm8MCU=; b=QX5gZmQvDKkYT38/5kd+ThuPklYfdpuXFiRTn7cF20sv4mX1fnoHkQf442hlgqbDAX ni9BU1d5YlI5psJYkuym89/fR6hjigcuxjG9EnPuVkwZt1uo/5gnZ/E3X4lisk/ZCFBg WlCYK1K1QEeN/3afChhKh/yCAXeTx89bhDgCT4xEIm/9zUjrMT0dS7QvgPeot2jQ2TlZ +15Bo850QrQsO2wilfaf3Sf+Qxs0bFTLgWEXuhvYqkl4vU5pafuTI1nppy6edVZyz0gw rihWRg2ZjjMKDt3MLn5JI7HMxHLpHjtFmu8tHDz0coJPtev/HJS+EOZ2A+KmMwRIntbU N8xQ== 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 d9-v6si3632889pfk.166.2018.09.27.19.34.33; Thu, 27 Sep 2018 19:34:50 -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 S1728590AbeI1IyX (ORCPT + 99 others); Fri, 28 Sep 2018 04:54:23 -0400 Received: from mx2.suse.de ([195.135.220.15]:36570 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726271AbeI1IyX (ORCPT ); Fri, 28 Sep 2018 04:54:23 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 7A131AE12; Fri, 28 Sep 2018 02:32:57 +0000 (UTC) Subject: Re: [PATCH] bcache: add separate workqueue for journal_write to avoid deadlock To: Eddie Chapman Cc: 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> From: Coly Li Message-ID: Date: Fri, 28 Sep 2018 10:32:53 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <9b1abe65-c6f5-77b4-290e-e6af21723cfc@ehuk.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/27/18 11:53 PM, Eddie Chapman wrote: > 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? > This bug exists in upstream for quite long time, it should be applied to all stable kernels which it can be applied. And it is Cced to stable@vger.kernel.org already. Coly Li