Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752803Ab3DOOOF (ORCPT ); Mon, 15 Apr 2013 10:14:05 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:16604 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752522Ab3DOOOD (ORCPT ); Mon, 15 Apr 2013 10:14:03 -0400 Date: Mon, 15 Apr 2013 17:13:59 +0300 From: Dan Carpenter To: "Dolkow, Snild" Cc: =?iso-8859-1?B?IkFuZGVy9iwgT3NrYXIi?= , "devel@driverdev.osuosl.org" , Greg Kroah-Hartman , "Lekanovic, Radovan" , "linux-kernel@vger.kernel.org" , Brian Swetland Subject: Re: [PATCH] lowmemorykiller: prevent multiple instances of low memory killer Message-ID: <20130415141358.GO6692@mwanda> References: <1366031009-21958-1-git-send-email-oskar.andero@sonymobile.com> <20130415131815.GG6638@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: ucsinet22.oracle.com [156.151.31.94] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1259 Lines: 36 On Mon, Apr 15, 2013 at 03:38:08PM +0200, Dolkow, Snild wrote: > >Where is lowmem_shrink called from? I only see shrink called from the > >bcache sysfs handler __bch_cache_set(). The return value isn't checked > >there. > > > >Up to now this function has only returns positive numbers. > > > >There isn't a place which check LMK_BUSY so maybe it's best to just > >return zero? > > Hey Dan, > > lowmem_shrink is assigned to a shrinker struct > (include/linux/shrinker.h) and called in do_shrinker_shrink() in > mm/vmscan.c. That, in turn, is called and checked in a few places > in vmscan.c. > > >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." Ah. Good. -1 is the right return. But really should be a #define in shrinker.h instead of in drivers/staging/android/. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/