Skip to contentSkip to conversation

2.5.50-mm1

DISCUSSION Andrew Morton 2 participants 2 messages Dec 3, 2002 – Dec 4, 2002

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

url: http://www.zip.com.au/~akpm/linux/patches/2.5/2.5.50/2.5.50-mm1/

Nothing particularly exciting here. There are two diffs at the above
site: 2.5.50-mm1.gz is the full patch, and 2.5.50-mm1-shpte.gz is everything up to `shpte-always-on.patch'. The latter is for Dave to create diffs against.

Changes since 2.5.49-mm2:

+fbcon-timer-fix.patch
+hugepage-fixes.patch

Random fixes

+ext3-oldalloc.patch

Add the oldalloc' and orlov' mount options to ext3.

ext3 has taken a big performance hit in dbench-on-scsi-on-SMP. This is due to the Orlov allocator triggering a weakness in the ext2/ext3 block allocator design.

For a full analysis and protopatches see
http://sourceforge.net/mailarchive/forum.php?thread_id=1365460&forum_id=6379

Bottom line: we need to strengthen the block allocator. The `oldalloc' mount option can be used to determine whether any performance regression is due to this problem. Same deal with ext2, which is also affected.

+dio-return-partial-result.patch

A direct-IO correctness fix.

+deprecate-bdflush.patch

Warn about use of sys_bdflush()

+suppress-write-error-warnings.patch

Suppress some scary warnings due to write I/O errors.

+quota-smp-locks.patch

Jan Kara's quota update - remove BKL, replace with private locking.

+shpte-always-on.patch

Always enable shared pagetables on ia32. If it's merged, it will be merged in the "always on" state, and it needs the testing.

+sync_fs.patch
+ext3_sync_fs.patch

Fix the ext3 data=journal unmount problem.

+ext3-fsync-speedup.patch

Small tweak to the ext3 fsync() path.

+page-walk-api-bugfix.patch

A bugfix. (Ingo, the page-walk API probably needs updating for mm/nommu.c)

All 65 patches:

linus.patch
cset-1.924.1.2-to-1.968.txt.gz

fbcon-timer-fix.patch
timer fixes

hugepage-fixes.patch
hugetlbpage.c build fix

epoll-bits-0.57.patch
epoll bits 0.57 ( on top of 2.5.49 ) ...

kgdb.patch

ext3-oldalloc.patch
add the oldalloc' and orlov' mount options to ext3

simplified-vm-throttling.patch
Remove the final per-page throttling site in the VM

page-reclaim-motion.patch
Move reclaimable pages to the tail ofthe inactive list on IO completion

handle-fail-writepage.patch
Special-case fail_writepage() in page reclaim

activate-unreleaseable-pages.patch
Move unreleasable pages onto the active list

dio-return-partial-result.patch

aio-direct-io-infrastructure.patch
AIO support for raw/O_DIRECT

deferred-bio-dirtying.patch
bio dirtying infrastructure

aio-direct-io.patch
AIO support for raw/O_DIRECT

aio-dio-really-submit.patch
Fix up aio-for-dio

aio-dio-deferred-dirtying.patch
Use the deferred-page-dirtying code in the AIO-DIO code.

aio-dio-debug.patch

dio-counting.patch

dio-reduce-context-switch-rate.patch
Reduced wakeup rate in direct-io code

ipc_barriers.patch
memory barrier work in ipc/util.c

signal-speedup.patch
speed up signals

reiserfs-readpages.patch
reiserfs v3 readpages support

deprecate-bdflush.patch
deprecate use of bdflush()

reduce-random-context-switch-rate.patch
Reduce context switch rate due to the random driver

pf_memdie.patch
Subject: Re: [patch] 2.5: kill PF_MEMDIE

suppress-write-error-warnings.patch
suppress some bufer-layer warnings on write IO errors

truncate-speedup.patch
truncate speedup

spill-lru-lists.patch
Fix interaction between batched lru addition and hot/cold pages

readdir-speedup.patch
readdir speedup and fixes

poll-1-wqalloc.patch
poll 1/6: reduced mempory requirements

poll-2-selectalloc.patch
poll 2/6: put small bitmaps into a local

poll-3-alloc.patch
poll 3/6: improved pollfd memory allocation

poll-4-fast-select.patch
poll 4/6: select() speedups

poll-5-fast-poll.patch
poll 5/6: poll() speedup

poll-6-merge.patch
poll6/6: merge poll() and select() common code

bcrl-printk.patch

read_zero-speedup.patch
speed up read_zero() for !CONFIG_MMU

