Re: [PATCH v4 2/2] mm: make lru_add_drain_all() selective

From: Andrew Morton
Date: Tue Aug 13 2013 - 18:26:28 EST


On Tue, 13 Aug 2013 18:13:48 -0400 Chris Metcalf <cmetcalf@xxxxxxxxxx> wrote:

> On 8/13/2013 5:13 PM, Andrew Morton wrote:
> > On Tue, 13 Aug 2013 16:59:54 -0400 Chris Metcalf <cmetcalf@xxxxxxxxxx> wrote:
> >
> >>> Then again, why does this patchset exist? It's a performance
> >>> optimisation so presumably someone cares. But not enough to perform
> >>> actual measurements :(
> >> The patchset exists because of the difference between zero overhead on
> >> cpus that don't have drainable lrus, and non-zero overhead. This turns
> >> out to be important on workloads where nohz cores are handling 10 Gb
> >> traffic in userspace and really, really don't want to be interrupted,
> >> or they drop packets on the floor.
> > But what is the effect of the patchset? Has it been tested against the
> > problematic workload(s)?
>
> Yes. The result is that syscalls such as mlockall(), which otherwise interrupt
> every core, don't interrupt the cores that are running purely in userspace.
> Since they are purely in userspace they don't have any drainable pagevecs,
> so the patchset means they don't get interrupted and don't drop packets.
>
> I implemented this against Linux 2.6.38 and our home-grown version of nohz
> cpusets back in July 2012, and we have been shipping it to customers since then.

argh.

Those per-cpu LRU pagevecs were a nasty but very effective locking
amortization hack back in, umm, 2002. They have caused quite a lot of
weird corner-case behaviour, resulting in all the lru_add_drain_all()
calls sprinkled around the place. I'd like to nuke the whole thing,
but that would require a fundamental rethnik/rework of all the LRU list
locking.

According to the 8891d6da17db0f changelog, the lru_add_drain_all() in
sys_mlock() isn't really required: "it isn't must. but it reduce the
failure of moving to unevictable list. its failure can rescue in
vmscan later. but reducing is better."

I suspect we could just kill it.
--
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/