From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from penguin.e-mind.com (penguin.e-mind.com [195.223.140.120]) by kvack.org (8.8.7/8.8.7) with ESMTP id NAA14871 for ; Tue, 26 Jan 1999 13:38:44 -0500 Date: Tue, 26 Jan 1999 19:37:40 +0100 (CET) From: Andrea Arcangeli Subject: Re: MM deadlock [was: Re: arca-vm-8...] In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-linux-mm@kvack.org To: "Stephen C. Tweedie" Cc: Linus Torvalds , Alan Cox , werner@suse.de, riel@humbolt.geo.uu.nl, Zlatko.Calusic@CARNet.hr, ebiederm+eric@ccr.net, saw@msu.ru, steve@netplus.net, damonbrent@earthlink.net, reese@isn.net, kalle.andersson@mbox303.swipnet.se, bmccann@indusriver.com, bredelin@ucsd.edu, linux-kernel@vger.rutgers.edu, linux-mm@kvack.org List-ID: On Tue, 26 Jan 1999, Andrea Arcangeli wrote: > On Mon, 25 Jan 1999, Stephen C. Tweedie wrote: > > > --- mm/filemap.c.~1~ Thu Jan 21 10:26:41 1999 > > +++ mm/filemap.c Mon Jan 25 12:59:38 1999 > > @@ -125,7 +125,7 @@ > > struct page * page; > > int count; > > > > - count = (limit << 1) >> priority; > > + count = limit >> priority; > > > > page = mem_map + clock; > > do { > > @@ -147,7 +147,6 @@ > > clock = page - mem_map; > > } > > > > - count--; > > OK to remove the << 1 and to move count-- after checking referenced. > > > referenced = test_and_clear_bit(PG_referenced, &page->flags); > > > > if (PageLocked(page)) > > @@ -159,6 +158,8 @@ > > /* We can't free pages unless there's just one user */ > > if (atomic_read(&page->count) != 1) > > continue; > > + > > + count--; > > but this is plain bogus. When your machine will reach 0 freeable pages > (and that happens a bit before to kill the process because OOM) you'll get > an infinite loop in shrink_mmap(). So I gues that it won't be hard to lockup 2.2.0 just causing the number of freeable pages to go to 0. Did somebody tried to go OOM with 2.2.0 yet? Here I can cause nr_freeable_pages to go to 0 pretty easily (and that happens just a bit before to get 1 process killed). I hope that 2.2.0 VM will behave differently. Andrea Arcangeli -- To unsubscribe, send a message with 'unsubscribe linux-mm my@address' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://humbolt.geo.uu.nl/Linux-MM/