nommu-rmap-locking.patch
Fix rmap locking for CONFIG_SWAP=n

semtimedop.patch
semtimedop - semop() with a timeout

writeback-handle-memory-backed.patch
skip memory-backed filesystems in writeback

remove-fail_writepage.patch
Remove fail_writepage()

page-reservation.patch
Page reservation API

wli-show_free_areas.patch
show_free_areas extensions

inlines-net.patch

rbtree-iosched.patch
rbtree-based IO scheduler

quota-smp-locks.patch
Subject: [PATCH] Quota SMP locks

shpte-ng.patch
pagetable sharing for ia32

shpte-always-on.patch
Force CONFIG_SHAREPTE=y for ia32

ptrace-flush.patch
Subject: [PATCH] ptrace on 2.5.44

buffer-debug.patch
buffer.c debugging

warn-null-wakeup.patch

pentium-II.patch
Pentium-II support bits

radix-tree-overflow-fix.patch
handle overflows in radix_tree_gang_lookup()

rcu-stats.patch
RCU statistics reporting

auto-unplug.patch
self-unplugging request queues

less-unplugging.patch
Remove most of the blk_run_queues() calls

sync_fs.patch
Add a sync_fs super_block operation

ext3_sync_fs.patch
implement ext3_sync_fs

ext3-fsync-speedup.patch
Clean up ext3_sync_file()

dcache_rcu-2-2.5.48.patch

dcache_rcu-3-2.5.48.patch

page-walk-api.patch

page-walk-api-improvements.patch

page-walk-api-bugfix.patch
page-walk API fixes

page-walk-scsi.patch

#1 lore raw

Updated and improved page-walk API (was: 2.5.50-mm1)

Hi Andrew,
hi list readers,

Quoted 2 lines · Andrew Morton

A bugfix. (Ingo, the page-walk API probably needs updating for mm/nommu.c)

I don't know exactly which paths of the page-walk API are walked by the nommu stuff.

The changes in mm/mmap.c and mm/mlock.c are really necessary, even if you don't plan to apply this patch.

I implemented some comments from Kai, Doug, Gerd and you. I hope the current implementation is now more valuable and correct.

If I need to implement the complete API also for nommu, then I could also implement it for the vmalloc() space, because this is nearly the same, what do you think?

This time I could only check compilation, because gcc 2.95.2 has problems compiling fs/readdir.c and I had to back it out, leaving an unusable kernel behind.

diffstat:

 drivers/scsi/sg.c         |   57 +++++++++---------------
 drivers/scsi/st.c         |   56 +++++++++++------------
 drivers/scsi/st.h         |    3 +
 include/linux/page_walk.h |   15 ++++--
 mm/mlock.c                |    2
 mm/mmap.c                 |    4 -
 mm/nommu.c                |   18 ++++++-
 mm/page_walk.c            |  108 ++++++++++++++++++++++++++++++++++------------
 8 files changed, 163 insertions, 100 deletions

Patch against 2.5.50-mm1 is attached.

Thanks for your efforts!

Regards

Ingo Oeser

Signature · 1 line
Science is what we can tell a computer. Art is everything else. --- D.E.Knuth
drivers/scsi/sg.c +23 -34
diff -Naur linux-2.5.50-mm1/drivers/scsi/sg.c linux-2.5.50-mm1-ioe/drivers/scsi/sg.c
@@ -138,6 +138,9 @@
 	unsigned b_malloc_len;	/* actual len malloc'ed in buffer */
 	void *buffer;		/* Data buffer or scatter list (k_use_sg>0) */
 	char dio_in_use;	/* 0->indirect IO (or mmap), 1->dio */
+#ifdef SG_ALLOW_DIO_CODE
+	struct gup_add_sgls gup;/* used if dio_in_use == 1, else garbage -ioe */
+#endif /* SG_ALLOW_DIO_CODE */
 	unsigned char cmd_opcode; /* first byte of command */
 } Sg_scatter_hold;
 
@@ -227,7 +230,6 @@
 static inline unsigned sg_jif_to_ms(int jifs);
 static int sg_allow_access(unsigned char opcode, char dev_type);
 static int sg_build_direct(Sg_request * srp, Sg_fd * sfp, int dxfer_len);
-// static void sg_unmap_and(Sg_scatter_hold * schp, int free_also);
 static Sg_device *sg_get_dev(int dev);
 static inline unsigned char *sg_scatg2virt(const struct scatterlist *sclp);
 #ifdef CONFIG_PROC_FS
@@ -1652,7 +1654,6 @@
 	Sg_scatter_hold *req_schp = &srp->data;
 
 	SCSI_LOG_TIMEOUT(4, printk("sg_finish_rem_req: res_used=%d\n", (int) srp->res_used));
-	// sg_unmap_and(&srp->data, 1);
 	if (srp->res_used)
 		sg_unlink_reserve(sfp, srp);
 	else
@@ -1690,49 +1691,39 @@
    (i.e., either completely successful or fails)
 */
 static int 
-sg_map_user_pages(struct scatterlist *sgl, const unsigned int max_sgls, 
+sg_map_user_pages(Sg_scatter_hold *schp, const unsigned int max_sgls, 
 	          unsigned long uaddr, size_t count, int rw)
 {
-	struct gup_add_sgls gup;
+	struct gup_add_sgls *gup = &schp->gup;
 	int ret;
 	
-	sgl = setup_sgl_page_walk(&gup, uaddr, uaddr+count, rw == READ, sgl);
-	
-	/* We need a bigger scatterlist vector. 
-	 * Caller should split requests. It might also be handled by this
-	 * function, but this requires a rewrite of the callers. -ioe
-	 */
-	if (gup.max_sgls > max_sgls)
-		return -ENOMEM;
+	setup_sgl_page_walk(gup, 
+			uaddr, 
+			uaddr + count, 
+			rw == READ,
+			(struct scatterlist *)schp->buffer,
+			max_sgls,
+			ULONG_MAX);
 	
 	down_read(&current->mm->mmap_sem);
-	/* If error, we return it, but the sgl is already used! */
-	ret = walk_user_pages(&gup.pw);
+	ret = walk_user_pages(&gup->pw);
 	up_read(&current->mm->mmap_sem);
-	if (ret >= 0)
-		fixup_sgl_walk(&gup, uaddr, uaddr + count);
 
-	return (ret < 0) ? ret : gup.count;
+	/* If gup->todo */
+	return (ret < 0) ? ret : gup->count;
 }
 
 
 /* And unmap them... */
 static int 
-sg_unmap_user_pages(struct scatterlist *sgl, const unsigned int nr_pages,
-		    int dirtied)
+sg_unmap_user_pages(Sg_scatter_hold *schp, unsigned int dirtied)
 {
-	int i;
-
-	for (i=0; i < nr_pages; i++) {
-		if (dirtied && !PageReserved(sgl[i].page))
-			SetPageDirty(sgl[i].page);
-		/* unlock_page(sgl[i].page); */
-		/* FIXME: cache flush missing for rw==READ
-		 * FIXME: call the correct reference counting function
-		 */
-		page_cache_release(sgl[i].page);
-	}
+	struct gup_add_sgls *gup = &schp->gup;
 
+	/* Reading from VM doesn't dirty it's pages! -ioe */
+	if (gup->pw.vm_flags & (VM_READ|VM_MAYREAD)) dirtied = 0;
+	
+	cleanup_sgl_page_walk(gup, dirtied);
 	return 0;
 }
 
@@ -1748,15 +1739,13 @@
 	sg_io_hdr_t *hp = &srp->header;
 	Sg_scatter_hold *schp = &srp->data;
 	int sg_tablesize = sfp->parentdp->sg_tablesize;
-	struct scatterlist *sgl;
 	int mx_sc_elems, res;
 
 	mx_sc_elems = sg_build_sgat(schp, sfp, sg_tablesize);
         if (mx_sc_elems <= 0) {
                 return 1;
         }
-	sgl = (struct scatterlist *)schp->buffer;
-	res = sg_map_user_pages(sgl, mx_sc_elems, (unsigned long)hp->dxferp, 
+	res = sg_map_user_pages(schp, mx_sc_elems, (unsigned long)hp->dxferp, 
 			dxfer_len, 
 			(SG_DXFER_TO_DEV == hp->dxfer_direction) ? 1 : 0);
 	if (res <= 0)
@@ -1978,7 +1967,7 @@
 
 		if (schp->dio_in_use) {
 #ifdef SG_ALLOW_DIO_CODE
-			sg_unmap_user_pages(sclp, schp->k_use_sg, TRUE);
+			sg_unmap_user_pages(schp, schp->k_use_sg);
 #endif
 		} else {
 			int k;
drivers/scsi/st.c +27 -29

130 lines not on this page · raw message

drivers/scsi/st.h +3 -0
diff -Naur linux-2.5.50-mm1/drivers/scsi/st.h linux-2.5.50-mm1-ioe/drivers/scsi/st.h
@@ -7,6 +7,8 @@
 #endif
 #include <linux/devfs_fs_kernel.h>
 #include <linux/completion.h>
+#include <linux/mm.h>
+#include <linux/page_walk.h>
 
 /* The tape buffer descriptor. */
 typedef struct {
@@ -28,6 +30,7 @@
 	unsigned short frp_segs;	/* number of buffer segments */
 	unsigned int frp_sg_current;	/* driver buffer length currently in s/g list */
 	struct st_buf_fragment *frp;	/* the allocated buffer fragment list */
+	struct gup_add_sgls *gup;	/* for DIO */
 	struct scatterlist sg[1];	/* MUST BE last item */
 } ST_buffer;
 
include/linux/page_walk.h +10 -5
diff -Naur linux-2.5.50-mm1/include/linux/page_walk.h linux-2.5.50-mm1-ioe/include/linux/page_walk.h
@@ -58,10 +58,12 @@
 };
 
 struct gup_add_sgls {
+	unsigned long max_pfn;
 	unsigned int count;
 	unsigned int max_sgls;
-	unsigned int max_pfn;
+	unsigned int dirtied;
 	struct scatterlist *sgl;
+	unsigned long todo;
 	struct page_walk pw;
 };
 
@@ -69,9 +71,14 @@
 setup_simple_page_walk(struct gup_add_pages *gup, unsigned long start,
 		unsigned long end, int write);
 
+void cleanup_simple_page_walk(struct gup_add_pages *gup);
+
 struct scatterlist *
 setup_sgl_page_walk(struct gup_add_sgls *gup, unsigned long start,
-		unsigned long end, int write, struct scatterlist *def);
+		unsigned long end, int write, struct scatterlist *def,
+		unsigned int max_entries, unsigned long max_pfn);
+
+void cleanup_sgl_page_walk(struct gup_add_sgls *gup, unsigned int dirtied);
 
 /* Legacy */
 int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, 
@@ -82,9 +89,7 @@
 #ifdef CONFIG_HUGETLB_PAGE
 int follow_hugetlb_page(struct page_walk *pw);
 #else
-#define follow_hugetlb_page(pw)			({ BUG(); 0; })
+#define follow_hugetlb_page(pw)			(0)
 #endif
 
-void fixup_sgl_walk(struct gup_add_sgls *gup,
-		unsigned long start, unsigned long end);
 #endif /* _LINUX_PAGE_WALK_H */
mm/mlock.c +1 -1
diff -Naur linux-2.5.50-mm1/mm/mlock.c linux-2.5.50-mm1-ioe/mm/mlock.c
@@ -40,7 +40,7 @@
 	pages = (end - start) >> PAGE_SHIFT;
 	if (newflags & VM_LOCKED) {
 		pages = -pages;
-		make_pages_present(start, end, vma);
+		make_pages_present(start, end, NULL);
 	}
 
 	vma->vm_mm->locked_vm -= pages;
mm/mmap.c +2 -2
diff -Naur linux-2.5.50-mm1/mm/mmap.c linux-2.5.50-mm1-ioe/mm/mmap.c
@@ -512,8 +512,6 @@
 			break;
 		}
 	}
