Skip to contentSkip to conversation

HIGHMEM+buffers

PATCH New Mark Hemment 1 participant 1 message Feb 18, 2001

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 HIGHMEM+buffers

Hi,

On a 4GB SMP box, configured with HIGHMEM support, making a 670G
(obviously using a volume manager) ext2 file system takes 12minutes (over 10minutes of sys time).

One problem is buffer allocations do not use HIGHMEM, but the
nr_free_buffer_pages() doesn't take this into account causing balance_dirty_state() to return the wrong state.

The attached patch fixes the worse part of nr_free_buffer_pages() - with
HIGHMEM it now only counts free+inactive pages in the NORMAL and DMA zone. It doesn't fix the inactive_dirty calculation.
Also, in buffer.c:flush_dirty_buffers(), it is worthwhile to kick the
disk queues if it decides to reschedule.

With the patch, that 670G filesystem can be created in 5m36secs (under
half the time).

Patch is against 2.4.1-ac18.

Mark

fs/buffer.c +4 -1
diff -urN -X dontdiff vanilla-2.4.1-ac18/fs/buffer.c markhe-2.4.1-ac18/fs/buffer.c
@@ -2638,8 +2638,11 @@
 		ll_rw_block(WRITE, 1, &bh);
 		atomic_dec(&bh->b_count);
 
-		if (current->need_resched)
+		if (current->need_resched) {
+			/* kick what we've already pushed down */
+			run_task_queue(&tq_disk);
 			schedule();
+		}
 		goto restart;
 	}
  out_unlock:
include/linux/swap.h +2 -0
diff -urN -X dontdiff vanilla-2.4.1-ac18/include/linux/swap.h markhe-2.4.1-ac18/include/linux/swap.h
@@ -65,7 +65,9 @@
 
 extern int nr_swap_pages;
 FASTCALL(unsigned int nr_free_pages(void));
+FASTCALL(unsigned int nr_free_pages_zone(int));
 FASTCALL(unsigned int nr_inactive_clean_pages(void));
+FASTCALL(unsigned int nr_inactive_clean_pages_zone(int));
 FASTCALL(unsigned int nr_free_buffer_pages(void));
 extern int nr_active_pages;
 extern int nr_inactive_dirty_pages;
mm/page_alloc.c +48 -2

68 lines not on this page · raw message