Re: [Intel-gfx] [PATCH v2 1/2] mm: Export nr_swap_pages

2016-01-05 Thread Daniel Vetter
On Wed, Dec 23, 2015 at 02:26:11PM -0800, Andrew Morton wrote: > On Wed, 23 Dec 2015 17:04:27 -0500 Johannes Weiner wrote: > > > On Thu, Dec 10, 2015 at 10:32:42AM +0100, Daniel Vetter wrote: > > > On Fri, Dec 04, 2015 at 11:09:52AM -0500, Johannes Weiner wrote: > > > > On

Re: [Intel-gfx] [PATCH v2 1/2] mm: Export nr_swap_pages

2015-12-23 Thread Johannes Weiner
On Thu, Dec 10, 2015 at 10:32:42AM +0100, Daniel Vetter wrote: > On Fri, Dec 04, 2015 at 11:09:52AM -0500, Johannes Weiner wrote: > > On Fri, Dec 04, 2015 at 03:58:53PM +, Chris Wilson wrote: > > > Some modules, like i915.ko, use swappable objects and may try to swap > > > them out under

Re: [Intel-gfx] [PATCH v2 1/2] mm: Export nr_swap_pages

2015-12-23 Thread Andrew Morton
On Wed, 23 Dec 2015 17:04:27 -0500 Johannes Weiner wrote: > On Thu, Dec 10, 2015 at 10:32:42AM +0100, Daniel Vetter wrote: > > On Fri, Dec 04, 2015 at 11:09:52AM -0500, Johannes Weiner wrote: > > > On Fri, Dec 04, 2015 at 03:58:53PM +, Chris Wilson wrote: > > > > Some

Re: [Intel-gfx] [PATCH v2 1/2] mm: Export nr_swap_pages

2015-12-08 Thread Michal Hocko
On Mon 07-12-15 11:48:31, Johannes Weiner wrote: > 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).

Re: [Intel-gfx] [PATCH v2 1/2] mm: Export nr_swap_pages

2015-12-08 Thread Michal Hocko
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

Re: [Intel-gfx] [PATCH v2 1/2] mm: Export nr_swap_pages

2015-12-08 Thread Michal Hocko
On Mon 07-12-15 14:13:46, Johannes Weiner wrote: > On Mon, Dec 07, 2015 at 06:10:00PM +, Dave Gordon wrote: > > Exporting random uncontrolled variables from the kernel to loaded modules is > > not really considered best practice. It would be preferable to provide an > > accessor function -

Re: [Intel-gfx] [PATCH v2 1/2] mm: Export nr_swap_pages

2015-12-07 Thread Johannes Weiner
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

Re: [Intel-gfx] [PATCH v2 1/2] mm: Export nr_swap_pages

2015-12-07 Thread Dave Gordon
On 07/12/15 16:48, Johannes Weiner wrote: 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

Re: [Intel-gfx] [PATCH v2 1/2] mm: Export nr_swap_pages

2015-12-07 Thread Johannes Weiner
On Mon, Dec 07, 2015 at 06:04:35PM +0100, Michal Hocko wrote: > Yes but the counter is an internal thing to the MM and the outside code > should have no business in manipulating it directly. The counter has been global scope forever. If you want to encapsulate it, send a patch yourself and make

Re: [Intel-gfx] [PATCH v2 1/2] mm: Export nr_swap_pages

2015-12-07 Thread Johannes Weiner
On Mon, Dec 07, 2015 at 06:10:00PM +, Dave Gordon wrote: > Exporting random uncontrolled variables from the kernel to loaded modules is > not really considered best practice. It would be preferable to provide an > accessor function - which is just what the declaration says we have; the >

Re: [Intel-gfx] [PATCH v2 1/2] mm: Export nr_swap_pages

2015-12-04 Thread Johannes Weiner
On Fri, Dec 04, 2015 at 03:58:53PM +, 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

[Intel-gfx] [PATCH v2 1/2] mm: Export nr_swap_pages

2015-12-04 Thread Chris Wilson
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