From: Qais Yousef <qais.yousef@arm.com>
To: Andrew Morton <akpm@linux-foundation.org>, linux-mm@kvack.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: lockdep warning in sys_swapon
Date: Mon, 23 Mar 2020 15:30:45 +0000 [thread overview]
Message-ID: <20200323153045.s7ag3lrvfe2cpiiw@e107158-lin.cambridge.arm.com> (raw)
In-Reply-To: <20200323151725.gayvs5g6h5adwqkd@e107158-lin.cambridge.arm.com>
On 03/23/20 15:17, Qais Yousef wrote:
> Hi
>
> I hit the following 2 warnings when running with LOCKDEP=y on arm64 platform
> (juno-r2), running on v5.6-rc6
>
> The 1st one is when I execute `swapon -a`. The 2nd one happens at boot. I have
> /dev/sda2 as my swap in /etc/fstab
>
> Note that I either hit 1 OR 2, but didn't hit both warnings at the same time,
> yet at least.
>
> /dev/sda2 is a usb flash drive, in case it matters somehow.
By the way, I noticed that in claim_swapfile() if we fail we don't release the
lock. Shouldn't we release the lock here?
I tried with that FWIW, but it had no effect on the warnings.
diff --git a/mm/swapfile.c b/mm/swapfile.c
index b2a2e45c9a36..0293e8c7b472 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -2900,8 +2900,10 @@ static int claim_swapfile(struct swap_info_struct *p, struct inode *inode)
}
inode_lock(inode);
- if (IS_SWAPFILE(inode))
+ if (IS_SWAPFILE(inode)) {
+ inode_unlock(inode);
return -EBUSY;
+ }
return 0;
}
Thanks
--
Qais Yousef
next prev parent reply other threads:[~2020-03-23 15:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-23 15:17 lockdep warning in sys_swapon Qais Yousef
2020-03-23 15:30 ` Qais Yousef [this message]
2020-03-23 21:06 ` Andrew Morton
2020-03-23 21:12 ` Darrick J. Wong
2020-03-23 21:59 ` Naohiro Aota
2020-03-25 16:08 ` Darrick J. Wong
2020-03-24 10:51 ` Qais Yousef
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200323153045.s7ag3lrvfe2cpiiw@e107158-lin.cambridge.arm.com \
--to=qais.yousef@arm.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).