Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "M. Vefa Bicakci" <bicave@superonline.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Chris Wilson <chris@chris-wilson.co.uk>,
	Dave Airlie <airlied@gmail.com>,
	earny@net4u.de, Roman Jarosz <kedgedev@gmail.com>,
	intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	jcnengel@googlemail.com,
	"A. Boulan" <arnaud.boulan@libertysurf.fr>,
	Hugh Dickins <hugh.dickins@tiscali.co.uk>,
	Pekka Enberg <penberg@cs.helsinki.fi>,
	A Rojas <nqn1976list@gmail.com>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	rientjes@google.com, michael@reinelt.co.at, stable@kernel.org
Subject: Re: [Intel-gfx] [PATCH] drm/i915: Selectively enable self-reclaim
Date: Fri, 02 Jul 2010 01:34:52 +0300	[thread overview]
Message-ID: <4C2D180C.5050805@superonline.com> (raw)
In-Reply-To: <AANLkTinLB5YtqsnFwWrP37i3Ucr4fOaQzVuDLnyWBRGQ@mail.gmail.com>

On 01/07/10 04:24 AM, Linus Torvalds wrote:
> On Wed, Jun 30, 2010 at 4:07 PM, Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
>>
>> That commit changes the page cache allocation to use
>>
>> +                                          mapping_gfp_mask (mapping) |
>> +                                          __GFP_COLD |
>> +                                          gfpmask);
>>
>> 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.
> 
> .. and then I left out the one flag I _meant_ to have there, namely
> __GFP_MOVABLE.
> 
>> 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:
> 
> 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 just
> use the mask that the o915 driver wants?
> 
> Btw, why did it want to mark the pages reclaimable?
> 
> 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?
> 
>                     Linus

Dear Linus,

I made the code change you documented below to a vanilla 2.6.34 tree,
compiled it and tested hibernate/thaw cycles. In total, I tested
16 cycles, with 8 consecutive cycles in one installation (Debian Sid)
and 8 consecutive cycles in another one (Fedora 13). For every cycle,
I tried to run "old" and "new" programs, in terms of whether they were
run in previous cycles. I tried a few extra cycles with uswsusp as well.

Based on my testing, I am happy to report that the change you suggest
fixes the "memory corruption (segfaults) after thaw" issue for me.
I can't thank you enough times for this.

Now, the obligatory question: Could we have this fix applied to 2.6.32,
2.6.33 and 2.6.34 ?

Thanks a lot again!

M. Vefa Bicakci

--- linux-2.6.34/drivers/gpu/drm/i915/i915_gem.c.orig	2010-07-01 17:47:30.000000000 +0000
+++ linux-2.6.34/drivers/gpu/drm/i915/i915_gem.c	2010-07-01 17:54:03.000000000 +0000
@@ -2312,7 +2312,7 @@
 	mapping = inode->i_mapping;
 	for (i = 0; i < page_count; i++) {
 		page = read_cache_page_gfp(mapping, i,
-					   mapping_gfp_mask (mapping) |
+					   __GFP_HIGHMEM |
 					   __GFP_COLD |
 					   gfpmask);
 		if (IS_ERR(page))

  parent reply	other threads:[~2010-07-01 22:34 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <alpine.LFD.2.00.1001270327580.24253@localhost.localdomain>
     [not found] ` <1264605932-8540-1-git-send-email-chris@chris-wilson.co.uk>
     [not found]   ` <alpine.LFD.2.00.1001270738220.24253@localhost.localdomain>
     [not found]     ` <89k77n$ms73l9@fmsmga001.fm.intel.com>
     [not found]       ` <alpine.LFD.2.00.1001270917120.24253@localhost.localdomain>
2010-06-30  6:54         ` [Intel-gfx] [PATCH] drm/i915: Selectively enable self-reclaim Dave Airlie
2010-06-30  7:05           ` Chris Wilson
2010-06-30 23:07             ` [Intel-gfx] " Linus Torvalds
2010-07-01  1:24               ` Linus Torvalds
2010-07-01  1:55                 ` KOSAKI Motohiro
2010-07-01 10:15                 ` Dave Airlie
2010-07-01 11:19                 ` Chris Wilson
2010-07-01 22:34                 ` M. Vefa Bicakci [this message]
2010-07-01 23:59                   ` Linus Torvalds
2010-07-02  0:06                     ` [Intel-gfx] " Dave Airlie
2010-07-02  0:49                       ` Dave Airlie
2010-07-02  1:28                         ` Linus Torvalds
2010-07-17 18:58                           ` [Intel-gfx] " M. Vefa Bicakci
2010-07-17 19:15                             ` Linus Torvalds
2010-07-18 14:27                               ` M. Vefa Bicakci
2010-07-18 16:59                                 ` Linus Torvalds

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=4C2D180C.5050805@superonline.com \
    --to=bicave@superonline.com \
    --cc=airlied@gmail.com \
    --cc=arnaud.boulan@libertysurf.fr \
    --cc=chris@chris-wilson.co.uk \
    --cc=earny@net4u.de \
    --cc=hugh.dickins@tiscali.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jcnengel@googlemail.com \
    --cc=kedgedev@gmail.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael@reinelt.co.at \
    --cc=nqn1976list@gmail.com \
    --cc=penberg@cs.helsinki.fi \
    --cc=rientjes@google.com \
    --cc=stable@kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox