📄 00000031.htm
字号:
return -EINVAL; <BR> <BR>- flush_cache_range(vma->vm_mm, start, end); <BR>- zap_page_range(vma->vm_mm, start, end - start); <BR>- flush_tlb_range(vma->vm_mm, start, end); <BR>+ zap_page_range(vma->vm_mm, start, end - start, <BR>+ ZPR_FLUSH_CACHE|ZPR_FLUSH_TLB|ZPR_COND_RESCHED); /* <BR>sys_madvise(MADV_DONTNEED) */ <BR> return 0; <BR> } <BR> <BR>@@ -2486,6 +2496,7 @@ <BR> unsigned long bytes, index, offset; <BR> char *kaddr; <BR> <BR>+ conditional_schedule(); /* sys_write() */ <BR> /* <BR> * Try to find the page in the cache. If it isn't there, <BR> * allocate a free page. <BR>--- linux-2.4.0-test8/fs/buffer.c Sat Sep 9 16:19:29 2000 <BR>+++ linux-akpm/fs/buffer.c Tue Sep 12 19:36:55 2000 <BR>@@ -2220,6 +2220,7 @@ <BR> __wait_on_buffer(p); <BR> } else if (buffer_dirty(p)) <BR> ll_rw_block(WRITE, 1, &p); <BR>+ conditional_schedule(); /* sys_msync() */ <BR> } while (tmp != bh); <BR> } <BR> <BR>--- linux-2.4.0-test8/fs/dcache.c Thu Aug 24 21:07:22 2000 <BR>+++ linux-akpm/fs/dcache.c Tue Sep 12 19:36:55 2000 <BR>@@ -301,7 +301,7 @@ <BR> * removed. <BR> * Called with dcache_lock, drops it and then regains. <BR> */ <BR>-static inline void prune_one_dentry(struct dentry * dentry) <BR>+static inline void prune_one_dentry(struct dentry * dentry, int <BR>*resched_count) <BR> { <BR> struct dentry * parent; <BR> <BR>@@ -312,6 +312,10 @@ <BR> d_free(dentry); <BR> if (parent != dentry) <BR> dput(parent); <BR>+ if ((*resched_count)++ == 10) { <BR>+ resched_count = 0; /* Hack buys 0.6% in bonnie++ */ <BR>+ conditional_schedule(); /* pruning many dentries (sys_rmdir) */ <BR>+ } <BR> spin_lock(&dcache_lock); <BR> } <BR> <BR>@@ -330,6 +334,8 @@ <BR> <BR> void prune_dcache(int count) <BR> { <BR>+ int resched_count = 0; <BR>+ <BR> spin_lock(&dcache_lock); <BR> for (;;) { <BR> struct dentry *dentry; <BR>@@ -347,7 +353,7 @@ <BR> if (atomic_read(&dentry->d_count)) <BR> BUG(); <BR> <BR>- prune_one_dentry(dentry); <BR>+ prune_one_dentry(dentry, &resched_count); <BR> if (!--count) <BR> break; <BR> } <BR>@@ -380,6 +386,7 @@ <BR> { <BR> struct list_head *tmp, *next; <BR> struct dentry *dentry; <BR>+ int resched_count = 0; <BR> <BR> /* <BR> * Pass one ... move the dentries for the specified <BR>@@ -413,7 +420,7 @@ <BR> dentry_stat.nr_unused--; <BR> list_del(tmp); <BR> INIT_LIST_HEAD(tmp); <BR>- prune_one_dentry(dentry); <BR>+ prune_one_dentry(dentry, &resched_count); <BR> goto repeat; <BR> } <BR> spin_unlock(&dcache_lock); <BR>@@ -482,7 +489,7 @@ <BR> { <BR> struct dentry *this_parent = parent; <BR> struct list_head *next; <BR>- int found = 0; <BR>+ int found = 0, count = 0; <BR> <BR> spin_lock(&dcache_lock); <BR> repeat: <BR>@@ -497,6 +504,13 @@ <BR> list_add(&dentry->d_lru, dentry_unused.prev); <BR> found++; <BR> } <BR>+ <BR>+ if (count++ == 500 && found > 10) { <BR>+ count = 0; <BR>+ if (conditional_schedule_needed()) /* Typically sys_rmdir() */ <BR>+ goto out; <BR>+ } <BR>+ <BR> /* <BR> * Descend a level if the d_subdirs list is non-empty. <BR> */ <BR>@@ -521,6 +535,7 @@ <BR> #endif <BR> goto resume; <BR> } <BR>+out: <BR> spin_unlock(&dcache_lock); <BR> return found; <BR> } <BR>@@ -536,8 +551,10 @@ <BR> { <BR> int found; <BR> <BR>- while ((found = select_parent(parent)) != 0) <BR>+ while ((found = select_parent(parent)) != 0) { <BR> prune_dcache(found); <BR>+ conditional_schedule(); /* Typically sys_rmdir() */ <BR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -