All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Mason <chris.mason@oracle.com>
To: Hugh Dickins <hughd@google.com>
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-mm <linux-mm@kvack.org>
Subject: RE: [PATCH 1/14] mm: invalidate_mapping_pages flush cleancache
Date: Tue, 31 May 2011 17:08:25 -0400	[thread overview]
Message-ID: <1306875919-sup-647@shiny> (raw)
In-Reply-To: <alpine.LSU.2.00.1105310951160.1719@sister.anvils>

Excerpts from Hugh Dickins's message of 2011-05-31 13:05:27 -0400:
> On Tue, 31 May 2011, Dan Magenheimer wrote:
> > > 
> > > truncate_inode_pages_range() and invalidate_inode_pages2_range()
> > > call cleancache_flush_inode(mapping) before and after: shouldn't
> > > invalidate_mapping_pages() be doing the same?
> > 
> > I don't claim to be an expert on VFS, and so I have cc'ed
> > Chris Mason who originally placed the cleancache hooks
> > in VFS, but I think this patch is unnecessary.  Instead
> > of flushing ALL of the cleancache pages belonging to
> > the inode with cleancache_flush_inode, the existing code
> > eventually calls __delete_from_page_cache on EACH page
> > that is being invalidated.
> 
> On each one that's in pagecache (and satisfies the other "can we
> do it easily?" conditions peculiar to invalidate_mapping_pages()).
> But there may be other slots in the range that don't reach
> __delete_from_page_cache() e.g. because not currently in pagecache,
> but whose cleancache ought to be flushed.  I think that's what a
> caller of invalidate_mapping_pages(), e.g. drop caches, expects.

We call invalidate_mapping_pages from prune_icache, so if we drop the
cleancache there we lose the cache entries any time the inode is dropped
from ram.

Is there a specific case you're thinking of where we want to drop the
cleancache but don't have the pages?

O_DIRECT perhaps?

-chris

WARNING: multiple messages have this Message-ID (diff)
From: Chris Mason <chris.mason@oracle.com>
To: Hugh Dickins <hughd@google.com>
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-mm <linux-mm@kvack.org>
Subject: RE: [PATCH 1/14] mm: invalidate_mapping_pages flush cleancache
Date: Tue, 31 May 2011 17:08:25 -0400	[thread overview]
Message-ID: <1306875919-sup-647@shiny> (raw)
In-Reply-To: <alpine.LSU.2.00.1105310951160.1719@sister.anvils>

Excerpts from Hugh Dickins's message of 2011-05-31 13:05:27 -0400:
> On Tue, 31 May 2011, Dan Magenheimer wrote:
> > > 
> > > truncate_inode_pages_range() and invalidate_inode_pages2_range()
> > > call cleancache_flush_inode(mapping) before and after: shouldn't
> > > invalidate_mapping_pages() be doing the same?
> > 
> > I don't claim to be an expert on VFS, and so I have cc'ed
> > Chris Mason who originally placed the cleancache hooks
> > in VFS, but I think this patch is unnecessary.  Instead
> > of flushing ALL of the cleancache pages belonging to
> > the inode with cleancache_flush_inode, the existing code
> > eventually calls __delete_from_page_cache on EACH page
> > that is being invalidated.
> 
> On each one that's in pagecache (and satisfies the other "can we
> do it easily?" conditions peculiar to invalidate_mapping_pages()).
> But there may be other slots in the range that don't reach
> __delete_from_page_cache() e.g. because not currently in pagecache,
> but whose cleancache ought to be flushed.  I think that's what a
> caller of invalidate_mapping_pages(), e.g. drop caches, expects.

We call invalidate_mapping_pages from prune_icache, so if we drop the
cleancache there we lose the cache entries any time the inode is dropped
from ram.

Is there a specific case you're thinking of where we want to drop the
cleancache but don't have the pages?

O_DIRECT perhaps?

