From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933140AbbJIHhr (ORCPT ); Fri, 9 Oct 2015 03:37:47 -0400 Received: from out4133-146.mail.aliyun.com ([42.120.133.146]:45939 "EHLO out4133-146.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932809AbbJIHhq (ORCPT ); Fri, 9 Oct 2015 03:37:46 -0400 X-Greylist: delayed 89617 seconds by postgrey-1.27 at vger.kernel.org; Fri, 09 Oct 2015 03:37:45 EDT X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R951e4;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e02c03286;MF=hillf.zj@alibaba-inc.com;NM=1;PH=DS;RN=2;SR=0; Reply-To: "Hillf Danton" From: "Hillf Danton" To: "'Nikolay Borisov'" Cc: "'linux-kernel'" References: <062501d10262$d40d0a50$7c271ef0$@alibaba-inc.com> <56176C10.8040709@kyup.com> In-Reply-To: <56176C10.8040709@kyup.com> Subject: Re: [RFC PATCH 1/2] ext4: Fix possible deadlock with local interrupts disabled and page-draining IPI Date: Fri, 09 Oct 2015 15:37:29 +0800 Message-ID: <062801d10265$5a749fc0$0f5ddf40$@alibaba-inc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQHAX+zed107eP48aS/eHpDRTJRCDgGmffRwnnbUs/A= Content-Language: zh-cn Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > >> @@ -109,8 +109,8 @@ static void ext4_finish_bio(struct bio *bio) > >> if (bio->bi_error) > >> buffer_io_error(bh); > >> } while ((bh = bh->b_this_page) != head); > >> - bit_spin_unlock(BH_Uptodate_Lock, &head->b_state); > >> local_irq_restore(flags); > > > > What if it takes 100ms to unlock after IRQ restored? > > I'm not sure I understand in what direction you are going? Care to > elaborate? > Your change introduces extra time cost the lock waiter has to pay in the case that irq happens before the lock is released. > >> + bit_spin_unlock(BH_Uptodate_Lock, &head->b_state); > >> if (!under_io) { > >> #ifdef CONFIG_EXT4_FS_ENCRYPTION > >> if (ctx) > >> -- > >> 2.5.0 > >