All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Mason <chris.mason@oracle.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: trond.myklebust@fys.uio.no, npiggin@suse.de,
	linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-mm@kvack.org
Subject: Re: Why doesn't zap_pte_range() call page_mkwrite()
Date: Fri, 24 Apr 2009 08:59:49 -0400	[thread overview]
Message-ID: <1240577989.32585.1.camel@think.oraclecorp.com> (raw)
In-Reply-To: <E1LxFuD-0008M9-1a@pomaz-ex.szeredi.hu>

On Fri, 2009-04-24 at 09:33 +0200, Miklos Szeredi wrote:
> On Fri, 24 Apr 2009, Miklos Szeredi wrote:
> > Hmm, I guess this is a bit nasty: the VM promises filesystems that
> > ->page_mkwrite() will be called when the page is dirtied through a
> > mapping, _almost_ all of the time.  Except when munmap happens to race
> > with clear_page_dirty_for_io().
> > 
> > I don't have any ideas how this could be fixed, CC-ing linux-mm...
> 
> On second thought, we could possibly just ignore the dirty bit in that
> case.  Trying to write to a mapping _during_ munmap() will have pretty
> undefined results, I don't think any sane application out there should
> rely on the results of this.
> 
> But how knows, the world is a weird place...

It does happen in practice, btrfs has fallback code that triggers the
page_mkwrite when it finds a dirty page that wasn't dirtied with help
from the FS.

I'd love to get rid of the fallback ;)

-chris



WARNING: multiple messages have this Message-ID (diff)
From: Chris Mason <chris.mason@oracle.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: trond.myklebust@fys.uio.no, npiggin@suse.de,
	linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-mm@kvack.org
Subject: Re: Why doesn't zap_pte_range() call page_mkwrite()
Date: Fri, 24 Apr 2009 08:59:49 -0400	[thread overview]
Message-ID: <1240577989.32585.1.camel@think.oraclecorp.com> (raw)
In-Reply-To: <E1LxFuD-0008M9-1a@pomaz-ex.szeredi.hu>

On Fri, 2009-04-24 at 09:33 +0200, Miklos Szeredi wrote:
> On Fri, 24 Apr 2009, Miklos Szeredi wrote:
> > Hmm, I guess this is a bit nasty: the VM promises filesystems that
> > ->page_mkwrite() will be called when the page is dirtied through a
> > mapping, _almost_ all of the time.  Except when munmap happens to race
> > with clear_page_dirty_for_io().
> > 
> > I don't have any ideas how this could be fixed, CC-ing linux-mm...
> 
> On second thought, we could possibly just ignore the dirty bit in that
> case.  Trying to write to a mapping _during_ munmap() will have pretty
> undefined results, I don't think any sane application out there should
> rely on the results of this.
> 
> But how knows, the world is a weird place...

It does happen in practice, btrfs has fallback code that triggers the
page_mkwrite when it finds a dirty page that wasn't dirtied with help
from the FS.

I'd love to get rid of the fallback ;)

-chris


--
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:[~2009-04-24 12:59 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-23 18:17 Why doesn't zap_pte_range() call page_mkwrite() Trond Myklebust
2009-04-23 18:17 ` Trond Myklebust
     [not found] ` <1240510668.11148.40.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-04-23 19:52   ` Miklos Szeredi
2009-04-23 19:52     ` Miklos Szeredi
     [not found]     ` <E1Lx4yU-0007A8-Gl-8f8m9JG5TPIdUIPVzhDTVZP2KDSNp7ea@public.gmane.org>
2009-04-23 20:42       ` Trond Myklebust
2009-04-23 20:42         ` Trond Myklebust
2009-04-24  7:15         ` Miklos Szeredi
2009-04-24  7:15           ` Miklos Szeredi
     [not found]           ` <E1LxFd4-0008Ih-Rd-8f8m9JG5TPIdUIPVzhDTVZP2KDSNp7ea@public.gmane.org>
2009-04-24  7:33             ` Miklos Szeredi
2009-04-24  7:33               ` Miklos Szeredi
2009-04-24  7:33               ` Miklos Szeredi
2009-04-24 12:59               ` Chris Mason [this message]
2009-04-24 12:59                 ` Chris Mason
2009-04-24 13:31                 ` Trond Myklebust
2009-04-24 14:06                   ` Trond Myklebust
2009-04-24 16:18               ` Jamie Lokier
2009-04-24 10:41             ` Robin Holt
2009-04-24 10:41               ` Robin Holt
2009-04-24 10:41               ` Robin Holt
2009-04-24 14:52               ` Miklos Szeredi
     [not found]                 ` <E1LxMlO-0000sU-1J-8f8m9JG5TPIdUIPVzhDTVZP2KDSNp7ea@public.gmane.org>
2009-04-24 17:00                   ` Trond Myklebust
2009-04-24 17:00                     ` Trond Myklebust
2009-04-24 17:00                     ` Trond Myklebust
     [not found]                     ` <1240592448.4946.35.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-04-25  5:10                       ` Nick Piggin
2009-04-25  5:10                         ` Nick Piggin
2009-04-25  5:10                         ` Nick Piggin
2009-09-08 15:30                         ` Chris Mason
2009-09-08 15:41                           ` Nick Piggin
2009-09-08 15:41                           ` Nick Piggin
2009-09-08 15:41                           ` Nick Piggin
2009-09-08 15:41                             ` Nick Piggin
2009-09-08 16:31                             ` Chris Mason
2009-09-08 17:00                               ` Nick Piggin
2009-09-08 17:00                                 ` Nick Piggin
2009-09-08 17:00                               ` Nick Piggin
2009-09-08 17:00                               ` Nick Piggin
2009-09-09  2:21                           ` Christoph Hellwig
2009-09-09  2:21                           ` Christoph Hellwig
2009-09-09  2:21                           ` Christoph Hellwig
2009-09-09  2:21                             ` Christoph Hellwig
2009-09-09  5:39                             ` Nick Piggin
2009-09-09  5:39                               ` Nick Piggin
2009-09-09  5:39                               ` Nick Piggin

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=1240577989.32585.1.camel@think.oraclecorp.com \
    --to=chris.mason@oracle.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=npiggin@suse.de \
    --cc=trond.myklebust@fys.uio.no \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.