From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com [74.125.82.44]) by kanga.kvack.org (Postfix) with ESMTP id 351234402EE for ; Mon, 7 Dec 2015 11:48:52 -0500 (EST) Received: by wmec201 with SMTP id c201so158978866wme.1 for ; Mon, 07 Dec 2015 08:48:51 -0800 (PST) Received: from gum.cmpxchg.org (gum.cmpxchg.org. [85.214.110.215]) by mx.google.com with ESMTPS id t185si24705475wmb.113.2015.12.07.08.48.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Dec 2015 08:48:51 -0800 (PST) Date: Mon, 7 Dec 2015 11:48:31 -0500 From: Johannes Weiner Subject: Re: [PATCH v2 1/2] mm: Export nr_swap_pages Message-ID: <20151207164831.GA7256@cmpxchg.org> References: <1449244734-25733-1-git-send-email-chris@chris-wilson.co.uk> <20151207134812.GA20782@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151207134812.GA20782@dhcp22.suse.cz> Sender: owner-linux-mm@kvack.org List-ID: To: Michal Hocko Cc: Chris Wilson , intel-gfx@lists.freedesktop.org, "Goel, Akash" , linux-mm@kvack.org On Mon, Dec 07, 2015 at 02:48:12PM +0100, Michal Hocko wrote: > On Fri 04-12-15 15:58:53, Chris Wilson wrote: > > Some modules, like i915.ko, use swappable objects and may try to swap > > them out under memory pressure (via the shrinker). Before doing so, they > > want to check using get_nr_swap_pages() to see if any swap space is > > available as otherwise they will waste time purging the object from the > > device without recovering any memory for the system. This requires the > > nr_swap_pages counter to be exported to the modules. > > I guess it should be sufficient to change get_nr_swap_pages into a real > function and export it rather than giving the access to the counter > directly? What do you mean by "sufficient"? That is actually more work. It should be sufficient to just export the counter. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: Johannes Weiner Subject: Re: [PATCH v2 1/2] mm: Export nr_swap_pages Date: Mon, 7 Dec 2015 11:48:31 -0500 Message-ID: <20151207164831.GA7256@cmpxchg.org> References: <1449244734-25733-1-git-send-email-chris@chris-wilson.co.uk> <20151207134812.GA20782@dhcp22.suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Return-path: Received: from gum.cmpxchg.org (gum.cmpxchg.org [85.214.110.215]) by gabe.freedesktop.org (Postfix) with ESMTPS id D97D26E631 for ; Mon, 7 Dec 2015 08:48:47 -0800 (PST) Content-Disposition: inline In-Reply-To: <20151207134812.GA20782@dhcp22.suse.cz> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Michal Hocko Cc: linux-mm@kvack.org, intel-gfx@lists.freedesktop.org, "Goel, Akash" List-Id: intel-gfx@lists.freedesktop.org T24gTW9uLCBEZWMgMDcsIDIwMTUgYXQgMDI6NDg6MTJQTSArMDEwMCwgTWljaGFsIEhvY2tvIHdy b3RlOgo+IE9uIEZyaSAwNC0xMi0xNSAxNTo1ODo1MywgQ2hyaXMgV2lsc29uIHdyb3RlOgo+ID4g U29tZSBtb2R1bGVzLCBsaWtlIGk5MTUua28sIHVzZSBzd2FwcGFibGUgb2JqZWN0cyBhbmQgbWF5 IHRyeSB0byBzd2FwCj4gPiB0aGVtIG91dCB1bmRlciBtZW1vcnkgcHJlc3N1cmUgKHZpYSB0aGUg c2hyaW5rZXIpLiBCZWZvcmUgZG9pbmcgc28sIHRoZXkKPiA+IHdhbnQgdG8gY2hlY2sgdXNpbmcg Z2V0X25yX3N3YXBfcGFnZXMoKSB0byBzZWUgaWYgYW55IHN3YXAgc3BhY2UgaXMKPiA+IGF2YWls YWJsZSBhcyBvdGhlcndpc2UgdGhleSB3aWxsIHdhc3RlIHRpbWUgcHVyZ2luZyB0aGUg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