From: Nicholas Piggin <npiggin@gmail.com>
To: Joel Fernandes <joelaf@google.com>
Cc: linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org,
Chris Wilson <chris@chris-wilson.co.uk>,
Jisheng Zhang <jszhang@marvell.com>,
John Dias <joaodias@google.com>,
Andrew Morton <akpm@linux-foundation.org>,
"open list:MEMORY MANAGEMENT" <linux-mm@kvack.org>
Subject: Re: [PATCH v2] mm: vmalloc: Replace purge_lock spinlock with atomic refcount
Date: Mon, 17 Oct 2016 15:00:05 +1100 [thread overview]
Message-ID: <20161017150005.4c8f890d@roar.ozlabs.ibm.com> (raw)
In-Reply-To: <1476528162-21981-1-git-send-email-joelaf@google.com>
On Sat, 15 Oct 2016 03:42:42 -0700
Joel Fernandes <joelaf@google.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,
Nick
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2016-10-17 4:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-15 10:42 [PATCH v2] mm: vmalloc: Replace purge_lock spinlock with atomic refcount Joel Fernandes
2016-10-17 2:22 ` [lkp] [mm] b1f58b69ba: BUG: sleeping function called from invalid context at mm/vmalloc.c:667 kernel test robot
2016-10-17 4:00 ` Nicholas Piggin [this message]
2016-10-17 17:34 ` [PATCH v2] mm: vmalloc: Replace purge_lock spinlock with atomic refcount Joel Fernandes
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=20161017150005.4c8f890d@roar.ozlabs.ibm.com \
--to=npiggin@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=chris@chris-wilson.co.uk \
--cc=joaodias@google.com \
--cc=joelaf@google.com \
--cc=jszhang@marvell.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-rt-users@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).