Re: Change in default vm_dirty_ratio

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Peter Zijlstra
Date: Sunday, June 24, 2007 - 5:15 pm

On Sun, 2007-06-24 at 09:40 -0700, Linus Torvalds wrote:

It was.


Hehe, it is the simplest thing I could come up with. It is
deterministic, fast and has a nice physical model :-)


No we don't (well, on 64bit arches we do). I actually only use unsigned
long, and even cast whatever comes out of the percpu_counter thing to
unsigned long.


That is only needed on 64bit arches, and even there, actually
encountering such large values will be rare at best. 

Also, this re-normalisation event that uses the call is low frequency.
That is, that part will be used once every ~ total_dirty_limit/nr_bdis
written out.


Agreed.


It all just stems from Andrew asking if I could please re-use something
instread of duplication a lot of things. I picked percpu_counter because
that was the closest to what was needed. An unsigned long based per-cpu
counter would suit better.

There is another problem I have with this percpu_counter, it is rather
space hungry. It does a node affine sizeof(s32) kalloc on each cpu.
Which will end up using the smallest slab, and that is quite a bit
bigger than needed. But should be about the size of a cacheline
(otherwise we might still end up with false sharing).

I've been thinking of extending this per cpu allocator thing a bit to be
a little smarter about these things. What would be needed is a strict
per-cpu slab allocator. The current ones are node affine, which can
still cause false sharing (unless - as should be the case - these
objects are both cacheline aligned and of cacheline size). When we have
that, we can start using smaller objects.

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Change in default vm_dirty_ratio, Tim Chen, (Mon Jun 18, 2:14 pm)
Re: Change in default vm_dirty_ratio, Andrew Morton, (Mon Jun 18, 4:47 pm)
Re: Change in default vm_dirty_ratio, Linus Torvalds, (Mon Jun 18, 5:06 pm)
Re: Change in default vm_dirty_ratio, Arjan van de Ven, (Mon Jun 18, 5:09 pm)
Re: Change in default vm_dirty_ratio, John Stoffel, (Tue Jun 19, 11:41 am)
Re: Change in default vm_dirty_ratio, Linus Torvalds, (Tue Jun 19, 12:04 pm)
Re: Change in default vm_dirty_ratio, Linus Torvalds, (Tue Jun 19, 12:06 pm)
Re: Change in default vm_dirty_ratio, Andi Kleen, (Tue Jun 19, 12:57 pm)
Re: Change in default vm_dirty_ratio, David Miller, (Tue Jun 19, 3:33 pm)
Re: Change in default vm_dirty_ratio, Dave Jones, (Tue Jun 19, 9:24 pm)
Re: Change in default vm_dirty_ratio, Andrew Morton, (Tue Jun 19, 9:44 pm)
Re: Change in default vm_dirty_ratio, Peter Zijlstra, (Wed Jun 20, 1:35 am)
Re: Change in default vm_dirty_ratio, Andrew Morton, (Wed Jun 20, 1:58 am)
Re: Change in default vm_dirty_ratio, Jens Axboe, (Wed Jun 20, 2:14 am)
Re: Change in default vm_dirty_ratio, Peter Zijlstra, (Wed Jun 20, 2:19 am)
Re: Change in default vm_dirty_ratio, Peter Zijlstra, (Wed Jun 20, 2:19 am)
Re: Change in default vm_dirty_ratio, Jens Axboe, (Wed Jun 20, 2:20 am)
Re: Change in default vm_dirty_ratio, Peter Zijlstra, (Wed Jun 20, 2:43 am)
Re: Change in default vm_dirty_ratio, Linus Torvalds, (Wed Jun 20, 10:17 am)
Re: Change in default vm_dirty_ratio, Arjan van de Ven, (Wed Jun 20, 11:12 am)
Re: Change in default vm_dirty_ratio, Linus Torvalds, (Wed Jun 20, 11:28 am)
Re: Change in default vm_dirty_ratio, Nadia Derbey, (Thu Jun 21, 5:37 am)
Re: Change in default vm_dirty_ratio, Mark Lord, (Thu Jun 21, 9:54 am)
Re: Change in default vm_dirty_ratio, Peter Zijlstra, (Thu Jun 21, 9:55 am)
Re: Change in default vm_dirty_ratio, Matt Mackall, (Thu Jun 21, 3:53 pm)
Re: Change in default vm_dirty_ratio, Linus Torvalds, (Thu Jun 21, 4:08 pm)
Re: Change in default vm_dirty_ratio, Peter Zijlstra, (Sat Jun 23, 11:23 am)
Re: Change in default vm_dirty_ratio, Linus Torvalds, (Sun Jun 24, 9:40 am)
Re: Change in default vm_dirty_ratio, Peter Zijlstra, (Sun Jun 24, 5:15 pm)