From: Johannes Weiner <hannes@cmpxchg.org>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: linux-mm@kvack.org, intel-gfx@lists.freedesktop.org,
sourab.gupta@intel.com, Akash Goel <akash.goel@intel.com>
Subject: Re: [PATCH v2] drm/i915: Disable shrinker for non-swapped backed objects
Date: Thu, 26 Nov 2015 10:40:16 -0500 [thread overview]
Message-ID: <20151126154016.GA23976@cmpxchg.org> (raw)
In-Reply-To: <20151126112514.GG23362@nuc-i3427.alporthouse.com>
On Thu, Nov 26, 2015 at 11:25:14AM +0000, Chris Wilson wrote:
> On Wed, Nov 25, 2015 at 03:46:35PM -0500, Johannes Weiner wrote:
> > On Wed, Nov 25, 2015 at 08:31:02PM +0000, Chris Wilson wrote:
> > > On Wed, Nov 25, 2015 at 02:06:10PM -0500, Johannes Weiner wrote:
> > > > On Wed, Nov 25, 2015 at 06:36:56PM +0000, Chris Wilson wrote:
> > > > > +static bool swap_available(void)
> > > > > +{
> > > > > + return total_swap_pages || frontswap_enabled;
> > > > > +}
> > > >
> > > > If you use get_nr_swap_pages() instead of total_swap_pages, this will
> > > > also stop scanning objects once the swap space is full. We do that in
> > > > the VM to stop scanning anonymous pages.
> > >
> > > Thanks. Would EXPORT_SYMBOL_GPL(nr_swap_pages) (or equivalent) be
> > > acceptable?
> >
> > No opposition from me. Just please add a small comment that this is
> > for shrinkers with swappable objects.
>
> diff --git a/mm/swapfile.c b/mm/swapfile.c
> index 58877312cf6b..1c7861f4c43c 100644
> --- a/mm/swapfile.c
> +++ b/mm/swapfile.c
> @@ -48,6 +48,14 @@ static sector_t map_swap_entry(swp_entry_t, struct block_device**);
> DEFINE_SPINLOCK(swap_lock);
> static unsigned int nr_swapfiles;
> atomic_long_t nr_swap_pages;
> +/*
> + * Some modules use swappable objects and may try to swap them out under
> + * memory pressure (via the shrinker). Before doing so, they may wish to
> + * check to see if any swap space is available. The shrinker also directly
> + * uses the available swap space to determine whether it can swapout
> + * anon pages in the same manner.
> + */
> +EXPORT_SYMBOL_GPL(nr_swap_pages);
>
> Something like that, after a couple more edits?
The last sentence isn't necessary IMO, but other than that it looks
good to me.
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
WARNING: multiple messages have this Message-ID (diff)
From: Johannes Weiner <hannes@cmpxchg.org>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org, linux-mm@kvack.org,
Akash Goel <akash.goel@intel.com>,
sourab.gupta@intel.com
Subject: Re: [PATCH v2] drm/i915: Disable shrinker for non-swapped backed objects
Date: Thu, 26 Nov 2015 10:40:16 -0500 [thread overview]
Message-ID: <20151126154016.GA23976@cmpxchg.org> (raw)
In-Reply-To: <20151126112514.GG23362@nuc-i3427.alporthouse.com>
On Thu, Nov 26, 2015 at 11:25:14AM +0000, Chris Wilson wrote:
> On Wed, Nov 25, 2015 at 03:46:35PM -0500, Johannes Weiner wrote:
> > On Wed, Nov 25, 2015 at 08:31:02PM +0000, Chris Wilson wrote:
> > > On Wed, Nov 25, 2015 at 02:06:10PM -0500, Johannes Weiner wrote:
> > > > On Wed, Nov 25, 2015 at 06:36:56PM +0000, Chris Wilson wrote:
> > > > > +static bool swap_available(void)
> > > > > +{
> > > > > + return total_swap_pages || frontswap_enabled;
> > > > > +}
> > > >
> > > > If you use get_nr_swap_pages() instead of total_swap_pages, this will
> > > > also stop scanning objects once the swap space is full. We do that in
> > > > the VM to stop scanning anonymous pages.
> > >
> > > Thanks. Would EXPORT_SYMBOL_GPL(nr_swap_pages) (or equivalent) be
> > > acceptable?
> >
> > No opposition from me. Just please add a small comment that this is
> > for shrinkers with swappable objects.
>
> diff --git a/mm/swapfile.c b/mm/swapfile.c
> index 58877312cf6b..1c7861f4c43c 100644
> --- a/mm/swapfile.c
> +++ b/mm/swapfile.c
> @@ -48,6 +48,14 @@ static sector_t map_swap_entry(swp_entry_t, struct block_device**);
> DEFINE_SPINLOCK(swap_lock);
> static unsigned int nr_swapfiles;
> atomic_long_t nr_swap_pages;
> +/*
> + * Some modules use swappable objects and may try to swap them out under
> + * memory pressure (via the shrinker). Before doing so, they may wish to
> + * check to see if any swap space is available. The shrinker also directly
> + * uses the available swap space to determine whether it can swapout
> + * anon pages in the same manner.
> + */
> +EXPORT_SYMBOL_GPL(nr_swap_pages);
>
> Something like that, after a couple more edits?
The last sentence isn't necessary IMO, but other than that it looks
good to me.
--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2015-11-26 15:40 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-23 9:20 [PATCH] drm/i915: Disable shrinker for non-swapped backed objects Chris Wilson
2015-11-24 17:15 ` Daniel Vetter
2015-11-24 23:17 ` Chris Wilson
2015-11-25 9:17 ` Daniel Vetter
2015-11-25 9:58 ` Chris Wilson
2015-11-25 13:36 ` Goel, Akash
2015-11-26 9:34 ` Daniel Vetter
2015-11-26 10:30 ` Chris Wilson
2015-11-26 11:36 ` Daniel Vetter
2015-11-25 18:36 ` [PATCH v2] " Chris Wilson
2015-11-25 18:53 ` Chris Wilson
2015-11-25 18:53 ` Chris Wilson
2015-11-25 19:06 ` Johannes Weiner
2015-11-25 20:31 ` Chris Wilson
2015-11-25 20:46 ` Johannes Weiner
2015-11-25 20:46 ` Johannes Weiner
2015-11-26 11:25 ` Chris Wilson
2015-11-26 15:40 ` Johannes Weiner [this message]
2015-11-26 15:40 ` Johannes Weiner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151126154016.GA23976@cmpxchg.org \
--to=hannes@cmpxchg.org \
--cc=akash.goel@intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
--cc=linux-mm@kvack.org \
--cc=sourab.gupta@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.