diff options
| author | Andrew Morton <akpm@digeo.com> | 2003-06-10 10:10:02 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2003-06-10 10:10:02 -0700 |
| commit | b91404d3496c7dd004f3e797b03fbf9795e1e7fa (patch) | |
| tree | addb00394cca4a61d7db2b2efc86851e943fb59d /include/linux/sched.h | |
| parent | 960fc49f4cbfd7533e6028661ba385e0b1665fad (diff) | |
[PATCH] fix hangs with nfs to localhost
An NFS mount of localhost hangs the system under heavy writeout loads.
This is because knfsd gets stuck in balance_dirty_pages(). It is not allowed
to exit from there until the amount of dirty+writeback+unstable memory
subsides. But it will never subside because knfsd itself is responsible for
cleaning the memory.
This is just like the drivers/block/loop.c hang, only more complex. We
cannot simply disable knfsd's throttling because it would then swamp the
machine under real loads when the clients are remote.
So we introduce the concept of a "less throttled" process. These processes
are allowed to exceed the preset dirty memory limits by a little. This
allows knfsd to make progrws in writing things out while the local NFS
clients are throttled. It also ensures that knfsd will not swamp the machine
when working on behalf of remote clients.
Note that even though knfsd is allowed to exceed the default system-wide
dirty memory threshold, this does _not_ cause other memory-dirtying tasks to
get starved out. This is because they are allowed to exit
balance_dirty_pages() after having written their quota of pages, regardless
of the current dirty memory state.
Diffstat (limited to 'include/linux/sched.h')
| -rw-r--r-- | include/linux/sched.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index b7a364022625..d313e2ccbf42 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -475,6 +475,7 @@ do { if (atomic_dec_and_test(&(tsk)->usage)) __put_task_struct(tsk); } while(0) #define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */ #define PF_KSWAPD 0x00040000 /* I am kswapd */ #define PF_SWAPOFF 0x00080000 /* I am in swapoff */ +#define PF_LESS_THROTTLE 0x01000000 /* Throttle me less: I clena memory */ #ifdef CONFIG_SMP extern void set_cpus_allowed(task_t *p, unsigned long new_mask); |
