From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8024C433E0 for ; Wed, 17 Mar 2021 17:06:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 986B864EB3 for ; Wed, 17 Mar 2021 17:06:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229608AbhCQRGP (ORCPT ); Wed, 17 Mar 2021 13:06:15 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:44665 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229591AbhCQRGE (ORCPT ); Wed, 17 Mar 2021 13:06:04 -0400 Received: from cwcc.thunk.org (pool-72-74-133-215.bstnma.fios.verizon.net [72.74.133.215]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 12HH5xxj031661 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 17 Mar 2021 13:06:00 -0400 Received: by cwcc.thunk.org (Postfix, from userid 15806) id A6E9F15C39C8; Wed, 17 Mar 2021 13:05:59 -0400 (EDT) Date: Wed, 17 Mar 2021 13:05:59 -0400 From: "Theodore Ts'o" To: Shashidhar Patil Cc: linux-ext4@vger.kernel.org Subject: Re: jbd2 task hung in jbd2_journal_commit_transaction Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed, Mar 17, 2021 at 08:30:56PM +0530, Shashidhar Patil wrote: > Hi Theodore, > Thank you for the details about the journalling layer and > insight into the block device layer. > I think Good luck might have clicked. The swap file in our case is > attached to a loop block device before enabling swap using swapon. > Since loop driver processes its IO requests by calling > vfs_iter_write() the write requests re-enter the ext4 > filesystem/journalling code. > Is that right ? There seems to be a possibility of cylic dependency. If that hypothesis is correct, you should see an example of that in one of your stack traces; do you? The loop device creates struct file where the file is opened using O_DIRECT. In the O_DIRECT code path, assuming the file was fully allocate and initialized, it shouldn't involve starting a journal handle. That being said, why are you using a loop device for a swap device at all? Using a swap file directly is going to be much more efficient, and decrease the stack depth and CPU cycles needed to do a swap out if nothing else. If you can reliably reproduce the problem, what happens if you use a swap file directly and cut out the loop device as a swap device? Does it make the problem go away? - Ted