Re: [PATCH V2 RFC] fixup! virtio: convert to use DMA api

2016-04-27 Thread David Woodhouse
On Wed, 2016-04-27 at 21:17 +0300, Michael S. Tsirkin wrote: > > > Because it's a dirty hack in the *wrong* place. > > No one came up with a better one so far :( Seriously? Take a look at drivers/iommu/intel-iommu.c. It has quirks for all kinds of shitty devices that have to be put in

Re: [PATCH V2 RFC] fixup! virtio: convert to use DMA api

2016-04-27 Thread Michael S. Tsirkin
On Wed, Apr 27, 2016 at 04:15:35PM +0100, David Woodhouse wrote: > On Wed, 2016-04-27 at 18:05 +0300, Michael S. Tsirkin wrote: > > > > I really don't get it. > > > > There's exactly one device that works now and needs the work-around and > > so that we need to support, and that is virtio. It

Re: [PATCH v4 00/13] Support non-lru page migration

2016-04-27 Thread Andrew Morton
On Wed, 27 Apr 2016 16:48:13 +0900 Minchan Kim wrote: > Recently, I got many reports about perfermance degradation in embedded > system(Android mobile phone, webOS TV and so on) and easy fork fail. > > The problem was fragmentation caused by zram and GPU driver mainly. >

Re: [PATCH v4 00/13] Support non-lru page migration

2016-04-27 Thread Minchan Kim
Hello Andrew, On Wed, Apr 27, 2016 at 01:20:35PM -0700, Andrew Morton wrote: > On Wed, 27 Apr 2016 16:48:13 +0900 Minchan Kim wrote: > > > Recently, I got many reports about perfermance degradation in embedded > > system(Android mobile phone, webOS TV and so on) and easy

Re: [PATCH V2 RFC] fixup! virtio: convert to use DMA api

2016-04-27 Thread Andy Lutomirski
On Wed, Apr 27, 2016 at 7:38 AM, Michael S. Tsirkin wrote: > On Wed, Apr 27, 2016 at 07:31:43AM -0700, Andy Lutomirski wrote: >> On Wed, Apr 27, 2016 at 7:23 AM, Joerg Roedel wrote: >> > On Wed, Apr 27, 2016 at 04:37:04PM +0300, Michael S. Tsirkin wrote: >> >>

Re: [PATCH V2 RFC] fixup! virtio: convert to use DMA api

2016-04-27 Thread Michael S. Tsirkin
On Wed, Apr 27, 2016 at 07:43:07AM -0700, Andy Lutomirski wrote: > On Wed, Apr 27, 2016 at 7:38 AM, Michael S. Tsirkin wrote: > > On Wed, Apr 27, 2016 at 07:31:43AM -0700, Andy Lutomirski wrote: > >> On Wed, Apr 27, 2016 at 7:23 AM, Joerg Roedel wrote: > >> > On

[PATCH v4 03/12] mm: balloon: use general non-lru movable page feature

2016-04-27 Thread Minchan Kim
Now, VM has a feature to migrate non-lru movable pages so balloon doesn't need custom migration hooks in migrate.c and compaction.c. Instead, this patch implements page->mapping->a_ops->{isolate|migrate|putback} functions. With that, we could remove hooks for ballooning in general migration

[PATCH v4 02/12] mm: migrate: support non-lru movable page migration

2016-04-27 Thread Minchan Kim
We have allowed migration for only LRU pages until now and it was enough to make high-order pages. But recently, embedded system(e.g., webOS, android) uses lots of non-movable pages(e.g., zram, GPU memory) so we have seen several reports about troubles of small high-order allocation. For fixing

[PATCH v4 00/13] Support non-lru page migration

2016-04-27 Thread Minchan Kim
Recently, I got many reports about perfermance degradation in embedded system(Android mobile phone, webOS TV and so on) and easy fork fail. The problem was fragmentation caused by zram and GPU driver mainly. With memory pressure, their pages were spread out all of pageblock and it cannot be

Re: [RFC PATCH V2 1/2] vhost: convert pre sorted vhost memory array to interval tree

2016-04-27 Thread Michael S. Tsirkin
On Fri, Mar 25, 2016 at 10:34:33AM +0800, Jason Wang wrote: > Current pre-sorted memory region array has some limitations for future > device IOTLB conversion: > > 1) need extra work for adding and removing a single region, and it's >expected to be slow because of sorting or memory

Re: [PATCH] vhost_net: stop polling socket during rx processing

2016-04-27 Thread Michael S. Tsirkin
On Tue, Apr 26, 2016 at 03:35:53AM -0400, Jason Wang wrote: > We don't stop polling socket during rx processing, this will lead > unnecessary wakeups from under layer net devices (E.g > sock_def_readable() form tun). Rx will be slowed down in this > way. This patch avoids this by stop polling

