From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73BC6C433F5 for ; Wed, 6 Apr 2022 10:00:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F29EA6B0073; Wed, 6 Apr 2022 06:00:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EDA066B0074; Wed, 6 Apr 2022 06:00:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DA2E16B0075; Wed, 6 Apr 2022 06:00:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0052.hostedemail.com [216.40.44.52]) by kanga.kvack.org (Postfix) with ESMTP id CB8BD6B0073 for ; Wed, 6 Apr 2022 06:00:14 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 87C3AAB2B0 for ; Wed, 6 Apr 2022 10:00:04 +0000 (UTC) X-FDA: 79326008328.23.394C53E Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf15.hostedemail.com (Postfix) with ESMTP id E8AFDA003B for ; Wed, 6 Apr 2022 10:00:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649239203; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NQ9+QHpbwX71Nbl0VN3cQA+4hl/YvMsA02l8QK5ytZg=; b=fy7XnLrXBUfyFL7ZcbXUbd3/GtDrlIEB/YSST6hjt9ankVfBBWcZ8REu+J7JZzSYPycJ9w +9C4RknG8d3mBRjP4VB1PU5BIgCy+BxfjZgzI3vETyaHbBANz9GAMQ61F7dNUaeNkJOqlE QmEYD9nBP/VWSf7/qg+zgJOMYps2Drw= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-478-IxG0bomTNg-OfOYpw7bsGA-1; Wed, 06 Apr 2022 06:00:00 -0400 X-MC-Unique: IxG0bomTNg-OfOYpw7bsGA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8B025833942; Wed, 6 Apr 2022 09:59:59 +0000 (UTC) Received: from localhost (ovpn-12-227.pek2.redhat.com [10.72.12.227]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 15F8D40CF905; Wed, 6 Apr 2022 09:59:56 +0000 (UTC) Date: Wed, 6 Apr 2022 17:59:53 +0800 From: Baoquan He To: Uladzislau Rezki Cc: Christoph Hellwig , Omar Sandoval , linux-mm@kvack.org, kexec@lists.infradead.org, Andrew Morton , Cliff Wickman , x86@kernel.org, kernel-team@fb.com Subject: Re: [PATCH] mm/vmalloc: fix spinning drain_vmap_work after reading from /proc/vmcore Message-ID: References: <75014514645de97f2d9e087aa3df0880ea311b77.1649187356.git.osandov@fb.com> <20220406044244.GA9959@lst.de> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Stat-Signature: y3qq8adg683sask168mwnrn6dq5rbxoh Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=fy7XnLrX; spf=none (imf15.hostedemail.com: domain of bhe@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspam-User: X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: E8AFDA003B X-HE-Tag: 1649239203-436761 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 04/06/22 at 11:13am, Uladzislau Rezki wrote: > > On Tue, Apr 05, 2022 at 12:40:31PM -0700, Omar Sandoval wrote: > > > A simple way to "fix" this would be to make set_iounmap_nonlazy() s= et > > > vmap_lazy_nr to lazy_max_pages() instead of lazy_max_pages() + 1. B= ut, I > > > think it'd be better to get rid of this hack of clobbering vmap_laz= y_nr. > > > Instead, this fix makes __copy_oldmem_page() explicitly drain the v= map > > > areas itself. > >=20 > > This fixes the bug and the interface also is better than what we had > > before. But a vmap/iounmap_eager would seem even better. But hey, > > right now it has one caller in always built =D1=96n x86 arch code, so= maybe > > it isn't worth spending more effort on this. > > > IMHO, it just makes sense to remove it. The set_iounmap_nonlazy() was > added in 2010 year: >=20 > > commit 3ee48b6af49cf534ca2f481ecc484b156a41451d > Author: Cliff Wickman > Date: Thu Sep 16 11:44:02 2010 -0500 >=20 > mm, x86: Saving vmcore with non-lazy freeing of vmas >=20 > During the reading of /proc/vmcore the kernel is doing > ioremap()/iounmap() repeatedly. And the buildup of un-flushed > vm_area_struct's is causing a great deal of overhead. (rb_next() > is chewing up most of that time). >=20 > This solution is to provide function set_iounmap_nonlazy(). It > causes a subsequent call to iounmap() to immediately purge the > vma area (with try_purge_vmap_area_lazy()). >=20 > With this patch we have seen the time for writing a 250MB > compressed dump drop from 71 seconds to 44 seconds. >=20 > Signed-off-by: Cliff Wickman > Cc: Andrew Morton > Cc: kexec@lists.infradead.org > Cc: > LKML-Reference: > Signed-off-by: Ingo Molnar > >=20 > and the reason was the "slow vmap" code, i.e. due to poor performance > they decided to drop the lazily ASAP. Now we have absolutely different > picture when it comes to performance and the vmalloc/vmap code. I would vote for the current code change, removing it. As pointed out by Christoph, it's only used by x86, may not be so worth to introduce a new interface.