Re: [PATCH] ext2: Use page_mkwrite vma_operations to get mmap write notification.

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Aneesh Kumar K.V <aneesh.kumar@...>
Cc: <cmm@...>, <jack@...>, <linux-ext4@...>, <aneesh.kumar@...>, <linux-mm@...>, <linux-kernel@...>
Date: Thursday, June 5, 2008 - 3:30 pm

On Thu,  5 Jun 2008 22:35:12 +0530
"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com> wrote:


Whoa.  You didn't copy anything like enough mailing lists for a change
of this magnitude.  I added some.

This is a large change in behaviour!

a) applications will now get a synchronous SIGBUS when modifying a
   page over an ENOSPC filesystem.  Whereas previously they could have
   proceeded to completion and then detected the error via an fsync().

   It's going to take more than one skimpy little paragraph to
   justify this, and to demonstrate that it is preferable, and to
   convince us that nothing will break from this user-visible behaviour
   change.

b) we're now doing fs operations (and some I/O) in the pagefault
   code.  This has several implications:

   - performance changes

   - potential for deadlocks when a process takes the fault from
     within a copy_to_user() in, say, mm/filemap.c

   - performing additional memory allocations within that
     copy_to_user().  Possibility that these will reenter the
     filesystem.

And that's just ext2.

For ext3 things are even more complex, because we have the
journal_start/journal_end pair which is effectively another "lock" for
ranking/deadlock purposes.  And now we're taking i_alloc_sem and
lock_page and we're doing ->writepage() and its potential
journal_start(), all potentially within the context of a
copy_to_user().

Now, things become easier because copy_to_user() only happens on the
read() side of things, where we don't hold lock_page() and things are
generally simpler.

But still, this is a high-risk change.  I think we should require a lot
of convincing that issues such as the above have been suitably
considered and addressed, and that the change has had *intense*
testing.


this copied-and-pasted test can now be removed.

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] ext2: Use page_mkwrite vma_operations to get mma..., Andrew Morton, (Thu Jun 5, 3:30 pm)
Re: [PATCH] ext2: Use page_mkwrite vma_operations to get mma..., Aneesh Kumar K.V, (Wed Jun 11, 11:08 am)
Re: [PATCH] ext2: Use page_mkwrite vma_operations to get mma..., Aneesh Kumar K.V, (Thu Jun 12, 12:06 am)