From: KOSAKI Motohiro Subject: Re: [Intel-gfx] [PATCH] drm/i915: Selectively enable self-reclaim Date: Thu, 1 Jul 2010 10:55:29 +0900 (JST) Message-ID: <20100701104934.DA30.A69D9226@jp.fujitsu.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Linus Torvalds Cc: kosaki.motohiro@jp.fujitsu.com, Chris Wilson , Dave Airlie , earny@net4u.de, Roman Jarosz , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, jcnengel@googlemail.com, "A. Boulan" , Hugh Dickins , Pekka Enberg , A Rojas , rientjes@google.com, michael@reinelt.co.at, stable@kernel.org, Vefa Bicakci List-Id: intel-gfx@lists.freedesktop.org > On Wed, Jun 30, 2010 at 4:07 PM, Linus Torvalds > wrote: > > > > That commit changes the page cache allocation to use > > > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0mapping_gfp_mask (mapping) | > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0__GFP_COLD | > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0gfpmask); > > > > if I read it right. And the default mapping_gfp_mask() is > > GFP_HIGHUSER_MOVABLE, so I think you get all of > > (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL | __GFP_HIGHMEM) > > set by default. >=20 > .. and then I left out the one flag I _meant_ to have there, namely > __GFP_MOVABLE. >=20 > > The old code didn't just play games with ~__GFP_NORETRY and change > > that at runtime (which was buggy - no locking, no protection, no > > nothing), it also initialized the gfp mask. And that code also got > > removed: >=20 > In fact, I don't really see why we should use that mapping_gfp_mask() > at all, since all allocations should be going through that > i915_gem_object_get_pages() function anyway. So why not just change > that function to ignore the default gfp mask for the mapping, and jus= t > use the mask that the o915 driver wants? >=20 > Btw, why did it want to mark the pages reclaimable? I'm not GEM expert at all. but as far as I read following documentation= , http://lwn.net/Articles/283798/ GEM memory have pin and unpin state and unpined memory can be reclaimed= =2E but it's just guess. So, I wonder if your patch solve the issue. I don'= t imazine a memory=20 state which "swap-out is safe, but compaction is unsafe". Dave, if you have good documentation which we understand GEM memory man= agement, could you send us? - kosaki >=20 > Anyway, what I'm suggesting somebody who sees this test is just > something like the patch below (whitespace-damage - I'm cutting and > pasting, it's a trivial one-liner). Does this change any behavior? > Vefa? >=20 > Linus >=20 > --- > diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i= 915_gem.c > index 9ded3da..ec8ed6b 100644 > --- a/drivers/gpu/drm/i915/i915_gem.c > +++ b/drivers/gpu/drm/i915/i915_gem.c > @@ -2239,7 +2239,7 @@ i915_gem_object_get_pages(struct drm_gem_object= *obj, > mapping =3D inode->i_mapping; > for (i =3D 0; i < page_count; i++) { > page =3D read_cache_page_gfp(mapping, i, > - mapping_gfp_mask (mapping)= | > + GFP_HIGHMEM | > __GFP_COLD | > gfpmask); > if (IS_ERR(page)) > -- > To unsubscribe from this list: send the line "unsubscribe linux-kerne= l" 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/