linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Byungchul Park <max.byungchul.park@gmail.com>
To: Theodore Ts'o <tytso@mit.edu>,
	Byungchul Park <max.byungchul.park@gmail.com>,
	Ingo Molnar <mingo@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	david@fromorbit.com, willy@infradead.org,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Amir Goldstein <amir73il@gmail.com>,
	byungchul.park@lge.com, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, linux-block@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, oleg@redhat.com
Subject: Re: [PATCH] locking/lockdep: Remove the cross-release locking checks
Date: Sat, 16 Dec 2017 11:41:42 +0900	[thread overview]
Message-ID: <CANrsvRMAhG0ofEXt-yWm+WhqJDtYZSaVhqguwQHnMU++pGqbVQ@mail.gmail.com> (raw)
In-Reply-To: <20171215211501.v6x6o2ft4khqgbgy@thunk.org>

On Sat, Dec 16, 2017 at 6:15 AM, Theodore Ts'o <tytso@mit.edu> wrote:
> On Fri, Dec 15, 2017 at 05:39:25PM +0900, Byungchul Park wrote:
>>
>> All locks should belong to one class if each path of acquisition
>> can be switchable each other within the class at any time.
>> Otherwise, they should belong to a different class.
>
> OK, so let's go back to my case of a Network Block Device with a local
> file system mounted on it, which is then exported via NFS.
>
> So an incoming TCP packet can go into the NFS server subsystem, then
> be processed by local disk file system, which then does an I/O
> operation to the NBD device, which results in an TCP packet being sent
> out.  Then the response will come back over TCP, into the NBD block
> layer, then into the local disk file system, and that will result in
> an outgoing response to the TCP connection for the NFS protocol.
>
> In order to avoid cross release problems, all locks associated with
> the incoming TCP connection will need to be classified as belonging to
> a different class as the outgoing TCP connection.  Correct?  One
> solution might be to put every single TCP connection into a separate
> class --- but that will explode the number of lock classes which
> Lockdep will need to track, and there is a limited number of lock
> classes (set at compile time) that Lockdep can track.  So if that
> doesn't work, we will have to put something ugly which manually makes
> certain TCP connections "magic" and require them to be put into a
> separate class than all other TCP connections, which will get
> collapsed into a single class.  Basically, any TCP connection which is
> either originated by the kernel, or passed in from userspace into the
> kernel and used by some kernel subsystem, will have to be assigned its
> own lockdep class.
>
> If the TCP connection gets closed, we don't need to track that lockdep
> class any more.  (Or if a device mapper device is torn down, we
> similarly don't need any unique lockdep classes created for that
> device mapper device.)  Is there a way to tell lockdep that a set of
> lockdep classes can be released so we can recover the kernel memory to
> be used to track some new TCP connection or some new device mapper
> device?

Right. I also think lockdep should be able to reflect that
kind of dynamic situations to do a better job.

The fact that kernel works well w/o that work doesn't
mean current status is perfect, in my opinion.

As you know, lockdep is running within very limited
environment so it's very hard to achieve it.

However, anyway, I think that's a problem and should
be solved by modifying lockdep core. Actually, that had
been one on my to-dos, if allowed.

For some waiters, for which this is only solution to play
with cross-release, I think we can invalidate those
waiters for now, while all others still get benefit.

We have added acquire annotations manually to
consider waiters one by one, and I am sure it's going
to continue in the future.

IMO, considering all waiters at once and fixing false
positives in a right way or invalidating one by one is
better than considering waiters one by one as is, of
course, while keeping off by default.

-- 
Thanks,
Byungchul

--
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>

  reply	other threads:[~2017-12-16  2:41 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-13  6:24 About the try to remove cross-release feature entirely by Ingo Byungchul Park
2017-12-13  7:13 ` Byungchul Park
2017-12-13 15:23   ` Bart Van Assche
2017-12-14  3:07   ` Theodore Ts'o
2017-12-14  5:58     ` Byungchul Park
2017-12-14 11:18     ` Peter Zijlstra
2017-12-14 13:30       ` Byungchul Park
2017-12-13 10:46 ` [PATCH] locking/lockdep: Remove the cross-release locking checks Ingo Molnar
2017-12-14  5:01   ` Byungchul Park
2017-12-15  4:05     ` Byungchul Park
2017-12-15  6:24       ` Theodore Ts'o
2017-12-15  7:38         ` Byungchul Park
2017-12-15  8:39         ` Byungchul Park
2017-12-15 21:15           ` Theodore Ts'o
2017-12-16  2:41             ` Byungchul Park [this message]
2017-12-29  1:47 ` About the try to remove cross-release feature entirely by Ingo Byungchul Park
2017-12-29  2:02   ` Byungchul Park
2017-12-29  3:51   ` Theodore Ts'o
2017-12-29  7:28     ` Byungchul Park
2017-12-30  6:16       ` Matthew Wilcox
2017-12-30 15:40         ` Theodore Ts'o
2017-12-30 20:44           ` Matthew Wilcox
2017-12-30 22:40             ` Theodore Ts'o
2017-12-30 23:00               ` Theodore Ts'o
2018-01-01 10:18                 ` Matthew Wilcox
2018-01-01 16:00                   ` Theodore Ts'o
2018-01-03  2:38                     ` Byungchul Park
2018-01-03  2:28                   ` Byungchul Park
2018-01-03  2:58                     ` Dave Chinner
2018-01-03  5:48                       ` Byungchul Park
2018-01-05 16:49                   ` J. Bruce Fields
2018-01-05 17:05                     ` J. Bruce Fields
2018-01-03  2:10               ` Byungchul Park
2018-01-03  7:05                 ` Theodore Ts'o
2018-01-03  8:10                   ` Byungchul Park
2018-01-03  8:23                     ` Byungchul Park
2018-01-03  1:57           ` Byungchul Park
2018-01-02  7:57         ` Byungchul Park
2017-12-29  8:09   ` Amir Goldstein
2017-12-29  9:46     ` Byungchul Park

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=CANrsvRMAhG0ofEXt-yWm+WhqJDtYZSaVhqguwQHnMU++pGqbVQ@mail.gmail.com \
    --to=max.byungchul.park@gmail.com \
    --cc=amir73il@gmail.com \
    --cc=byungchul.park@lge.com \
    --cc=david@fromorbit.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=tytso@mit.edu \
    --cc=willy@infradead.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