linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* objrmap and vmtruncate
@ 2003-04-04 14:34 Hugh Dickins
  2003-04-04 16:14 ` William Lee Irwin III
  2003-04-04 18:54 ` Andrew Morton
  0 siblings, 2 replies; 105+ messages in thread
From: Hugh Dickins @ 2003-04-04 14:34 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Dave McCracken, linux-kernel, linux-mm

I see you're going for locking the page around page_convert_anon,
to guard page->mapping against truncation.  Nice thought,
but the words "tip" and "iceberg" spring to mind.

Truncating a sys_remap_file_pages file?  You're the first to
begin to consider such an absurd possibility: vmtruncate_list
still believes vm_pgoff tells it what needs to be done.

I propose that we don't change vmtruncate_list, zap_page_range, ...
at all for this: let it unmap inappropriate pages, even from a
VM_LOCKED vma, that's just a price userspace pays for the
privilege of truncating a sys_remap_file_pages file.

But truncate_inode_pages should check page_mapped, and if so
try_to_unmap with a force flag to attack even VM_LOCKED vmas.
Sadly, if page_table_lock is held, it won't be able to unmap:
leave those for shrink_list?  But that won't find them once
page->mapping gone: page_convert_anon from here too?
What about invalidate_inode_pages2?

This will also cover some of the racy pages, which another cpu
found in the cache before vmtruncate started, but inserted into
page table after vmtruncate_list passed that way; but it won't
cover those racy pages which were found before, but are not yet
put into the page table (e.g. those where your page_convert_anon
bailed because page->mapping is now NULL).  Worth adding checks
for? but I don't think we have absolute locking against this.

Various places in rmap.c where !page->mapping is considered a
BUG(), but you've now drawn attention to the fact it may get
vmtruncated at any moment.  Easy to remove those BUG()s.

Consider page_add_rmap of page with NULL (or swapper_space)
mapping as Anon?  In which case move all the SetPageAnon stuff
inside rmap.c, and do ClearPageAnon inside there too?

Or, stop resetting page->mapping to NULL when we remove from
page cache?  So objrmap can still find the pages even though
find_get_page etc. cannot.

Sorry, off to replace my "?" key, it's worn out.

Hugh


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

end of thread, other threads:[~2003-04-22 17:57 UTC | newest]

Thread overview: 105+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-04 14:34 objrmap and vmtruncate Hugh Dickins
2003-04-04 16:14 ` William Lee Irwin III
2003-04-04 16:29   ` Hugh Dickins
2003-04-04 18:54 ` Andrew Morton
2003-04-04 21:43   ` Hugh Dickins
2003-04-04 21:45   ` Andrea Arcangeli
2003-04-04 21:58     ` Benjamin LaHaise
2003-04-04 23:07     ` Andrew Morton
2003-04-05  0:03       ` Andrea Arcangeli
2003-04-05  0:31         ` Andrew Morton
2003-04-05  1:31           ` Andrea Arcangeli
2003-04-05  1:52             ` Benjamin LaHaise
2003-04-05  2:22               ` Andrea Arcangeli
2003-04-05 10:01                 ` Jamie Lokier
2003-04-05 10:11                   ` William Lee Irwin III
2003-04-05  2:06             ` Andrew Morton
2003-04-05  2:24               ` Andrea Arcangeli
2003-04-05  2:13           ` Martin J. Bligh
2003-04-05  2:44             ` Andrea Arcangeli
2003-04-05  3:24               ` Andrew Morton
2003-04-05 12:06                 ` Andrew Morton
2003-04-05 15:11                   ` Martin J. Bligh
     [not found]                     ` <20030405161758.1ee19bfa.akpm@digeo.com>
