From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752922Ab2H2M6O (ORCPT ); Wed, 29 Aug 2012 08:58:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:15334 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752235Ab2H2M6N (ORCPT ); Wed, 29 Aug 2012 08:58:13 -0400 Date: Wed, 29 Aug 2012 08:57:59 -0400 From: Vivek Goyal To: Kent Overstreet Cc: Tejun Heo , linux-bcache@vger.kernel.org, linux-kernel@vger.kernel.org, dm-devel@redhat.com, mpatocka@redhat.com, bharrosh@panasas.com, Jens Axboe Subject: Re: [PATCH v7 9/9] block: Avoid deadlocks with bio allocation by stacking drivers Message-ID: <20120829125759.GB12504@redhat.com> References: <1346175456-1572-1-git-send-email-koverstreet@google.com> <1346175456-1572-10-git-send-email-koverstreet@google.com> <20120828204910.GG24608@dhcp-172-17-108-109.mtv.corp.google.com> <20120828222800.GG1048@moria.home.lan> <20120828230108.GI1048@moria.home.lan> <20120829013150.GA9269@redhat.com> <20120829032558.GA22214@moria.home.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120829032558.GA22214@moria.home.lan> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 28, 2012 at 08:25:58PM -0700, Kent Overstreet wrote: [..] > Except that when thread a goes to punt those blocked bios to its > rescuer, it punts _all_ the bios on current->bio_list. Even those > generated by/belonging to other bio_sets. > > So thread 1 in device b punts bios to its rescuer, thread 2 > > But thread 2 ends up with bios for both device a and b - because they're > stacked. Ok, just to add more details to above example. Say we have device A stacked on top of B and B stacked on top of C. Say a bio a is submitted to device A and is splitted in two bios b1 and b2. Now b1 is sumbitted to device B and is splitted in c1 and c2. Now current bio list has three bios. b2, c1 and c2. If submitter is now about to block on any bio set, then all tree bios b2, c1, c2 will punted to rescue thread and submssion of b2 will again block resulting in blocking rescue thread itself. I would say keep all the bio splitting patches and any fixes w.r.t deadlocks in a seprate series. As this is little complicated and a lot of is just theoritical corner cases. If you limit this series to just bio_set related cleanups, it becomes more acceptable for inclusion. Thanks Vivek