linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: dhowells@redhat.com, lsf-pc@lists.linux-foundation.org,
	Matthew Wilcox <willy@infradead.org>,
	Kent Overstreet <kent.overstreet@linux.dev>,
	dwmw2@infradead.org, linux-fsdevel@vger.kernel.org,
	linux-mm@kvack.org
Subject: Re: [LSF/MM/BPF TOPIC] Replacing TASK_(UN)INTERRUPTIBLE with regions of uninterruptibility
Date: Fri, 02 Feb 2024 10:30:32 +0000	[thread overview]
Message-ID: <2704767.1706869832@warthog.procyon.org.uk> (raw)
In-Reply-To: <CAJfpegtOiiBqhFeFBbuaY=TaS2xMafLOES=LHdNx8BhwUz7aCg@mail.gmail.com>

Miklos Szeredi <miklos@szeredi.hu> wrote:

> > We have various locks, mutexes, etc., that are taken on entry to
> > filesystem code, for example, and a bunch of them are taken interruptibly
> > or killably (or ought to be) - but filesystem code might be called into
> > from uninterruptible code, such as the memory allocator, fscache, etc..
> 
> Are you suggesting to make lots more filesystem/vfs/mm sleeps
> killable?  That would present problems with being called from certain
> contexts.

No, it wouldn't.  What I'm suggesting is something like:

	overlayfs_mkdir(inode)
	{
		inode_lock(inode);  <---  This could be interruptible
		...
		begin_task_uninterruptible();
		...
		do_stuff();
		...
		inode->lower->inode->mkdir(inode->lower->inode);
					^--- say ext4_mkdir
		...
		do_more_stuff();
		end_task_uninterruptible();
		inode_unlock(inode);
	}

	ext4_mkdir(inode)
	{
		inode_lock(inode);  <--- This would be interruptible, but
					 called from overlayfs above is now
					 uninterruptible
		...
	}

You bracket the context where interruptibility is bad and then everyone you
call is forced to be uninterruptible.  This would need to be nestable also:

	begin_task_uninterruptible();
	  begin_task_uninterruptible();
	    begin_task_uninterruptible();
	    ...
	    end_task_uninterruptible();  // must not become interruptible
	  end_task_uninterruptible();  // nor this
	end_task_uninterruptible();  // from here *could* be interruptible again

Obviously, we would need to gradate this to accommodate killability also.

David



  parent reply	other threads:[~2024-02-02 10:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-02  8:51 David Howells
2024-02-02  9:08 ` Miklos Szeredi
2024-02-02  9:43   ` Kent Overstreet
2024-02-02 10:30 ` David Howells [this message]
2024-02-02 10:46   ` Miklos Szeredi
2024-02-02 11:22   ` David Howells
2024-02-02 12:06     ` Miklos Szeredi
2024-02-02 12:44     ` Kent Overstreet
2024-02-02 16:23     ` Al Viro
2024-02-03 17:27       ` Kent Overstreet
2024-02-02 13:28 ` Matthew Wilcox

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=2704767.1706869832@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=dwmw2@infradead.org \
    --cc=kent.overstreet@linux.dev \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lsf-pc@lists.linux-foundation.org \
    --cc=miklos@szeredi.hu \
    --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