mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hugh Dickins <hugh@veritas.com>
To: Andrew Morton <akpm@osdl.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	dhowells@redhat.com, christoph@lameter.com, mbligh@google.com,
	npiggin@suse.de, torvalds@osdl.org
Subject: Re: [PATCH 1/5] mm: tracking shared dirty pages
Date: Wed, 28 Jun 2006 20:49:42 +0100 (BST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0606282039020.26373@blonde.wat.veritas.com> (raw)
In-Reply-To: <20060627175747.521c6733.akpm@osdl.org>

On Tue, 27 Jun 2006, Andrew Morton wrote:
> Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:
> >
> > Tracking of dirty pages in shared writeable mmap()s.
> 
> I mangled this a bit to fit it on top of Christoph's vm counters rewrite
> (mm/page-writeback.c).
> 
> I worry about the changes to __set_page_dirty_nobuffers() and
> test_clear_page_dirty().
> 
> They both already require that the page be locked (or that the
> address_space be otherwise pinned).  But I'm not sure we get that right at
> present.  With these changes, our exposure to that gets worse, and we
> additionally are exposed to the possibility of the page itself being
> reclaimed, and not just the address_space.
> 
> So ho hum.  I'll stick this:
> 
> --- a/mm/page-writeback.c~mm-tracking-shared-dirty-pages-checks
> +++ a/mm/page-writeback.c
> @@ -625,6 +625,7 @@ EXPORT_SYMBOL(write_one_page);
>   */
>  int __set_page_dirty_nobuffers(struct page *page)
>  {
> +	WARN_ON_ONCE(!PageLocked(page));

I expect this warning to fire: __set_page_dirty_nobuffers is very
careful about page->mapping, it knows it might change precisely
because we often don't have PageLocked here.

>  	if (!TestSetPageDirty(page)) {
>  		struct address_space *mapping = page_mapping(page);
>  		struct address_space *mapping2;
> @@ -722,6 +723,7 @@ int test_clear_page_dirty(struct page *p
>  	struct address_space *mapping = page_mapping(page);
>  	unsigned long flags;
>  
> +	WARN_ON_ONCE(!PageLocked(page));

I don't expect this warning to fire: I checked a month or two ago,
and just checked again, I believe all paths have PageLocked here.
If not, we certainly do want to know about it.

>  	if (mapping) {
>  		write_lock_irqsave(&mapping->tree_lock, flags);
>  		if (TestClearPageDirty(page)) {
> _
> 
> in there.

Hugh

  reply	other threads:[~2006-06-28 19:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-27 18:28 [PATCH 0/5] mm: tracking dirty pages -v13 Peter Zijlstra
2006-06-27 18:28 ` [PATCH 1/5] mm: tracking shared dirty pages Peter Zijlstra
2006-06-28  0:57   ` Andrew Morton
2006-06-28 19:49     ` Hugh Dickins [this message]
2006-06-28 19:58       ` Andrew Morton
2006-06-28 17:41   ` Hugh Dickins
2006-06-27 18:28 ` [PATCH 2/5] mm: balance " Peter Zijlstra
2006-06-27 18:28 ` [PATCH 3/5] mm: msync() cleanup Peter Zijlstra
2006-06-27 18:28 ` [PATCH 4/5] mm: optimize the new mprotect() code a bit Peter Zijlstra
2006-06-27 18:29 ` [PATCH 5/5] mm: small cleanup of install_page() Peter Zijlstra
  -- strict thread matches above, loose matches on Subject: below --
2006-06-23 22:31 [PATCH 0/5] mm: tracking dirty pages -v11 Peter Zijlstra
2006-06-23 22:31 ` [PATCH 1/5] mm: tracking shared dirty pages Peter Zijlstra
2006-06-23 23:54   ` Peter Zijlstra

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=Pine.LNX.4.64.0606282039020.26373@blonde.wat.veritas.com \
    --to=hugh@veritas.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@osdl.org \
    --cc=christoph@lameter.com \
    --cc=dhowells@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mbligh@google.com \
    --cc=npiggin@suse.de \
    --cc=torvalds@osdl.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®