All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Hugh Dickins <hughd@google.com>
Cc: Christoph Hellwig <hch@infradead.org>,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-mm@kvack.org
Subject: Re: [PATCH] mm for fs: add truncate_pagecache_range
Date: Fri, 23 Mar 2012 15:59:50 -0700	[thread overview]
Message-ID: <20120323155950.f9bfb097.akpm@linux-foundation.org> (raw)
In-Reply-To: <alpine.LSU.2.00.1203231406090.2207@eggly.anvils>

On Fri, 23 Mar 2012 14:14:54 -0700 (PDT)
Hugh Dickins <hughd@google.com> wrote:

> On Fri, 23 Mar 2012, Andrew Morton wrote:
> > 
> > --- a/mm/truncate.c~mm-for-fs-add-truncate_pagecache_range-fix
> > +++ a/mm/truncate.c
> > @@ -639,6 +639,9 @@ int vmtruncate_range(struct inode *inode
> >   * with on-disk format, and the filesystem would not have to deal with
> >   * situations such as writepage being called for a page that has already
> >   * had its underlying blocks deallocated.
> > + *
> > + * Must be called with inode->i_mapping->i_mutex held.
> 
> You catch me offguard: I forget whether that's an absolute requirement or
> just commonly the case.  What do the other interfaces in truncate.c say ?-)

i_mutex is generally required, to stabilise i_size.

> > + * Takes inode->i_mapping->i_mmap_mutex.
> 
> Yes, and inode->i_mapping->tree_lock.

I don't think it's necessary to get into the spinning locks for a
high-level function which clearly does sleeping things.


--
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>

WARNING: multiple messages have this Message-ID (diff)
From: Andrew Morton <akpm@linux-foundation.org>
To: Hugh Dickins <hughd@google.com>
Cc: Christoph Hellwig <hch@infradead.org>,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-mm@kvack.org
Subject: Re: [PATCH] mm for fs: add truncate_pagecache_range
Date: Fri, 23 Mar 2012 15:59:50 -0700	[thread overview]
Message-ID: <20120323155950.f9bfb097.akpm@linux-foundation.org> (raw)
In-Reply-To: <alpine.LSU.2.00.1203231406090.2207@eggly.anvils>

On Fri, 23 Mar 2012 14:14:54 -0700 (PDT)
Hugh Dickins <hughd@google.com> wrote:

> On Fri, 23 Mar 2012, Andrew Morton wrote:
> > 
> > --- a/mm/truncate.c~mm-for-fs-add-truncate_pagecache_range-fix
> > +++ a/mm/truncate.c
> > @@ -639,6 +639,9 @@ int vmtruncate_range(struct inode *inode
> >   * with on-disk format, and the filesystem would not have to deal with
> >   * situations such as writepage being called for a page that has already
> >   * had its underlying blocks deallocated.
> > + *
> > + * Must be called with inode->i_mapping->i_mutex held.
> 
> You catch me offguard: I forget whether that's an absolute requirement or
> just commonly the case.  What do the other interfaces in truncate.c say ?-)

i_mutex is generally required, to stabilise i_size.

> > + * Takes inode->i_mapping->i_mmap_mutex.
> 
> Yes, and inode->i_mapping->tree_lock.

I don't think it's necessary to get into the spinning locks for a
high-level function which clearly does sleeping things.



  reply	other threads:[~2012-03-23 22:59 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-23 20:46 [PATCH] mm for fs: add truncate_pagecache_range Hugh Dickins
2012-03-23 20:46 ` Hugh Dickins
2012-03-23 21:01 ` Andrew Morton
2012-03-23 21:01   ` Andrew Morton
2012-03-23 21:14   ` Hugh Dickins
2012-03-23 21:14     ` Hugh Dickins
2012-03-23 22:59     ` Andrew Morton [this message]
2012-03-23 22:59       ` Andrew Morton
2012-03-25 20:26       ` Hugh Dickins
2012-03-25 20:26         ` Hugh Dickins
2012-03-25 20:50         ` Andrew Morton
2012-03-25 20:50           ` Andrew Morton
2012-03-25 21:55           ` Hugh Dickins
2012-03-25 21:55             ` Hugh Dickins
2012-04-03  5:45         ` Joel Becker
2012-04-03  5:45           ` Joel Becker
2012-05-13 21:03 ` Hugh Dickins
2012-05-13 21:03   ` Hugh Dickins
2012-05-17  9:25   ` Joel Becker
2012-05-17  9:25     ` Joel Becker

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=20120323155950.f9bfb097.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=hch@infradead.org \
    --cc=hughd@google.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --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.