-	vma = NULL; /* needed for out-label */
-
 	error = security_file_mmap(file, prot, flags);
 	if (error)
 		return error;
@@ -527,6 +525,8 @@
 			return -ENOMEM;
 		goto munmap_back;
 	}
+	vma = NULL; /* needed for out-label */
+
 #ifdef CONFIG_SHAREPTE
 	clear_share_range(mm, addr, len);
 #endif
mm/nommu.c +15 -3
diff -Naur linux-2.5.50-mm1/mm/nommu.c linux-2.5.50-mm1-ioe/mm/nommu.c
@@ -98,8 +98,8 @@
  * The nommu dodgy version :-)
  */
 int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
-	unsigned long start, int len, int write, int force,
-	struct page **pages, struct vm_area_struct **vmas)
+	unsigned long start, int len, int write,
+	struct page **pages)
 {
 	int i;
 
@@ -111,7 +111,19 @@
 		}
 		start += PAGE_SIZE;
 	}
-	return(i);
+	return i;
+}
+
+struct page *get_one_user_page(struct task_struct *tsk,
+			   struct vm_area_struct *vma, int vm_flags,
+			   unsigned long start) {
+	struct page *page = virt_to_page(start);
+
+	if (page)
+		page_cache_get(page);
+	else page = ERR_PTR(-EFAULT);
+
+	return page;
 }
 
 rwlock_t vmlist_lock = RW_LOCK_UNLOCKED;
mm/page_walk.c +82 -26

178 lines not on this page · raw message