[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130415194947.GA26557@kroah.com>
Date: Mon, 15 Apr 2013 12:49:47 -0700
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: "Dolkow, Snild" <Snild.Dolkow@...ymobile.com>
Cc: "Anderö, Oskar" <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, Apr 15, 2013 at 08:28:07PM +0200, Dolkow, Snild wrote:
> >> > >From the comments in shrinker.h:
> >> > "It should return the number of objects which remain in the cache.
> >> > If it returns -1, it means it cannot do any scanning at this time
> >> > (eg. there is a risk of deadlock). The callback must not return -1
> >> > if nr_to_scan is zero."
> >>
> >
> >IMO one should use the errno.h values - e.g. EBUSY might be a good value
> >in this case. Does anyone know why the shrinker wants -1? Is there a
> >reason?
>
> 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?
thanks,
greg k-h
--
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