[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.02.1304151608040.13614@chino.kir.corp.google.com>
Date: Mon, 15 Apr 2013 16:11:18 -0700 (PDT)
From: David Rientjes <rientjes@...gle.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
cc: "Dolkow, Snild" <Snild.Dolkow@...ymobile.com>,
Oskar.Andero@...ymobile.com,
Dan Carpenter <dan.carpenter@...cle.com>,
"devel@...verdev.osuosl.org" <devel@...verdev.osuosl.org>,
"Lekanovic, Radovan" <Radovan.Lekanovic@...ymobile.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Brian Swetland <swetland@...gle.com>
Subject: Re: [PATCH] lowmemorykiller: prevent multiple instances of low memory
killer
On Mon, 15 Apr 2013, Greg Kroah-Hartman wrote:
> > The positive numbers are used to return information on the remaining
> > cache size (again, see the comment I pasted above). We could use
> > -EBUSY, but we'd have to change vmscan.c, which checks specifically
> > for -1. I can't see a technical reason why -EBUSY couldn't have been
> > chosen instead, but there's also no real reason to change it now.
>
> If it's not the correct thing to do, sure we can change it, just send a
> patch. It makes way more sense than some random -1 return value to me.
>
> Care to send a series of patches fixing this up properly?
>
The comment in shrinker.h is misleading, not the source code.
do_shrinker_shrink() will fail for anything negative and 0. The patch
being discussed could easily use -1 or 0 hardcoded into the return value,
forget the definition of LMK_BUSY.
Also, please consider using an atomic chmpxchg instead of a spinlock: if
you're only ever doing spin_trylock() then you don't need a spinlock.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists