Re: [PATCH] mm: add resched points to remap_pmd_range/ioremap_pmd_range

From: Jörn Engel
Date: Fri Jul 24 2015 - 13:00:45 EST


On Thu, Jul 23, 2015 at 05:32:03PM -0600, Toshi Kani wrote:
> On Thu, 2015-07-23 at 14:54 -0700, Spencer Baugh wrote:
> > From: Joern Engel <joern@xxxxxxxxx>
> >
> > Mapping large memory spaces can be slow and prevent high-priority
> > realtime threads from preempting lower-priority threads for a long time.
>
> Yes, and one of the goals of large page ioremap support is to address such
> problem.

Nice! Once we upgrade we should retest this one then.

> > ------------[ cut here ]------------
> > WARNING: at arch/x86/kernel/irq.c:182 do_IRQ+0x126/0x140()
> > Thread not rescheduled for 95 jiffies
> > CPU: 14 PID: 6684 Comm: foo Tainted: G W O 3.10.59+
> > 0000000000000009 ffff883f7fbc3ee0 ffffffff8163a12c ffff883f7fbc3f18
> > ffffffff8103f131 ffff887f48275ac0 000000000000002f 000000000000007c
> > 0000000000000000 00007fadd1e00000 ffff883f7fbc3f78 ffffffff8103f19c
> > Call Trace:
> > <IRQ> [<ffffffff8163a12c>] dump_stack+0x19/0x1b
> > [<ffffffff8103f131>] warn_slowpath_common+0x61/0x80
> > [<ffffffff8103f19c>] warn_slowpath_fmt+0x4c/0x50
> > [<ffffffff810bd917>] ? rcu_irq_exit+0x77/0xc0
> > [<ffffffff8164a556>] do_IRQ+0x126/0x140
> > [<ffffffff816407ef>] common_interrupt+0x6f/0x6f
> > <EOI> [<ffffffff81640483>] ? _raw_spin_lock+0x13/0x30
> > [<ffffffff8111b621>] __pte_alloc+0x31/0xc0
> > [<ffffffff8111feac>] remap_pfn_range+0x45c/0x470
>
> remap_pfn_range() does not have large page mappings support yet. So, yes,
> this can still take a long time at this point. We can extend large page
> support for this interface if necessary.

A cond_resched() is enough to solve the latency impact. But I suspect
large pages will perform better as well, so having that support would be
appreciated.

> > [<ffffffffa007f1f8>] vfio_pci_mmap+0x148/0x210 [vfio_pci]
> > [<ffffffffa0025173>] vfio_device_fops_mmap+0x23/0x30 [vfio]
> > [<ffffffff81124ed8>] mmap_region+0x3d8/0x5e0
> > [<ffffffff811253e5>] do_mmap_pgoff+0x305/0x3c0
> > [<ffffffff8126f3f3>] ? call_rwsem_down_write_failed+0x13/0x20
> > [<ffffffff81111677>] vm_mmap_pgoff+0x67/0xa0
> > [<ffffffff811237e2>] SyS_mmap_pgoff+0x272/0x2e0
> > [<ffffffff810067e2>] SyS_mmap+0x22/0x30
> > [<ffffffff81648c59>] system_call_fastpath+0x16/0x1b
> > ---[ end trace 6b0a8d2341444bde ]---

Jörn

--
A defeated army first battles and then seeks victory.
-- Sun Tzu
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/