mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Martin J. Bligh" <mbligh@aracnet.com>
To: Hugh Dickins <hugh@veritas.com>
Cc: linux-kernel@vger.kernel.org, Andrew Morton <akpm@osdl.org>,
	Rajesh Venkatasubramanian <vrajesh@umich.edu>
Subject: Re: [PATCH] anobjrmap 9 priority mjb tree
Date: Fri, 09 Apr 2004 15:56:51 -0700	[thread overview]
Message-ID: <5220000.1081551411@[10.10.2.4]> (raw)
In-Reply-To: <Pine.LNX.4.44.0404092247480.5269-100000@localhost.localdomain>

>> > This anobjrmap 9 (or anon_mm9) patch adds Rajesh's radix priority search
>> > tree on top of Martin's 2.6.5-rc3-mjb2 tree, making a priority mjb tree!
>> > Approximately equivalent to Andrea's 2.6.5-aa1, but using anonmm instead
>> > of anon_vma, and of course each tree has its own additional features.
>> 
>> This slows down kernel compile a little, but worse, it slows down SDET
>> by about 25% (on the 16x). I think you did something horrible to sem
>> contention ... presumably i_shared_sem, which SDET was fighting with
>> as it was anyway ;-(
>> 
>> Diffprofile shows:
>> 
>>     122626    15.7% total
>>      44129   790.0% __down
>>      20988     4.1% default_idle
> 
> Many thanks for the good news, Martin ;)
> Looks like I've done something very stupid, perhaps a mismerge.
> Not found it yet, I'll carry on looking tomorrow.

I applied Andrew's high sophisticated proprietary semtrace technology.
The common ones are: 

Call Trace:
 [<c0105aee>] __down+0x96/0x10c
 [<c0118fb8>] default_wake_function+0x0/0x1c
 [<c0105cb8>] __down_failed+0x8/0xc
 [<c014314f>] .text.lock.mmap+0x39/0x12a
 [<c01421a7>] do_mmap_pgoff+0x4cf/0x60c
 [<c010cb74>] old_mmap+0x108/0x144
 [<c025c753>] syscall_call+0x7/0xb

