Re: [00/41] Large Blocksize Support V7 (adds memmap support)

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Nick Piggin
Date: Tuesday, September 11, 2007 - 11:07 am

On Wednesday 12 September 2007 07:52, Christoph Lameter wrote:

OK, I'll describe how it works and what the actual problem with it is. I
haven't looked at the patches for a fair while so you can forgive my
inaccuracies in terminology or exact details.

So anti-frag groups memory into (say) 2MB chunks. Top priority heuristic
is that allocations which are movable all go into groups with other movable
memory and allocations which are not movable do not go into these
groups. This is flexible though, so if a workload wants to use more non
movable memory, it is allowed to eat into first free, then movable
groups after filling all non-movable groups. This is important because
it is what makes anti-frag flexible (otherwise it would just be a memory
reserve in another form).

In my attack, I cause the kernel to allocate lots of unmovable allocations
and deplete movable groups. I theoretically then only need to keep a
small number (1/2^N) of these allocations around in order to DoS a
page allocation of order N.

And it doesn't even have to be a DoS. The natural fragmentation
that occurs today in a kernel today has the possibility to slowly push out
the movable groups and give you the same situation.

Now there are lots of other little heuristics, *including lumpy reclaim
and various slab reclaim improvements*, that improve the effectiveness
or speed of this thing, but at the end of the day, it has the same basic
issues. Unless you can move practically any currently unmovable
allocation (which will either be a lot of intrusive code or require a
vmapped kernel), then you can't get around the fundamental problem.
And if you do get around the fundamental problem, you don't really
need to group pages by mobility any more because they are all
movable[*].

So lumpy reclaim does not change my formula nor significantly help
against a fragmentation attack. AFAIKS.

[*] ok, this isn't quite true because if you can actually put a hard limit on
unmovable allocations then anti-frag will fundamentally help -- get back to
me on that when you get patches to move most of the obvious  ones.
Like pinned dentries, inodes, buffer heads, page tables, task structs, mm
structs, vmas, anon_vmas, radix-tree nodes, etc.



Sure, and I pointed out the theoretical figure for 64K pages as well. Is that
figure not problematic to you? Where do you draw the limit for what is
acceptable? Why? What happens with tiny memory machines where a reserve
or even the anti-frag patches may not be acceptable and/or work very well?
When do you require reserve pools? Why are reserve pools acceptable for
first-class support of filesystems when it has been very loudly been made a
known policy decision by Linus in the past (and for some valid reasons) that
we should not put limits on the sizes of caches in the kernel.
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[00/41] Large Blocksize Support V7 (adds memmap support), Christoph Lameter, (Mon Sep 10, 11:03 pm)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Andrea Arcangeli, (Tue Sep 11, 5:05 am)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Goswin von Brederlow, (Tue Sep 11, 9:02 am)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Andrea Arcangeli, (Tue Sep 11, 9:47 am)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Nick Piggin, (Tue Sep 11, 11:07 am)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Maxim Levitsky, (Tue Sep 11, 11:25 am)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Andrea Arcangeli, (Tue Sep 11, 12:20 pm)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Christoph Lameter, (Tue Sep 11, 1:01 pm)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Christoph Lameter, (Tue Sep 11, 1:03 pm)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Christoph Lameter, (Tue Sep 11, 1:07 pm)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Christoph Lameter, (Tue Sep 11, 1:11 pm)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Christoph Lameter, (Tue Sep 11, 1:13 pm)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Christoph Lameter, (Tue Sep 11, 1:41 pm)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Christoph Lameter, (Tue Sep 11, 1:42 pm)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Christoph Lameter, (Tue Sep 11, 2:35 pm)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Christoph Lameter, (Tue Sep 11, 2:41 pm)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Christoph Lameter, (Tue Sep 11, 2:48 pm)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Christoph Lameter, (Tue Sep 11, 2:52 pm)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Andrea Arcangeli, (Tue Sep 11, 4:26 pm)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Christoph Lameter, (Tue Sep 11, 5:00 pm)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Christoph Lameter, (Tue Sep 11, 5:04 pm)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Andrea Arcangeli, (Wed Sep 12, 1:20 am)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Martin J. Bligh, (Wed Sep 12, 7:29 am)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Christoph Lameter, (Wed Sep 12, 4:06 pm)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Christoph Lameter, (Wed Sep 12, 4:17 pm)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Christoph Lameter, (Thu Sep 13, 7:38 pm)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Goswin von Brederlow, (Fri Sep 14, 9:10 am)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Christoph Lameter, (Fri Sep 14, 10:52 am)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Christoph Lameter, (Fri Sep 14, 11:08 am)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Christoph Lameter, (Fri Sep 14, 11:15 am)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Goswin von Brederlow, (Fri Sep 14, 5:31 pm)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Goswin von Brederlow, (Fri Sep 14, 5:33 pm)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Goswin von Brederlow, (Sat Sep 15, 5:14 am)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Andrea Arcangeli, (Sat Sep 15, 8:51 am)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Goswin von Brederlow, (Sat Sep 15, 1:14 pm)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Andrea Arcangeli, (Sat Sep 15, 3:30 pm)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Goswin von Brederlow, (Sun Sep 16, 6:54 am)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Andrea Arcangeli, (Sun Sep 16, 8:08 am)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Linus Torvalds, (Sun Sep 16, 11:15 am)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Linus Torvalds, (Sun Sep 16, 11:44 am)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Andrea Arcangeli, (Sun Sep 16, 11:50 am)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Andrea Arcangeli, (Sun Sep 16, 2:31 pm)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Goswin von Brederlow, (Sun Sep 16, 2:58 pm)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Goswin von Brederlow, (Sun Sep 16, 3:06 pm)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Goswin von Brederlow, (Sun Sep 16, 3:38 pm)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Goswin von Brederlow, (Sun Sep 16, 3:48 pm)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Goswin von Brederlow, (Sun Sep 16, 3:51 pm)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Goswin von Brederlow, (Sun Sep 16, 3:56 pm)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Christoph Lameter, (Mon Sep 17, 3:00 pm)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Christoph Lameter, (Mon Sep 17, 3:03 pm)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Christoph Lameter, (Mon Sep 17, 3:05 pm)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Christoph Lameter, (Mon Sep 17, 3:10 pm)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Christoph Lameter, (Mon Sep 17, 3:21 pm)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Linus Torvalds, (Tue Sep 18, 11:30 am)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Andrea Arcangeli, (Tue Sep 18, 12:18 pm)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Andrea Arcangeli, (Tue Sep 18, 12:31 pm)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Linus Torvalds, (Tue Sep 18, 12:44 pm)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Christoph Lameter, (Tue Sep 18, 1:36 pm)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Christoph Lameter, (Tue Sep 18, 1:42 pm)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Andrea Arcangeli, (Wed Sep 19, 7:04 am)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Andrea Arcangeli, (Thu Sep 20, 7:54 am)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Christoph Lameter, (Thu Sep 20, 11:07 am)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Christoph Lameter, (Thu Sep 20, 11:11 am)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Goswin von Brederlow, (Sat Sep 22, 10:50 pm)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Goswin von Brederlow, (Sat Sep 22, 11:22 pm)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Goswin von Brederlow, (Sat Sep 22, 11:49 pm)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Goswin von Brederlow, (Sat Sep 22, 11:56 pm)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Andrea Arcangeli, (Mon Sep 24, 8:39 am)
Re: [00/41] Large Blocksize Support V7 (adds memmap support), Christoph Lameter, (Mon Sep 24, 2:13 pm)