From: "M. Vefa Bicakci" <bicave@superonline.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Dave Airlie <airlied@gmail.com>,
Chris Wilson <chris@chris-wilson.co.uk>,
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: Sun, 18 Jul 2010 17:27:30 +0300 [thread overview]
Message-ID: <4C430F52.7040400@superonline.com> (raw)
In-Reply-To: <AANLkTikqSwnLqJXPYGjMP0NS8TJ4D2uOBLDipoV89Qwc@mail.gmail.com>
On 17/07/10 10:15 PM, Linus Torvalds wrote:
> On Sat, Jul 17, 2010 at 11:58 AM, M. Vefa Bicakci
> <bicave@superonline.com> wrote:
>>
>> The kernel with d8e0902806c0bd2ccc4f6a267ff52565a3ec933b reverted
>> was able to hibernate/thaw at least 40 times in one go, while
>> the one with your fix applied was able to hibernate/thaw at most
>> 17 times (in two separate trials) after which it crashed during
>> the next thaw.
>
> Ok. I do wonder if the bug is possibly something entirely different,
> and the allocation patterns just happen to expose/hide it. Reverting
> the original commit should be pretty darn close to applying my fix.
> Any remaining issues would seem to be more about the actual bug in the
> original code (racing on changing that mapping->gfp_mask witthout any
> locking) than about anything else.
>
>> Is there anything I can do find out the correct flags to use
>> in addition to GFP_HIGHUSER ? Can I do something like a bisection
>> for the flags one by one starting from the pre 2.6.32.8 state?
>> If you could outline a procedure to do this, I would be glad to
>> follow it.
>
> You can try adding __GFP_RECLAIMABLE | __GFP_NOMEMALLOC to the set of
> flags in i915_gem_object_get_pages(). That's what the old code had
> (and then it played games with NORETRY|NOWARN). I've attached a patch
> (UNTESTED! Maybe it won't compile).
>
> Now, I don't see why those flags would matter, but NOMEMALLOC in
> particular does make a difference for memory allocation patterns under
> low memory conditions, so maybe it could make a difference.
>
> And if it _does_ make a difference, it would be interesting to know
> which of the two flags matter. So try both flags first, and see if
> that gets you something reliable. And if it does, remove one of them
> and try again - just to see _which_ flag it is that the i915 driver
> would care about. That would hopefully give us a hint.
Dear Linus,
After hours of testing I came up with the following result: We need
to have the __GFP_RECLAIMABLE flag in addition to GFP_HIGHUSER.
First I tested a kernel with both flags added to your fix. I was able
to get more than 60 hibernate/thaw cycles without any errors, so
I thought that was good.
Then I tried a kernel with __GFP_NOMEMALLOC, and I found out that
this kernel wasn't very reliable. In the first trial run, I got a
crash in the second thaw. (Magic Sys-Rq did work.) In the second
trial run, I got a Xorg related kernel Oops in the 12th thaw.
Therefore I concluded that having only __GFP_NOMEMALLOC in addition
to GFP_HIGHUSER was not good enough.
Finally, I tested a kernel with __GFP_RECLAIMABLE. For this one, I did
two trial runs, each with 60 hibernate/thaw cycles. I had no problems
during these runs, so I concluded that __GFP_RECLAIMABLE is the key
flag to use in addition to GFP_HIGHUSER and __GFP_COLD.
I think in a previous e-mail you were suggesting that __GFP_RECLAIMABLE
could be optionally needed for a few technical reasons. To be honest, I
have no idea why it looks like it is needed for proper operation.
As always, it is great to report test results. Hopefully this time I did
enough amount of tests.
Regards,
M. Vefa Bicakci
WARNING: multiple messages have this Message-ID (diff)
From: "M. Vefa Bicakci" <bicave@superonline.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Dave Airlie <airlied@gmail.com>,
Chris Wilson <chris@chris-wilson.co.uk>,
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: Sun, 18 Jul 2010 17:27:30 +0300 [thread overview]
Message-ID: <4C430F52.7040400@superonline.com> (raw)
In-Reply-To: <AANLkTikqSwnLqJXPYGjMP0NS8TJ4D2uOBLDipoV89Qwc@mail.gmail.com>
On 17/07/10 10:15 PM, Linus Torvalds wrote:
> On Sat, Jul 17, 2010 at 11:58 AM, M. Vefa Bicakci
> <bicave@superonline.com> wrote:
>>
>> The kernel with d8e0902806c0bd2ccc4f6a267ff52565a3ec933b reverted
>> was able to hibernate/thaw at least 40 times in one go, while
>> the one with your fix applied was able to hibernate/thaw at most
>> 17 times (in two separate trials) after which it crashed during
>> the next thaw.
>
> Ok. I do wonder if the bug is possibly something entirely different,
> and the allocation patterns just happen to expose/hide it. Reverting
> the original commit should be pretty darn close to applying my fix.
> Any remaining issues would seem to be more about the actual bug in the
> original code (racing on changing that mapping->gfp_mask witthout any
> locking) than about anything else.
>
>> Is there anything I can do find out the correct flags to use
>> in addition to GFP_HIGHUSER ? Can I do something like a bisection
>> for the flags one by one starting from the pre 2.6.32.8 state?
>> If you could outline a procedure to do this, I would be glad to
>> follow it.
>
> You can try adding __GFP_RECLAIMABLE | __GFP_NOMEMALLOC to the set of
> flags in i915_gem_object_get_pages(). That's what the old code had
> (and then it played games with NORETRY|NOWARN). I've attached a patch
> (UNTESTED! Maybe it won't compile).
>
> Now, I don't see why those flags would matter, but NOMEMALLOC in
> particular does make a difference for memory allocation patterns under
> low memory conditions, so maybe it could make a difference.
>
> And if it _does_ make a difference, it would be interesting to know
> which of the two flags matter. So try both flags first, and see if
> that gets you something reliable. And if it does, remove one of them
> and try again - just to see _which_ flag it is that the i915 driver
> would care about. That would hopefully give us a hint.
Dear Linus,
After hours of testing I came up with the following result: We need
to have the __GFP_RECLAIMABLE flag in addition to GFP_HIGHUSER.
First I tested a kernel with both flags added to your fix. I was able
to get more than 60 hibernate/thaw cycles without any errors, so
I thought that was good.
Then I tried a kernel with __GFP_NOMEMALLOC, and I found out that
this kernel wasn't very reliable. In the first trial run, I got a
crash in the second thaw. (Magic Sys-Rq did work.) In the second
trial run, I got a Xorg related kernel Oops in the 12th thaw.
Therefore I concluded that having only __GFP_NOMEMALLOC in addition
to GFP_HIGHUSER was not good enough.
Finally, I tested a kernel with __GFP_RECLAIMABLE. For this one, I did
two trial runs, each with 60 hibernate/thaw cycles. I had no problems
during these runs, so I concluded that __GFP_RECLAIMABLE is the key
flag to use in addition to GFP_HIGHUSER and __GFP_COLD.
I think in a previous e-mail you were suggesting that __GFP_RECLAIMABLE
could be optionally needed for a few technical reasons. To be honest, I
have no idea why it looks like it is needed for proper operation.
As always, it is great to report test results. Hopefully this time I did
enough amount of tests.
Regards,
M. Vefa Bicakci
next prev parent reply other threads:[~2010-07-18 14:27 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-14 13:15 OOM-Killer kills too much with 2.6.32.2 Roman Jarosz
2010-01-23 0:40 ` David Rientjes
2010-01-25 22:12 ` Roman Jarosz
2010-01-25 1:48 ` KOSAKI Motohiro
2010-01-25 20:47 ` Roman Jarosz
2010-01-26 5:19 ` KOSAKI Motohiro
2010-01-26 7:51 ` A Rojas
2010-01-26 9:06 ` Roman Jarosz
2010-01-26 11:07 ` KOSAKI Motohiro
2010-01-26 12:33 ` Chris Wilson
2010-01-26 13:03 ` KOSAKI Motohiro
2010-01-26 13:18 ` Chris Wilson
2010-01-26 13:59 ` Michael Reinelt
2010-01-26 14:07 ` Michael Reinelt
2010-01-27 0:50 ` KOSAKI Motohiro
2010-01-27 9:56 ` Pekka Enberg
2010-01-27 10:55 ` Linus Torvalds
2010-01-27 11:12 ` Pekka Enberg
2010-01-27 11:14 ` [PATCH] drm/i915: Selectively enable self-reclaim Chris Wilson
2010-01-27 11:20 ` Pekka Enberg
2010-01-27 11:30 ` Michael Reinelt
2010-01-28 3:15 ` Michael Reinelt
2010-01-28 18:21 ` Roman Jarosz
2010-01-27 11:50 ` KOSAKI Motohiro
2010-01-27 12:16 ` Linus Torvalds
2010-01-27 12:28 ` Linus Torvalds
2010-01-27 15:25 ` Chris Wilson
2010-01-27 16:09 ` Linus Torvalds
2010-01-27 17:14 ` Chris Wilson
2010-01-27 17:19 ` Linus Torvalds
2010-01-27 21:03 ` Roman Jarosz
2010-06-30 6:54 ` [Intel-gfx] " Dave Airlie
2010-06-30 7:05 ` Chris Wilson
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 11:19 ` Chris Wilson
2010-07-01 22:34 ` M. Vefa Bicakci
2010-07-01 23:59 ` Linus Torvalds
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-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 [this message]
2010-07-18 14:27 ` M. Vefa Bicakci
2010-07-18 16:59 ` Linus Torvalds
2010-01-28 6:37 ` Willy Tarreau
2010-01-26 13:41 ` OOM-Killer kills too much with 2.6.32.2 Roman Jarosz
2010-01-27 0:14 ` KOSAKI Motohiro
2010-01-27 9:53 ` Roman Jarosz
2010-01-26 13:57 ` Pekka Enberg
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=4C430F52.7040400@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 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.