Which is the vma_link call from do_mmap_pgoff here:

        /* Can addr have changed??
         *
         * Answer: Yes, several device drivers can do it in their
         *         f_op->mmap method. -DaveM
         */
        addr = vma->vm_start;

        if (!file || !rb_parent || !vma_merge(mm, prev, rb_parent, addr,
                                addr + len, vma->vm_flags, file, pgoff)) {
                vma_link(mm, vma, prev, rb_link, rb_parent);
                if (correct_wcount)
                        atomic_inc(&inode->i_writecount);

vma_link takes i_shared_sem.

Call Trace:
 [<c0105aee>] __down+0x96/0x10c
 [<c0118fb8>] default_wake_function+0x0/0x1c
 [<c0105cb8>] __down_failed+0x8/0xc
 [<c01431dd>] .text.lock.mmap+0xc7/0x12a
 [<c0142b4c>] do_munmap+0xbc/0x128
 [<c0141f91>] do_mmap_pgoff+0x2b9/0x60c
 [<c010cb74>] old_mmap+0x108/0x144
 [<c025c753>] syscall_call+0x7/0xb

Is the call to split_vma from do_munmap here:

        /*
         * If we need to split any vma, do it now to save pain later.
         *
         * Note: mremap's move_vma VM_ACCOUNT handling assumes a partially
         * unmapped vm_area_struct will remain in use: so lower split_vma
         * places tmp vma above, and higher split_vma places tmp vma below.
         */
        if (start > mpnt->vm_start) {
                if (split_vma(mm, mpnt, start, 0))
                        return -ENOMEM;
                prev = mpnt;
        }

split_vma takes i_shared_sem, then takes page_table_lock inside it
(which probably isn't helping either ;-)).

        if (mapping)
                down(&mapping->i_shared_sem);
        spin_lock(&mm->page_table_lock);

Call Trace:
 [<c0105aee>] __down+0x96/0x10c
 [<c0118fb8>] default_wake_function+0x0/0x1c
 [<c0105cb8>] __down_failed+0x8/0xc
 [<c014311b>] .text.lock.mmap+0x5/0x12a
 [<c0142f79>] exit_mmap+0x191/0x1d0
 [<c011ae84>] mmput+0x50/0x70
 [<c011ec6d>] do_exit+0x1b9/0x330
 [<c011eefa>] do_group_exit+0x9e/0xa0
 [<c011ef0a>] sys_exit_group+0xe/0x14
 [<c025c753>] syscall_call+0x7/0xb

That's remove_shared_vm_struct calling i_shared_sem

Call Trace:
 [<c0105aee>] __down+0x96/0x10c
 [<c0118fb8>] default_wake_function+0x0/0x1c
 [<c0105cb8>] __down_failed+0x8/0xc
 [<c014311b>] .text.lock.mmap+0x5/0x12a
 [<c0142694>] unmap_vma+0x44/0x78
 [<c01426dc>] unmap_vma_list+0x14/0x20
 [<c0142ba5>] do_munmap+0x115/0x128
 [<c0141f91>] do_mmap_pgoff+0x2b9/0x60c
 [<c010cb74>] old_mmap+0x108/0x144
 [<c025c753>] syscall_call+0x7/0xb

That's remove_shared_vm_struct again, but called from unmap_vma this time

Call Trace:
 [<c0105aee>] __down+0x96/0x10c
 [<c0118fb8>] default_wake_function+0x0/0x1c
 [<c0105cb8>] __down_failed+0x8/0xc
 [<c011c494>] .text.lock.fork+0x79/0x125
 [<c011be5c>] copy_process+0x61c/0xa6c
 [<c011c322>] do_fork+0x76/0x16f
 [<c0105619>] sys_clone+0x29/0x30
 [<c025c753>] syscall_call+0x7/0xb

That's dup_mmap taking i_shared_sem here:

                        /* insert tmp into the share list, just after mpnt */
                        down(&file->f_mapping->i_shared_sem);
                        __vma_prio_tree_add(tmp, mpnt);
                        up(&file->f_mapping->i_shared_sem);


  parent reply	other threads:[~2004-04-09 22:57 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-04 12:33 Hugh Dickins
2004-04-09 20:39 ` Martin J. Bligh
2004-04-09 21:31   ` Rajesh Venkatasubramanian
2004-04-09 21:40     ` Martin J. Bligh
2004-04-09 23:17       ` Rajesh Venkatasubramanian
2004-04-09 21:51   ` Hugh Dickins
2004-04-09 22:01     ` Martin J. Bligh
2004-04-09 22:56     ` Martin J. Bligh [this message]
2004-04-11 16:09       ` Hugh Dickins
2004-04-11 17:28         ` Martin J. Bligh
2004-04-12  4:32           ` Rajesh Venkatasubramanian
2004-04-12  5:24             ` Martin J. Bligh
2004-04-12 15:46           ` Martin J. Bligh
2004-04-12 18:43             ` Hugh Dickins
2004-04-12 18:58               ` Rajesh Venkatasubramanian
2004-04-12 19:01               ` Martin J. Bligh
2004-04-12 19:10                 ` Hugh Dickins
2004-04-12 19:38                   ` Rajesh Venkatasubramanian
2004-04-12 21:14                     ` Martin J. Bligh
2004-04-12 21:12                       ` Andrew Morton
2004-04-12 21:43                         ` Martin J. Bligh
2004-04-14 20:18                       ` Rajesh Venkatasubramanian
2004-04-15  0:05                         ` Andrea Arcangeli
2004-04-15  0:22                           ` Martin J. Bligh
2004-04-15  3:40                           ` Rajesh Venkatasubramanian
2004-04-15  6:23                             ` Martin J. Bligh
2004-04-15 10:26                               ` Hugh Dickins
2004-04-15 12:52                                 ` Andrea Arcangeli
2004-04-15 15:40                                 ` Martin J. Bligh
2004-04-15 16:55                                   ` Hugh Dickins
2004-04-15 17:14                                     ` Martin J. Bligh
2004-04-15 17:50                                       ` Hugh Dickins
2004-04-15 18:42                                         ` Dave McCracken
     [not found]                                         ` <192710000.1082052992@flay>
2004-04-15 18:47                                           ` Rajesh Venkatasubramanian
2004-04-15 22:40                                       ` Andrea Arcangeli
2004-04-15 22:33                                   ` Andrea Arcangeli
2004-04-15 13:00                             ` Andrea Arcangeli
2004-04-15 14:41                               ` Rajesh Venkatasubramanian

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='5220000.1081551411@[10.10.2.4]' \
    --to=mbligh@aracnet.com \
    --cc=akpm@osdl.org \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vrajesh@umich.edu \
    /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

all inboxes | Powered by JetHome®