lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Mon, 17 Oct 2016 10:34:51 -0700
From:   Joel Fernandes <joelaf@...gle.com>
To:     Nicholas Piggin <npiggin@...il.com>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        linux-rt-users@...r.kernel.org,
        Chris Wilson <chris@...is-wilson.co.uk>,
        Jisheng Zhang <jszhang@...vell.com>,
        John Dias <joaodias@...gle.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        "open list:MEMORY MANAGEMENT" <linux-mm@...ck.org>
Subject: Re: [PATCH v2] mm: vmalloc: Replace purge_lock spinlock with atomic refcount

Hi Nick,

On Sun, Oct 16, 2016 at 9:00 PM, Nicholas Piggin <npiggin@...il.com> wrote:
> On Sat, 15 Oct 2016 03:42:42 -0700
> Joel Fernandes <joelaf@...gle.com> wrote:
>
>> 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] builds the
>> lazy free list in advance and atomically retrieves the list so any instance of
>> purge will have its own list it is purging. Since the individual vmap area
>> frees are themselves protected by a lock, this is Ok.
>
> This is a good idea, and good results, but that's not what the spinlock was
> for -- it was for enforcing the sync semantics.
>
> Going this route, you'll have to audit callers to expect changed behavior
> and change documentation of sync parameter.
>
> I suspect a better approach would be to instead use a mutex for this, and
> require that all sync=1 callers be able to sleep. I would say that most
> probably already can.

Thanks, I agree mutex is the right way to fix this.

Regards,
Joel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