Re: [PATCH v3] mm: vmalloc: Replace purge_lock spinlock with atomic refcount

2016-10-17 Thread Christoph Hellwig
On Sun, Oct 16, 2016 at 03:48:42PM -0700, Joel Fernandes wrote: > Also, one more thing about the barrier dances you mentioned, this will > also be done by the spinlock which was there before my patch. So in > favor of my patch, it doesn't make things any worse than they were and > actually fixes th

Re: [PATCH v3] mm: vmalloc: Replace purge_lock spinlock with atomic refcount

2016-10-16 Thread Joel Fernandes
Hi Christoph, On Sun, Oct 16, 2016 at 3:06 PM, Joel Fernandes wrote: > On Sat, Oct 15, 2016 at 11:10 PM, Christoph Hellwig > wrote: >> On Sat, Oct 15, 2016 at 03:59:34PM -0700, Joel Fernandes wrote: >>> Also, could you share your concerns about use of atomic_t in my patch? >>> I believe that si

Re: [PATCH v3] mm: vmalloc: Replace purge_lock spinlock with atomic refcount

2016-10-16 Thread Joel Fernandes
On Sat, Oct 15, 2016 at 11:10 PM, Christoph Hellwig wrote: > On Sat, Oct 15, 2016 at 03:59:34PM -0700, Joel Fernandes wrote: >> Your patch changes the behavior of the original code I think. > > It does. And it does so as I don't think the existing behavior makes > sense, as mentioned in the chan

Re: [PATCH v3] mm: vmalloc: Replace purge_lock spinlock with atomic refcount

2016-10-15 Thread Christoph Hellwig
On Sat, Oct 15, 2016 at 03:59:34PM -0700, Joel Fernandes wrote: > Your patch changes the behavior of the original code I think. It does. And it does so as I don't think the existing behavior makes sense, as mentioned in the changelog. > With the > patch, for the case where you have 2 concurrent

Re: [PATCH v3] mm: vmalloc: Replace purge_lock spinlock with atomic refcount

2016-10-15 Thread Joel Fernandes
Hi Christoph, On Sat, Oct 15, 2016 at 9:54 AM, Christoph Hellwig wrote: > And now with a proper changelog, and the accidentall dropped call to > flush_tlb_kernel_range reinstated: > > --- > From f720cc324498ab5e7931c7ccb1653bd9b8cddc63 Mon Sep 17 00:00:00 2001 > From: Christoph Hellwig > Date: S

Re: [PATCH v3] mm: vmalloc: Replace purge_lock spinlock with atomic refcount

2016-10-15 Thread Christoph Hellwig
And now with a proper changelog, and the accidentall dropped call to flush_tlb_kernel_range reinstated: --- >From f720cc324498ab5e7931c7ccb1653bd9b8cddc63 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Sat, 15 Oct 2016 18:39:44 +0200 Subject: mm: rewrite __purge_vmap_area_lazy Remove the

Re: [PATCH v3] mm: vmalloc: Replace purge_lock spinlock with atomic refcount

2016-10-15 Thread Christoph Hellwig
atomic_t magic for llocking is always a bit iffy. The real question is: what is purge_lock even supposed to protect? - purge_fragmented_blocks seems to have it's own local protection. - all handling of of valist is implicity protected by the atomic list deletion in llist_del_all - the manip

[PATCH v3] mm: vmalloc: Replace purge_lock spinlock with atomic refcount

2016-10-15 Thread Joel Fernandes
The purge_lock spinlock causes high latencies with non RT kernel. This has been reported multiple times on lkml [1] [2] and affects applications like audio. In this patch, I replace the spinlock with an atomic refcount so that preemption is kept turned on during purge. This Ok to do since [3] buil