2003-04-06  7:07                       ` William Lee Irwin III
2003-04-05 16:30                   ` Andrea Arcangeli
2003-04-05 19:01                     ` Andrea Arcangeli
2003-04-05 20:14                       ` Andrew Morton
2003-04-05 21:24                     ` Andrew Morton
2003-04-05 22:06                       ` Andrea Arcangeli
2003-04-05 22:31                         ` Andrew Morton
2003-04-05 23:10                           ` Andrea Arcangeli
2003-04-06  1:58                             ` Andrew Morton
2003-04-06 14:47                               ` Andrea Arcangeli
2003-04-06 21:35                                 ` William Lee Irwin III
2003-04-06  7:38                             ` William Lee Irwin III
2003-04-06 14:51                               ` Andrea Arcangeli
2003-04-06 12:37                           ` Jamie Lokier
2003-04-06 13:12                             ` William Lee Irwin III
2003-04-22 11:00                           ` Ingo Molnar
2003-04-22 11:54                             ` William Lee Irwin III
2003-04-22 14:31                               ` Ingo Molnar
2003-04-22 14:56                                 ` William Lee Irwin III
2003-04-22 15:26                                   ` Ingo Molnar
2003-04-22 16:20                                     ` William Lee Irwin III
2003-04-22 16:57                                       ` Andrea Arcangeli
2003-04-22 17:21                                         ` William Lee Irwin III
2003-04-22 18:08                                           ` Andrea Arcangeli
2003-04-22 17:34                                         ` Ingo Molnar
2003-04-22 18:04                                           ` Benjamin LaHaise
2003-04-22 16:58                                       ` Martin J. Bligh
2003-04-22 12:37                             ` Andrea Arcangeli
2003-04-22 13:20                               ` William Lee Irwin III
2003-04-22 14:38                                 ` Martin J. Bligh
2003-04-22 15:10                                   ` William Lee Irwin III
2003-04-22 15:53                                     ` Martin J. Bligh
2003-04-22 14:52                                 ` Andrea Arcangeli
2003-04-22 14:29                             ` Martin J. Bligh
2003-04-22 15:07                               ` Ingo Molnar
2003-04-22 15:42                                 ` William Lee Irwin III
2003-04-22 15:55                                   ` Ingo Molnar
2003-04-22 16:58                                     ` William Lee Irwin III
2003-04-22 17:07                                       ` Ingo Molnar
2003-04-22 15:16                               ` Andrea Arcangeli
2003-04-22 15:49                               ` Ingo Molnar
2003-04-22 16:16                                 ` Martin J. Bligh
2003-04-22 17:24                                   ` Ingo Molnar
2003-04-22 17:45                                   ` John Bradford
2003-04-22 14:32                             ` Martin J. Bligh
2003-04-22 15:09                               ` Ingo Molnar
2003-04-05 21:34                     ` Rik van Riel
2003-04-06  9:29                     ` Benjamin LaHaise
2003-04-05 23:25                   ` William Lee Irwin III
2003-04-05 23:57                     ` Andrew Morton
2003-04-06  0:14                       ` Andrea Arcangeli
2003-04-06  1:39                         ` Andrew Morton
2003-04-06  2:13                       ` William Lee Irwin III
2003-04-06  9:26                     ` Benjamin LaHaise
2003-04-06  9:41                       ` William Lee Irwin III
2003-04-06  9:54                         ` William Lee Irwin III
2003-04-06  2:23                   ` Martin J. Bligh
2003-04-06  3:55                     ` Andrew Morton
2003-04-06  3:08                       ` Martin J. Bligh
2003-04-06  7:42                         ` William Lee Irwin III
2003-04-06 14:49                     ` Alan Cox
2003-04-06 16:13                       ` Martin J. Bligh
2003-04-06 21:34                         ` subobj-rmap Martin J. Bligh
2003-04-06 21:42                           ` subobj-rmap Rik van Riel
2003-04-06 21:52                             ` subobj-rmap Davide Libenzi
2003-04-06 21:55                             ` subobj-rmap Jamie Lokier
2003-04-06 22:39                               ` subobj-rmap William Lee Irwin III
2003-04-06 22:03                             ` subobj-rmap Martin J. Bligh
2003-04-06 22:06                               ` subobj-rmap Martin J. Bligh
2003-04-06 22:15                               ` subobj-rmap Andrea Arcangeli
2003-04-06 22:25                                 ` subobj-rmap Martin J. Bligh
2003-04-07 21:25                                   ` subobj-rmap Andrea Arcangeli
2003-04-06 23:06                               ` subobj-rmap Jamie Lokier
2003-04-06 23:26                                 ` subobj-rmap Martin J. Bligh
2003-04-05  3:45               ` objrmap and vmtruncate Martin J. Bligh
2003-04-05  3:59               ` Rik van Riel
2003-04-05  4:10                 ` William Lee Irwin III
2003-04-05  4:49                   ` Martin J. Bligh
2003-04-05 13:31                     ` Rik van Riel
2003-04-05  4:52               ` Martin J. Bligh
2003-04-05  3:22             ` Andrew Morton
2003-04-05  3:35               ` Martin J. Bligh
2003-04-05  3:53       ` Rik van Riel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).