Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 144996
b: refs/heads/master
c: cd17cbf
h: refs/heads/master
v: v3
  • Loading branch information
Jens Axboe committed May 15, 2009
1 parent 123c861 commit 74a8d9a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 73 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 05dc7b613481c695bb4fc476c6fbb46364b63f62
refs/heads/master: cd17cbfda004fe5f406c01b318c6378d9895896f
28 changes: 0 additions & 28 deletions trunk/Documentation/sysctl/vm.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ Currently, these files are in /proc/sys/vm:
- nr_hugepages
- nr_overcommit_hugepages
- nr_pdflush_threads
- nr_pdflush_threads_min
- nr_pdflush_threads_max
- nr_trim_pages (only if CONFIG_MMU=n)
- numa_zonelist_order
- oom_dump_tasks
Expand Down Expand Up @@ -469,32 +467,6 @@ The default value is 0.

==============================================================

nr_pdflush_threads_min

This value controls the minimum number of pdflush threads.

At boot time, the kernel will create and maintain 'nr_pdflush_threads_min'
threads for the kernel's lifetime.

The default value is 2. The minimum value you can specify is 1, and
the maximum value is the current setting of 'nr_pdflush_threads_max'.

See 'nr_pdflush_threads_max' below for more information.

==============================================================

nr_pdflush_threads_max

This value controls the maximum number of pdflush threads that can be
created. The pdflush algorithm will create a new pdflush thread (up to
this maximum) if no pdflush threads have been available for >= 1 second.

The default value is 8. The minimum value you can specify is the
current value of 'nr_pdflush_threads_min' and the
maximum is 1000.

==============================================================

overcommit_memory:

This value contains a flag that enables memory overcommitment.
Expand Down
2 changes: 0 additions & 2 deletions trunk/include/linux/writeback.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,6 @@ void writeback_set_ratelimit(void);
/* pdflush.c */
extern int nr_pdflush_threads; /* Global so it can be exported to sysctl
read-only. */
extern int nr_pdflush_threads_max; /* Global so it can be exported to sysctl */
extern int nr_pdflush_threads_min; /* Global so it can be exported to sysctl */


#endif /* WRITEBACK_H */
23 changes: 0 additions & 23 deletions trunk/kernel/sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ static int __maybe_unused one = 1;
static int __maybe_unused two = 2;
static unsigned long one_ul = 1;
static int one_hundred = 100;
static int one_thousand = 1000;

/* this is needed for the proc_doulongvec_minmax of vm_dirty_bytes */
static unsigned long dirty_bytes_min = 2 * PAGE_SIZE;
Expand Down Expand Up @@ -1033,28 +1032,6 @@ static struct ctl_table vm_table[] = {
.mode = 0444 /* read-only*/,
.proc_handler = &proc_dointvec,
},
{
.ctl_name = CTL_UNNUMBERED,
.procname = "nr_pdflush_threads_min",
.data = &nr_pdflush_threads_min,
.maxlen = sizeof nr_pdflush_threads_min,
.mode = 0644 /* read-write */,
.proc_handler = &proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.extra1 = &one,
.extra2 = &nr_pdflush_threads_max,
},
{
.ctl_name = CTL_UNNUMBERED,
.procname = "nr_pdflush_threads_max",
.data = &nr_pdflush_threads_max,
.maxlen = sizeof nr_pdflush_threads_max,
.mode = 0644 /* read-write */,
.proc_handler = &proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.extra1 = &nr_pdflush_threads_min,
.extra2 = &one_thousand,
},
{
.ctl_name = VM_SWAPPINESS,
.procname = "swappiness",
Expand Down
31 changes: 12 additions & 19 deletions trunk/mm/pdflush.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,6 @@ static DEFINE_SPINLOCK(pdflush_lock);
*/
int nr_pdflush_threads = 0;

/*
* The max/min number of pdflush threads. R/W by sysctl at
* /proc/sys/vm/nr_pdflush_threads_max/min
*/
int nr_pdflush_threads_max __read_mostly = MAX_PDFLUSH_THREADS;
int nr_pdflush_threads_min __read_mostly = MIN_PDFLUSH_THREADS;


/*
* The time at which the pdflush thread pool last went empty
*/
Expand All @@ -76,7 +68,7 @@ static unsigned long last_empty_jifs;
* Thread pool management algorithm:
*
* - The minimum and maximum number of pdflush instances are bound
* by nr_pdflush_threads_min and nr_pdflush_threads_max.
* by MIN_PDFLUSH_THREADS and MAX_PDFLUSH_THREADS.
*
* - If there have been no idle pdflush instances for 1 second, create
* a new one.
Expand Down Expand Up @@ -142,13 +134,14 @@ static int __pdflush(struct pdflush_work *my_work)
* To throttle creation, we reset last_empty_jifs.
*/
if (time_after(jiffies, last_empty_jifs + 1 * HZ)) {
if (list_empty(&pdflush_list) &&
nr_pdflush_threads < nr_pdflush_threads_max) {
last_empty_jifs = jiffies;
nr_pdflush_threads++;
spin_unlock_irq(&pdflush_lock);
start_one_pdflush_thread();
spin_lock_irq(&pdflush_lock);
if (list_empty(&pdflush_list)) {
if (nr_pdflush_threads < MAX_PDFLUSH_THREADS) {
last_empty_jifs = jiffies;
nr_pdflush_threads++;
spin_unlock_irq(&pdflush_lock);
start_one_pdflush_thread();
spin_lock_irq(&pdflush_lock);
}
}
}

Expand All @@ -160,7 +153,7 @@ static int __pdflush(struct pdflush_work *my_work)
*/
if (list_empty(&pdflush_list))
continue;
if (nr_pdflush_threads <= nr_pdflush_threads_min)
if (nr_pdflush_threads <= MIN_PDFLUSH_THREADS)
continue;
pdf = list_entry(pdflush_list.prev, struct pdflush_work, list);
if (time_after(jiffies, pdf->when_i_went_to_sleep + 1 * HZ)) {
Expand Down Expand Up @@ -266,9 +259,9 @@ static int __init pdflush_init(void)
* Pre-set nr_pdflush_threads... If we fail to create,
* the count will be decremented.
*/
nr_pdflush_threads = nr_pdflush_threads_min;
nr_pdflush_threads = MIN_PDFLUSH_THREADS;

for (i = 0; i < nr_pdflush_threads_min; i++)
for (i = 0; i < MIN_PDFLUSH_THREADS; i++)
start_one_pdflush_thread();
return 0;
}
Expand Down

0 comments on commit 74a8d9a

Please sign in to comment.