From patchwork Mon Apr 21 19:18:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 4026041 Return-Path: X-Original-To: patchwork-ocfs2-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 30FA0BFF02 for ; Mon, 21 Apr 2014 19:19:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 60AA02025B for ; Mon, 21 Apr 2014 19:19:31 +0000 (UTC) Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 654DA20204 for ; Mon, 21 Apr 2014 19:19:30 +0000 (UTC) Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s3LJIdAN018345 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 21 Apr 2014 19:18:40 GMT Received: from oss.oracle.com (oss-external.oracle.com [137.254.96.51]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s3LJIYuT003106 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 21 Apr 2014 19:18:34 GMT Received: from localhost ([127.0.0.1] helo=oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1WcJje-0002Tw-00; Mon, 21 Apr 2014 12:18:34 -0700 Received: from ucsinet22.oracle.com ([156.151.31.94]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1WcJjX-0002Th-5g for ocfs2-devel@oss.oracle.com; Mon, 21 Apr 2014 12:18:27 -0700 Received: from userp1030.oracle.com (userp1030.oracle.com [156.151.31.80]) by ucsinet22.oracle.com (8.14.5+Sun/8.14.5) with ESMTP id s3LJIQ7v002756 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Mon, 21 Apr 2014 19:18:26 GMT Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) by userp1030.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s3LJIPx0030124 for ; Mon, 21 Apr 2014 19:18:26 GMT Received: from akpm3.mtv.corp.google.com (unknown [216.239.45.95]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 6BAEB8A1; Mon, 21 Apr 2014 19:18:25 +0000 (UTC) Date: Mon, 21 Apr 2014 12:18:24 -0700 From: Andrew Morton To: Joseph Qi Message-Id: <20140421121824.66710cc2496f84740324137d@linux-foundation.org> In-Reply-To: <5350EDE3.2040605@huawei.com> References: <534FB63A.9090402@huawei.com> <20140417210132.GB27178@wotan.suse.de> <535079A9.9060603@huawei.com> <20140418024539.GE27178@wotan.suse.de> <5350EDE3.2040605@huawei.com> X-Mailer: Sylpheed 3.2.0beta5 (GTK+ 2.24.10; x86_64-pc-linux-gnu) Mime-Version: 1.0 X-Sendmail-CM-Score: 0.00% X-Sendmail-CM-Analysis: v=2.1 cv=UcNoFsiN c=1 sm=1 tr=0 a=5MPDoNpceV4HFXFrvkM3CQ==:117 a=5MPDoNpceV4HFXFrvkM3CQ==:17 a=KM8TuqKuKWIA:10 a=NEiEQogP1MkA:10 a=kj9zAlcOel0A:10 a=Z4Rwk6OoAAAA:8 a=1XWaLZrsAAAA:8 a=ag1SF4gXAAAA:8 a=i0EeH86SAAAA:8 a=7-pm0HgAd1AP5gCuSzcA :9 a=pmaHhaIkvLc-uXRu:21 a=Hw3t1vXz7E01crmh:21 a=CjuIK1q_8ugA:10 a=hPjdaMEvmhQA:10 X-Sendmail-CT-RefID: str=0001.0A090201.53556F02.0088:SCFSTAT19734153, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-Sendmail-CT-Classification: not spam Cc: Mark Fasheh , "ocfs2-devel@oss.oracle.com" Subject: Re: [Ocfs2-devel] [PATCH] ocfs2: limit printk when journal is aborted X-BeenThere: ocfs2-devel@oss.oracle.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ocfs2-devel-bounces@oss.oracle.com Errors-To: ocfs2-devel-bounces@oss.oracle.com X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Fri, 18 Apr 2014 17:18:27 +0800 Joseph Qi wrote: > >>>> + if (printk_timed_ratelimit(&abort_warn_time, 60*HZ)) > >>>> + mlog(ML_ERROR, "status = %d, journal is " > >>>> + "already aborted.\n", status); > >>>> + msleep_interruptible(1000); > >>>> + } > >>> > >>> Why the msleep? ocfs2_commit_thread will wait on the checkpoint_event queue > >>> right after this anyway - is there a problem with it waiting on that? > >>> > >> Since jbd2 is already aborted, commit cache is meaningless. > > > > I understand that, but I'm asking why the msleep and whether we can avoid > > that. To go back to my question: > > > > "ocfs2_commit_thread will wait on the checkpoint_event queue right after > > this anyway - is there a problem with it waiting on that?" > > > > Thanks, > > --Mark > Sorry for my obscure description. > If ocfs2_commit_cache fails because of JBD2_ABORT, j_num_trans won't be cleared. > Then the condition of checkpoint event still evaluates true, so it won't wait. If Mark didn't understand the reason for the msleep then nobody weill, so we need to add a comment. This? This patch seems rather hacky :( Isn't there a better solution? Why even keep the kernel thread running after an abort? --- a/fs/ocfs2/journal.c~ocfs2-limit-printk-when-journal-is-aborted-fix +++ a/fs/ocfs2/journal.c @@ -2193,6 +2193,11 @@ static int ocfs2_commit_thread(void *arg if (printk_timed_ratelimit(&abort_warn_time, 60*HZ)) mlog(ML_ERROR, "status = %d, journal is " "already aborted.\n", status); + /* + * After ocfs2_commit_cache() fails, j_num_trans has a + * non-zero value. Sleep here to avoid a busy-wait + * loop. + */ msleep_interruptible(1000); }