From: Andrew Morton <akpm@zip.com.au>
To: Dave Hansen <haveblue@us.ibm.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: truncate_list_pages() BUG and confusion
Date: Thu, 07 Mar 2002 17:08:15 -0800 [thread overview]
Message-ID: <3C880EFF.A0789715@zip.com.au> (raw)
In-Reply-To: <3C8809BA.4070003@us.ibm.com>
Dave Hansen wrote:
>
> in truncate_list_pages()
>
> failed = TryLockPage(page);
>
> So, the page is always locked here.
>
> truncate_complete_page(page);
> remove_inode_page(page);
> if (!PageLocked(page))
> PAGE_BUG(page);
>
> page_cache_release(page);
> calls __free_pages_ok(page, 0);
> if (PageLocked(page))
> BUG();
>
> It is a BUG if the page is not locked in remove_inode_page() and also a
> bug if it IS locked in __free_pages_ok(). What am I missing?
the page_cache_release() in truncate_complete_page() is just dropping
the reference count against the page which is due to that page's
presence in the pagecache. We just took it out, so we drop the reference.
Note that the caller of truncate_complete_page() also took a reference to
the page, and undoes that reference *after* unlocking the page. This
additional reference will prevent __free_pages_ok() from being called
by truncate_complete_page().
> ksymoopsed output follows:
>
> kernel BUG at page_alloc.c:109!
Now how did you manage that? Looks like someone re-locked
the page after truncate_list_pages unlocked it.
-
next prev parent reply other threads:[~2002-03-08 1:10 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-03-08 0:45 truncate_list_pages() BUG and confusion Dave Hansen
2002-03-08 1:08 ` Andrew Morton [this message]
2002-03-08 2:54 ` Dave Hansen
2002-03-08 2:55 ` Martin J. Bligh
2002-03-08 3:02 ` Andrew Morton
2002-03-08 3:04 ` Dave Hansen
2002-03-08 21:14 ` Martin J. Bligh
2002-03-08 21:53 ` Andrew Morton
2002-03-08 22:13 ` Dave Hansen
2002-03-08 22:35 ` Andrew Morton
2002-03-09 0:04 ` Martin J. Bligh
2002-03-09 0:17 ` Andrew Morton
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=3C880EFF.A0789715@zip.com.au \
--to=akpm@zip.com.au \
--cc=haveblue@us.ibm.com \
--cc=linux-kernel@vger.kernel.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