public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 1/13] misc fixes
@ 2002-07-28  7:32 Andrew Morton
  2002-07-29  7:26 ` Daniel Phillips
  0 siblings, 1 reply; 11+ messages in thread
From: Andrew Morton @ 2002-07-28  7:32 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: lkml



There are a few VM-related patches in this series.  Mainly fixes;
feature work is on hold.

We have some fairly serious locking contention problems with the reverse
mapping's pte_chains.  Until we have a clear way out of that I believe
that it is best to not merge code which has a lot of rmap dependency.

It is apparent that these problems will not be solved by tweaking -
some redesign is needed.  In the 2.5 timeframe the only practical
solution appears to be page table sharing, based on Daniel's February
work.  Daniel and Dave McCracken are working that.


Some bits and pieces here:


- list_splice() has an open-coded list_empty() in it.  Use
  list_empty() instead.

- in shrink_cache() we have a local `nr_pages' which shadows another
  local.  Rename the inner one.  (Nikita Danilov)

- Add a BUG() on a can't-happen code path in page_remove_rmap().

- Tighten up the bug checks in the BH completion handlers - if the
  buffer is still under IO then it must be locked, because we unlock it
  inside the page_uptodate_lock.




 fs/buffer.c          |   10 ++++------
 include/linux/list.h |    4 +---
 mm/rmap.c            |    2 ++
 mm/vmscan.c          |    6 +++---
 4 files changed, 10 insertions(+), 12 deletions(-)

--- 2.5.29/include/linux/list.h~misc	Sat Jul 27 23:38:12 2002
+++ 2.5.29-akpm/include/linux/list.h	Sat Jul 27 23:38:12 2002
@@ -156,9 +156,7 @@ static inline void __list_splice(list_t 
  */
 static inline void list_splice(list_t *list, list_t *head)
 {
-	list_t *first = list->next;
-
-	if (first != list)
+	if (!list_empty(list))
 		__list_splice(list, head);
 }
 
--- 2.5.29/mm/vmscan.c~misc	Sat Jul 27 23:38:12 2002
+++ 2.5.29-akpm/mm/vmscan.c	Sat Jul 27 23:49:01 2002
@@ -200,8 +200,8 @@ shrink_cache(int nr_pages, zone_t *class
 			 * so the direct writes to the page cannot get lost.
 			 */
 			int (*writeback)(struct page *, int *);
-			const int nr_pages = SWAP_CLUSTER_MAX;
-			int nr_to_write = nr_pages;
+			const int cluster_size = SWAP_CLUSTER_MAX;
+			int nr_to_write = cluster_size;
 
 			writeback = mapping->a_ops->vm_writeback;
 			if (writeback == NULL)
@@ -209,7 +209,7 @@ shrink_cache(int nr_pages, zone_t *class
 			page_cache_get(page);
 			spin_unlock(&pagemap_lru_lock);
 			(*writeback)(page, &nr_to_write);
-			max_scan -= (nr_pages - nr_to_write);
+			max_scan -= (cluster_size - nr_to_write);
 			page_cache_release(page);
 			spin_lock(&pagemap_lru_lock);
 			continue;
--- 2.5.29/mm/rmap.c~misc	Sat Jul 27 23:38:12 2002
+++ 2.5.29-akpm/mm/rmap.c	Sat Jul 27 23:49:03 2002
@@ -205,6 +205,8 @@ void page_remove_rmap(struct page * page
 	}
 	printk("\n");
 	printk(KERN_ERR "page_remove_rmap: driver cleared PG_reserved ?\n");
+#else
+	BUG();
 #endif
 
 out:
--- 2.5.29/fs/buffer.c~misc	Sat Jul 27 23:38:16 2002
+++ 2.5.29-akpm/fs/buffer.c	Sat Jul 27 23:38:25 2002
@@ -514,9 +514,8 @@ static void end_buffer_async_read(struct
 		if (!buffer_uptodate(tmp))
 			page_uptodate = 0;
 		if (buffer_async_read(tmp)) {
-			if (buffer_locked(tmp))
-				goto still_busy;
-			BUG();
+			BUG_ON(!buffer_locked(tmp));
+			goto still_busy;
 		}
 		tmp = tmp->b_this_page;
 	} while (tmp != bh);
@@ -564,9 +563,8 @@ static void end_buffer_async_write(struc
 	tmp = bh->b_this_page;
 	while (tmp != bh) {
 		if (buffer_async_write(tmp)) {
-			if (buffer_locked(tmp))
-				goto still_busy;
-			BUG();
+			BUG_ON(!buffer_locked(tmp));
+			goto still_busy;
 		}
 		tmp = tmp->b_this_page;
 	}

.

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

end of thread, other threads:[~2002-07-31 22:18 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-28  7:32 [patch 1/13] misc fixes Andrew Morton
2002-07-29  7:26 ` Daniel Phillips
2002-07-29  8:44   ` Rik van Riel
2002-07-29  8:40     ` David S. Miller
2002-07-29 20:00   ` Andrew Morton
2002-07-29 20:55     ` Rik van Riel
2002-07-29 22:36       ` Daniel Phillips
2002-07-29 21:51     ` Daniel Phillips
2002-07-31 22:22       ` Rmap setup/teardown suckage Daniel Phillips
2002-07-30 10:11     ` [patch 1/13] misc fixes Daniel Phillips
2002-07-30 10:18     ` Daniel Phillips

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox