linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Venkatesh Pallipadi <venki@google.com>
To: Xiaotian Feng <dfeng@redhat.com>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Marcin Slusarz <marcin.slusarz@gmail.com>,
	Dan Carpenter <error27@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H.PeterA" <nvinhpa@zytor.com>,
	Jack Steiner <steiner@sgi.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"x86@kernel.org" <x86@kernel.org>
Subject: Re: [patch] x86, pat: freeing invalid memtype messages
Date: Mon, 21 Jun 2010 20:47:48 -0700	[thread overview]
Message-ID: <AANLkTim0QzkfGNdq-sP_JrVi6proXy9TsD09m6Unobsa@mail.gmail.com> (raw)
In-Reply-To: <4C2023D0.7010309@redhat.com>

On Mon, Jun 21, 2010 at 7:45 PM, Xiaotian Feng <dfeng@redhat.com> wrote:
> On 06/22/2010 01:54 AM, Suresh Siddha wrote:
>>
>> On Mon, 2010-06-21 at 08:41 -0700, Peter Zijlstra wrote:
>>>
>>> On Mon, 2010-06-21 at 17:33 +0200, Marcin Slusarz wrote:
>>>>
>>>> On Mon, Jun 21, 2010 at 07:07:27PM +0800, Xiaotian Feng wrote:
>>>>>
>>>>> On 06/21/2010 07:02 PM, Peter Zijlstra wrote:
>>>>>>
>>>>>> On Mon, 2010-06-21 at 18:56 +0800, Xiaotian Feng wrote:
>>>>>>
>>>>>>> I guess there might be something wrong between the augmented rbtree
>>>>>>> insert/remove ..
>>>>>>
>>>>>> The easiest thing is to revert that change and try again, the next
>>>>>> step
>>>>>> would be to print the full RB tree on each modification and look where
>>>>>> it goes wrong.
>>>>>>
>>>>>> That said, I did print my fair share of (augmented) RB trees while
>>>>>> playing with scheduler patches and I can't remember it ever having
>>>>>> messed up like that.
>>>>>
>>>>> He's using 2.6.35-rc2+, without your "rbtree: Undo augmented trees
>>>>> performance damage" patch ;-)
>>>>
>>>> I applied it manually (commit 2463eb8b3093995e09a0d41b3d78ee0cf5fb4249
>>>> from -tip)
>>>> to 2.6.35-rc3 and it fixed both acpi's and nouveau's "invalid memtype"
>>>> messages.
>>>> Thanks.
>>>
>>> Oh neat, so it actually fixes a bug in the previous augmented rb-tree
>>> implementation?
>>
>> When I was reviewing your fix, it looked like that prior to your fix we
>> were re-augmenting only at points where we do the tree rotations/color
>> change and at the points of node insertion/removal. I don't think we
>> were re-augmenting all the parent nodes in the path of the selected-node
>> that is going to replace the deleted node.
>>
>> Perhaps we were hitting this issue here.
>
> Were it from a insert without any rotations/color changes?
>
> This case is performing insert A/remove A/ 2nd insert A/ 2nd remove A/3rd
> insert A. And the 2nd remove
> shows us the invalid memtype.  3rd insert shows us it is in the rbtree. All
> I can image is that get_subtree_max_end
> in memtype_rb_lowest_match returned stale value.
>
> It looks like we don't re-augment the parent nodes if there aren't any
> rotations/color changes
> in the rb_insert_color().


Nice detective work! Yes. That kind of hints that max_end
initialization is the problem. The patch I pointed to here
http://marc.info/?l=linux-mm-commits&m=127654225011850&w=2
will have a side-effect without Peter's change and make this problem worse.
This minimal patch here
https://bugzilla.kernel.org/show_bug.cgi?id=16092 comment #2
on a kernel without Peter's change should not have this problem with
insert however. As any new node starts at 0 max_end, updates itself to
memtype->end and calls augment on its parent in rb_insert_color
augment callback.

Thanks,
Venki

      reply	other threads:[~2010-06-22  3:52 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-17 13:45 [patch] x86, pat: freeing invalid memtype messages Dan Carpenter
2010-06-17 16:17 ` Marcin Slusarz
2010-06-17 16:33   ` Dan Carpenter
2010-06-18  1:58   ` Xiaotian Feng
2010-06-18  6:47   ` Xiaotian Feng
2010-06-18 17:57     ` Marcin Slusarz
2010-06-21 10:56       ` Xiaotian Feng
2010-06-21 11:02         ` Peter Zijlstra
2010-06-21 11:07           ` Xiaotian Feng
2010-06-21 15:33             ` Marcin Slusarz
2010-06-21 15:41               ` Peter Zijlstra
2010-06-21 17:54                 ` Suresh Siddha
2010-06-21 18:08                   ` Venkatesh Pallipadi
2010-06-21 18:38                     ` Venkatesh Pallipadi
2010-06-21 18:41                       ` Marcin Slusarz
2010-06-21 18:56                         ` Marcin Slusarz
2010-06-22  2:45                   ` Xiaotian Feng
2010-06-22  3:47                     ` Venkatesh Pallipadi [this message]

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=AANLkTim0QzkfGNdq-sP_JrVi6proXy9TsD09m6Unobsa@mail.gmail.com \
    --to=venki@google.com \
    --cc=dfeng@redhat.com \
    --cc=error27@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcin.slusarz@gmail.com \
    --cc=mingo@redhat.com \
    --cc=nvinhpa@zytor.com \
    --cc=peterz@infradead.org \
    --cc=steiner@sgi.com \
    --cc=suresh.b.siddha@intel.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.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;
as well as URLs for NNTP newsgroup(s).