Re: [PATCH 0/2] Move away from non-failing small allocations

From: Andrew Morton
Date: Mon Mar 16 2015 - 18:38:49 EST


On Wed, 11 Mar 2015 16:54:52 -0400 Michal Hocko <mhocko@xxxxxxx> wrote:

> as per discussion at LSF/MM summit few days back it seems there is a
> general agreement on moving away from "small allocations do not fail"
> concept.

Such a change affects basically every part of the kernel and every
kernel developer. I expect most developers will say "it works well
enough and I'm not getting any bug reports so why should I spend time
on this?". It would help if we were to explain the justification very
clearly. https://lwn.net/Articles/636017/ is Jon's writeup of the
conference discussion.

Realistically, I don't think this overall effort will be successful -
we'll add the knob, it won't get enough testing and any attempt to
alter the default will be us deliberately destabilizing the kernel
without knowing how badly :(


I wonder if we can alter the behaviour only for filesystem code, so we
constrain the new behaviour just to that code where we're having
problems. Most/all fs code goes via vfs methods so there's a reasonably
small set of places where we can call

static inline void enter_fs_code(struct super_block *sb)
{
if (sb->my_small_allocations_can_fail)
current->small_allocations_can_fail++;
}

that way (or something similar) we can select the behaviour on a per-fs
basis and the rest of the kernel remains unaffected. Other subsystems
can opt in as well.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/