linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* filemap.c SMP bug in 2.4.0-test*
@ 2000-08-15 22:10 Rik van Riel
  2000-08-16  2:43 ` Linus Torvalds
  2000-08-16  3:26 ` Linus Torvalds
  0 siblings, 2 replies; 6+ messages in thread
From: Rik van Riel @ 2000-08-15 22:10 UTC (permalink / raw)
  To: linux-mm
  Cc: Stephen C. Tweedie, Linus Torvalds, Andrea Arcangeli, Marcelo Tosatti

Hi,

it appears that a debugging check in my VM patch has uncovered
a bug in filemap.c (which could explain the "innd failing"
thread on linux-kernel).

The debugging check (in mm/swap.c::lru_cache_add(), line 232)
checks if the page which is to be added to the page lists is
already on one of the lists. In case it is, a nice backtrace
follows...

from mm/swap.c:
    227 void lru_cache_add(struct page * page)
    228 {
    229         spin_lock(&pagemap_lru_lock);
    230         if (!PageLocked(page))
    231                 BUG();
    232         DEBUG_ADD_PAGE
    233         add_page_to_active_list(page);

from include/mm/swap.h:
    199 #define DEBUG_ADD_PAGE \
    200         if (PageActive(page) || PageInactiveDirty(page) || \
    201                              PageInactiveClean(page)) BUG();

The backtrace I got points to some place deep inside
mm/filemap.c, in code I really didn't touch and I
wouldn't want to touch if this bug wasn't here ;)

>>EIP; c012e370 <lru_cache_add+5c/d4>   <=====
Trace; c021b33e <tvecs+1dde/19f60>
Trace; c021b579 <tvecs+2019/19f60>
Trace; c0127823 <add_to_page_cache_locked+cb/dc>
Trace; c0130a3c <add_to_swap_cache+84/8c>
Trace; c0130d00 <read_swap_cache_async+68/98>
Trace; c0125c8b <handle_mm_fault+143/1c0>
Trace; c0113d33 <do_page_fault+143/3f0>

I've had a few variants of this, but always the
add_to_page_cache* functions were involved...

BTW, in the normal source tree, this situation
could lead to corruption of the lru list. Maybe
this explains the innd problems, maybe not, but
I think we should at least add the debugging
code to vanilla 2.4 as well in order to catch
this bug.

On a related note, the new VM patch seems to be
well-behaved, solid and nicely performant now. ;)

regards,

Rik
--
"What you're running that piece of shit Gnome?!?!"
       -- Miguel de Icaza, UKUUG 2000

http://www.conectiva.com/		http://www.surriel.com/

--
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.eu.org/Linux-MM/

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

end of thread, other threads:[~2000-08-16  4:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-08-15 22:10 filemap.c SMP bug in 2.4.0-test* Rik van Riel
2000-08-16  2:43 ` Linus Torvalds
2000-08-16  2:46   ` Rik van Riel
2000-08-16  3:26 ` Linus Torvalds
2000-08-16  3:40   ` Rik van Riel
2000-08-16  4:09     ` 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