Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1493199
| Path | csiph.com!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Jisheng Zhang <jszhang@marvell.com> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] mm/vmalloc: reduce the number of lazy_max_pages to reduce latency |
| Date | Thu, 29 Sep 2016 10:40:01 +0200 |
| Message-ID | <smF2N-1Ft-1@gated-at.bofh.it> (permalink) |
| References | <smE6K-10y-13@gated-at.bofh.it> <smEJr-1zc-1@gated-at.bofh.it> |
| X-Original-To | Chris Wilson <chris@chris-wilson.co.uk> |
| X-Mailer | Claws Mail 3.14.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset="US-ASCII" |
| Content-Transfer-Encoding | 7bit |
| X-Proofpoint-Virus-Version | vendor=fsecure engine=2.50.10432:,, definitions=2016-09-29_04:,, signatures=0 |
| X-Proofpoint-Details | rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=2 malwarescore=0 lowpriorityscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609020000 definitions=main-1609290145 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 69 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | <akpm@linux-foundation.org>, <mgorman@techsingularity.net>, <rientjes@google.com>, <iamjoonsoo.kim@lge.com>, <agnel.joel@gmail.com>, <linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org> |
| X-Original-Date | Thu, 29 Sep 2016 16:28:08 +0800 |
| X-Original-Message-ID | <20160929162808.745c869b@xhacker> |
| X-Original-References | <20160929073411.3154-1-jszhang@marvell.com> <20160929081818.GE28107@nuc-i3427.alporthouse.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1493199 |
Show key headers only | View raw
On Thu, 29 Sep 2016 09:18:18 +0100 Chris Wilson wrote:
> On Thu, Sep 29, 2016 at 03:34:11PM +0800, Jisheng Zhang wrote:
> > On Marvell berlin arm64 platforms, I see the preemptoff tracer report
> > a max 26543 us latency at __purge_vmap_area_lazy, this latency is an
> > awfully bad for STB. And the ftrace log also shows __free_vmap_area
> > contributes most latency now. I noticed that Joel mentioned the same
> > issue[1] on x86 platform and gave two solutions, but it seems no patch
> > is sent out for this purpose.
> >
> > This patch adopts Joel's first solution, but I use 16MB per core
> > rather than 8MB per core for the number of lazy_max_pages. After this
> > patch, the preemptoff tracer reports a max 6455us latency, reduced to
> > 1/4 of original result.
>
> My understanding is that
>
> diff --git a/mm/vmalloc.c b/mm/vmalloc.c
> index 91f44e78c516..3f7c6d6969ac 100644
> --- a/mm/vmalloc.c
> +++ b/mm/vmalloc.c
> @@ -626,7 +626,6 @@ void set_iounmap_nonlazy(void)
> static void __purge_vmap_area_lazy(unsigned long *start, unsigned long *end,
> int sync, int force_flush)
> {
> - static DEFINE_SPINLOCK(purge_lock);
> struct llist_node *valist;
> struct vmap_area *va;
> struct vmap_area *n_va;
> @@ -637,12 +636,6 @@ static void __purge_vmap_area_lazy(unsigned long *start, unsigned long *end,
> * should not expect such behaviour. This just simplifies locking for
> * the case that isn't actually used at the moment anyway.
> */
> - if (!sync && !force_flush) {
> - if (!spin_trylock(&purge_lock))
> - return;
> - } else
> - spin_lock(&purge_lock);
> -
> if (sync)
> purge_fragmented_blocks_allcpus();
>
> @@ -667,7 +660,6 @@ static void __purge_vmap_area_lazy(unsigned long *start, unsigned long *end,
> __free_vmap_area(va);
> spin_unlock(&vmap_area_lock);
Hi Chris,
Per my test, the bottleneck now is __free_vmap_area() over the valist, the
iteration is protected with spinlock vmap_area_lock. So the larger lazy max
pages, the longer valist, the bigger the latency.
So besides above patch, we still need to remove vmap_are_lock or replace with
mutex.
Thanks,
Jisheng
> }
> - spin_unlock(&purge_lock);
> }
>
> /*
>
>
> should now be safe. That should significantly reduce the preempt-disabled
> section, I think.
> -Chris
>
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] mm/vmalloc: reduce the number of lazy_max_pages to reduce latency Jisheng Zhang <jszhang@marvell.com> - 2016-09-29 09:40 +0200
Re: [PATCH] mm/vmalloc: reduce the number of lazy_max_pages to reduce latency Chris Wilson <chris@chris-wilson.co.uk> - 2016-09-29 10:20 +0200
Re: [PATCH] mm/vmalloc: reduce the number of lazy_max_pages to reduce latency Jisheng Zhang <jszhang@marvell.com> - 2016-09-29 10:40 +0200
Re: [PATCH] mm/vmalloc: reduce the number of lazy_max_pages to reduce latency Chris Wilson <chris@chris-wilson.co.uk> - 2016-09-29 13:10 +0200
Re: [PATCH] mm/vmalloc: reduce the number of lazy_max_pages to reduce latency Jisheng Zhang <jszhang@marvell.com> - 2016-09-29 13:30 +0200
Re: [PATCH] mm/vmalloc: reduce the number of lazy_max_pages to reduce latency Joel Fernandes <agnel.joel@gmail.com> - 2016-10-09 05:50 +0200
Re: [PATCH] mm/vmalloc: reduce the number of lazy_max_pages to reduce latency Chris Wilson <chris@chris-wilson.co.uk> - 2016-10-09 14:50 +0200
Re: [PATCH] mm/vmalloc: reduce the number of lazy_max_pages to reduce latency Joel Fernandes <joel.opensrc@gmail.com> - 2016-10-09 21:10 +0200
Re: [PATCH] mm/vmalloc: reduce the number of lazy_max_pages to reduce latency Chris Wilson <chris@chris-wilson.co.uk> - 2016-10-09 21:30 +0200
Re: [PATCH] mm/vmalloc: reduce the number of lazy_max_pages to reduce latency Joel Fernandes <agnel.joel@gmail.com> - 2016-10-11 07:10 +0200
Re: [PATCH] mm/vmalloc: reduce the number of lazy_max_pages to reduce latency Joel Fernandes <agnel.joel@gmail.com> - 2016-10-11 07:40 +0200
csiph-web