public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* inode->i_dirty_buffers redundant ?
@ 2001-01-24  9:55 V Ganesh
  2001-01-24  9:09 ` Marcelo Tosatti
  2001-01-24 11:26 ` Stephen C. Tweedie
  0 siblings, 2 replies; 12+ messages in thread
From: V Ganesh @ 2001-01-24  9:55 UTC (permalink / raw)
  To: linux-kernel; +Cc: sct

now that we have inode->i_mapping->dirty_pages, what do we need
inode->i_dirty_buffers for ? I understand the latter was added for the O_SYNC
changes before dirty_pages came into the picture. but now both seem to be
doing more or less the same thing.

ganesh
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: inode->i_dirty_buffers redundant ?
@ 2001-01-25 10:47 V Ganesh
  2001-01-25 16:44 ` Stephen C. Tweedie
  0 siblings, 1 reply; 12+ messages in thread
From: V Ganesh @ 2001-01-25 10:47 UTC (permalink / raw)
  To: linux-kernel, marcelo, sct

Stephen C. Tweedie <sct@redhat.com> wrote:
: Hi,

: On Wed, Jan 24, 2001 at 03:25:16PM +0530, V Ganesh wrote:
:> now that we have inode->i_mapping->dirty_pages, what do we need
:> inode->i_dirty_buffers for ?

: Metadata.  Specifically, directory contents and indirection blocks.

: --Stephen

ah, mark_buffer_dirty_inode(). thanks.
so if I understand it,
1. read() and mmap read faults will put the page in i_mapping->clean_pages
2. mmaped writes will (eventually, from msync or unmap or swapout) put the
   page in i_mapping->dirty_pages
3. write() will put pages into i_dirty_buffers (__block_commit_write() calls
   buffer_insert_inode_queue()).

so i_dirty_buffers contains buffer_heads of pages coming from write() as
well as metadata buffers from mark_buffer_dirty_inode(). a dirty MAP_SHARED
page which has been write()n to will potentially exist in both lists.
won't doing a set_dirty_page() instead of buffer_insert_inode_queue() in
__block_commit_write() make things much simpler ? then we'd have i_dirty_buffers
having _only_ metadata, and all data pages in the i_mapping->*_pages lists.

ganesh
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: inode->i_dirty_buffers redundant ?
@ 2001-01-26  9:13 V Ganesh
  0 siblings, 0 replies; 12+ messages in thread
From: V Ganesh @ 2001-01-26  9:13 UTC (permalink / raw)
  To: linux-kernel

Stephen C. Tweedie <sct@redhat.com> wrote:

: That would only complicate things: it would mean we'd have to scan
: both lists on fsync instead of just the one, for example.  There are a

we already do; filemap_fdatasync() is called first in sys_fsync(), though
it usually doesn't have much work I guess.

: number of places where we need buffer lists for dirty data anyway,
: such as for bdflush's background sync to disk.  We also maintain the
: per-page buffer lists as caches of the virtual-to-physical mapping to
: avoid redundant bmap()ping.  So, removing the buffer_heads which alias
: the page cache data isn't an option.  Given that, it's as well to keep
: all the inode's dirty buffers in the one place.

keeping dirty pages in the address space list doesn't preclude any of the
above. the pages could still have buffer_heads attached to them, and
these would cache the block location and be a part of the dirty buffer
list used by bdflush.
I guess both approaches would be roughly the same from a performance
point of view. I feel that keeping all data pages in the address space is more
elegant from a design point of view, but that's quite subjective, of course.

ganesh

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2001-01-26 19:08 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-01-24  9:55 inode->i_dirty_buffers redundant ? V Ganesh
2001-01-24  9:09 ` Marcelo Tosatti
2001-01-24 11:26 ` Stephen C. Tweedie
  -- strict thread matches above, loose matches on Subject: below --
2001-01-25 10:47 V Ganesh
2001-01-25 16:44 ` Stephen C. Tweedie
2001-01-25 20:05   ` Daniel Phillips
2001-01-25 21:30     ` Marcelo Tosatti
2001-01-26 11:35     ` Stephen C. Tweedie
2001-01-26 19:05       ` Daniel Phillips
2001-01-25 21:11   ` Marcelo Tosatti
2001-01-26 17:34     ` Stephen C. Tweedie
2001-01-26  9:13 V Ganesh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox