On Tue, Apr 13, 2010 at 08:34:29PM +0100, Mel Gorman wrote:
So, I've been reading along, nodding my head to Dave's side of things
because seeks are evil and direct reclaim makes seeks. I'd really loev
for direct reclaim to somehow trigger writepages on large chunks instead
of doing page by page spatters of IO to the drive.
But, somewhere along the line I overlooked the part of Dave's stack trace
that said:
43) 1568 912 do_select+0x3d6/0x700
Huh, 912 bytes...for select, really? From poll.h:
/* ~832 bytes of stack space used max in sys_select/sys_poll before allocating
additional memory. */
#define MAX_STACK_ALLOC 832
#define FRONTEND_STACK_ALLOC 256
#define SELECT_STACK_ALLOC FRONTEND_STACK_ALLOC
#define POLL_STACK_ALLOC FRONTEND_STACK_ALLOC
#define WQUEUES_STACK_ALLOC (MAX_STACK_ALLOC - FRONTEND_STACK_ALLOC)
#define N_INLINE_POLL_ENTRIES (WQUEUES_STACK_ALLOC / sizeof(struct poll_table_entry))
So, select is intentionally trying to use that much stack. It should be using
GFP_NOFS if it really wants to suck down that much stack...if only the
kernel had some sort of way to dynamically allocate ram, it could try
that too.
-chris
--