Re: [RFC PATCH V2 2/2] vhost: device IOTLB API

2016-04-27 Thread Michael S. Tsirkin
On Fri, Mar 25, 2016 at 10:34:34AM +0800, Jason Wang wrote: > This patch tries to implement an device IOTLB for vhost. This could be > used with for co-operation with userspace(qemu) implementation of DMA > remapping. > > The idea is simple. When vhost meets an IOTLB miss, it will request > the

Re: [PATCH V2 RFC] fixup! virtio: convert to use DMA api

2016-04-27 Thread David Woodhouse
> > On some systems, including Xen and any system with a physical device > > that speaks virtio behind a physical IOMMU, we must use the DMA API > > for virtio DMA to work at all. > >  > > Add a feature bit to detect that: VIRTIO_F_IOMMU_PLATFORM. > >  > > If not there, we preserve historic

Re: [PATCH V2 RFC] fixup! virtio: convert to use DMA api

2016-04-27 Thread Michael S. Tsirkin
On Wed, Apr 27, 2016 at 01:18:21PM +0100, David Woodhouse wrote: > > > > On some systems, including Xen and any system with a physical device > > > that speaks virtio behind a physical IOMMU, we must use the DMA API > > > for virtio DMA to work at all. > > >  > > > Add a feature bit to detect

Re: [PATCH V2 RFC] fixup! virtio: convert to use DMA api

2016-04-27 Thread Michael S. Tsirkin
On Wed, Apr 27, 2016 at 04:56:32PM +0200, Joerg Roedel wrote: > On Wed, Apr 27, 2016 at 05:34:30PM +0300, Michael S. Tsirkin wrote: > > On Wed, Apr 27, 2016 at 04:23:32PM +0200, Joerg Roedel wrote: > > > QEMU can choose to bypass IOMMU for one device and not the other. > > IOMMU in QEMU isn't

Re: [PATCH V2 RFC] fixup! virtio: convert to use DMA api

2016-04-27 Thread Michael S. Tsirkin
On Wed, Apr 27, 2016 at 04:58:51PM +0200, Joerg Roedel wrote: > On Wed, Apr 27, 2016 at 05:54:57PM +0300, Michael S. Tsirkin wrote: > > Point is, QEMU is not the only virtio implementation out there. > > So we can't know no virtio implementations have an IOMMU as long as > > linux supports this

Re: [PATCH V2 RFC] fixup! virtio: convert to use DMA api

2016-04-27 Thread Andy Lutomirski
On Wed, Apr 27, 2016 at 7:54 AM, Michael S. Tsirkin wrote: > On Wed, Apr 27, 2016 at 07:43:07AM -0700, Andy Lutomirski wrote: >> On Wed, Apr 27, 2016 at 7:38 AM, Michael S. Tsirkin wrote: >> > On Wed, Apr 27, 2016 at 07:31:43AM -0700, Andy Lutomirski wrote: >>

Re: [PATCH V2 RFC] fixup! virtio: convert to use DMA api

2016-04-27 Thread David Woodhouse
On Wed, 2016-04-27 at 18:05 +0300, Michael S. Tsirkin wrote: > > I really don't get it. > > There's exactly one device that works now and needs the work-around and > so that we need to support, and that is virtio. It happens to have > exactly the same issue on all platforms. False. We have

Re: [PATCH V2 RFC] fixup! virtio: convert to use DMA api

2016-04-27 Thread Andy Lutomirski
On Wed, Apr 27, 2016 at 7:23 AM, Joerg Roedel wrote: > On Wed, Apr 27, 2016 at 04:37:04PM +0300, Michael S. Tsirkin wrote: >> One correction: it's a feature of the device in the system. >> There could be a mix of devices bypassing and not >> bypassing the IOMMU. > > No, it really

Re: [PATCH V2 RFC] fixup! virtio: convert to use DMA api

2016-04-27 Thread Michael S. Tsirkin
On Wed, Apr 27, 2016 at 04:23:32PM +0200, Joerg Roedel wrote: > On Wed, Apr 27, 2016 at 04:37:04PM +0300, Michael S. Tsirkin wrote: > > One correction: it's a feature of the device in the system. > > There could be a mix of devices bypassing and not > > bypassing the IOMMU. > > No, it really is

Re: [PATCH V2 RFC] fixup! virtio: convert to use DMA api

2016-04-27 Thread Michael S. Tsirkin
On Wed, Apr 27, 2016 at 07:31:43AM -0700, Andy Lutomirski wrote: > On Wed, Apr 27, 2016 at 7:23 AM, Joerg Roedel wrote: > > On Wed, Apr 27, 2016 at 04:37:04PM +0300, Michael S. Tsirkin wrote: > >> One correction: it's a feature of the device in the system. > >> There could be a