-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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2011-05-31 21:08 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-31  0:33 [PATCH 0/14] mm: tmpfs and trunc changes, affecting drm Hugh Dickins
2011-05-31  0:33 ` Hugh Dickins
2011-05-31  0:35 ` [PATCH 1/14] mm: invalidate_mapping_pages flush cleancache Hugh Dickins
2011-05-31  0:35   ` Hugh Dickins
2011-05-31 15:49   ` Dan Magenheimer
2011-05-31 15:49     ` Dan Magenheimer
2011-05-31 17:05     ` Hugh Dickins
2011-05-31 17:05       ` Hugh Dickins
2011-05-31 21:08       ` Chris Mason [this message]
2011-05-31 21:08         ` Chris Mason
2011-05-31 22:01         ` Hugh Dickins
2011-05-31 22:01           ` Hugh Dickins
2011-05-31  0:36 ` [PATCH 2/14] mm: move vmtruncate_range to truncate.c Hugh Dickins
2011-05-31  0:36   ` Hugh Dickins
2011-06-01  0:36   ` Christoph Hellwig
2011-06-01  0:36     ` Christoph Hellwig
2011-05-31  0:39 ` [PATCH 3/14] tmpfs: take control of its truncate_range Hugh Dickins
2011-05-31  0:39   ` Hugh Dickins
2011-06-01  0:39   ` Christoph Hellwig
2011-06-01  0:39     ` Christoph Hellwig
2011-06-01 16:58     ` Hugh Dickins
2011-06-01 16:58       ` Hugh Dickins
2011-06-03  5:16       ` Christoph Hellwig
2011-06-03  5:16         ` Christoph Hellwig
2011-06-06  5:37         ` Hugh Dickins
2011-06-06  5:37           ` Hugh Dickins
2011-05-31  0:40 ` [PATCH 4/14] tmpfs: add shmem_read_mapping_page_gfp Hugh Dickins
2011-05-31  0:40   ` Hugh Dickins
2011-06-01  0:42   ` Christoph Hellwig
2011-06-01  0:42     ` Christoph Hellwig
2011-06-01 17:02     ` Hugh Dickins
2011-06-01 17:02       ` Hugh Dickins
2011-05-31  0:42 ` [PATCH 5/14] drm/ttm: use shmem_read_mapping_page Hugh Dickins
2011-05-31  0:42   ` Hugh Dickins
2011-05-31  0:43 ` [PATCH 6/14] drm/i915: " Hugh Dickins
2011-05-31  0:43   ` Hugh Dickins
2011-05-31  0:45 ` [PATCH 7/14] drm/i915: adjust to new truncate_range Hugh Dickins
2011-05-31  0:45   ` Hugh Dickins
2011-06-01  0:43   ` Christoph Hellwig
2011-06-01  0:43     ` Christoph Hellwig
2011-06-01 17:04     ` Hugh Dickins
2011-06-01 17:04       ` Hugh Dickins
2011-05-31  0:46 ` [PATCH 8/14] drm/i915: more struct_mutex locking Hugh Dickins
2011-05-31  0:46   ` Hugh Dickins
2011-05-31  0:48 ` [PATCH 9/14] mm: cleanup descriptions of filler arg Hugh Dickins
2011-05-31  0:48   ` Hugh Dickins
2011-05-31  0:49 ` [PATCH 10/14] mm: truncate functions are in truncate.c Hugh Dickins
2011-05-31  0:49   ` Hugh Dickins
2011-05-31  0:51 ` [PATCH 11/14] mm: tidy vmtruncate_range and related functions Hugh Dickins
2011-05-31  0:51   ` Hugh Dickins
2011-05-31  0:52 ` [PATCH 12/14] mm: consistent truncate and invalidate loops Hugh Dickins
2011-05-31  0:52   ` Hugh Dickins
2011-05-31  0:54 ` [PATCH 13/14] mm: pincer in truncate_inode_pages_range Hugh Dickins
2011-05-31  0:54   ` Hugh Dickins
2011-05-31  0:55 ` [PATCH 14/14] tmpfs: no need to use i_lock Hugh Dickins
2011-05-31  0:55   ` Hugh Dickins
2011-05-31 16:08   ` Tim Chen
2011-05-31 16:08     ` Tim Chen

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=1306875919-sup-647@shiny \
    --to=chris.mason@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=dan.magenheimer@oracle.com \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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 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.