[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-mm
Subject:    Re: [RFC 1/2] mm: additional page lock debugging
From:       Sasha Levin <sasha.levin () oracle ! com>
Date:       2013-12-31 16:42:04
Message-ID: 52C2F3DC.2020106 () oracle ! com
[Download RAW message or body]

On 12/31/2013 11:26 AM, Peter Zijlstra wrote:
> On Mon, Dec 30, 2013 at 10:22:02PM -0500, Sasha Levin wrote:
>
>> I really want to use lockdep here, but I'm not really sure how to handle locks which live
>> for a rather long while instead of being locked and unlocked in the same function like
>> most of the rest of the kernel. (Cc Ingo, PeterZ).
>
> Uh what? Lockdep doesn't care about which function locks and unlocks a
> particular lock. Nor does it care how long its held for.

Sorry, I messed up trying to explain that.

There are several places in the code which lock a large amount of pages, something like:

	for (i = 0; i < (1 << order); i++)
		lock_page(&pages[i]);


This triggers two problems:

  - lockdep complains about deadlock since we try to lock another page while one is already
locked. I can clear that by allowing page locks to nest within each other, but that seems
wrong and we'll miss actual deadlock cases.

  - We may leave back to userspace with pages still locked. This is valid behaviour but lockdep
doesn't like that.


Thanks,
Sasha

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic