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 X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6FF76C43331 for ; Wed, 13 Nov 2019 15:17:44 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0CC20222C2 for ; Wed, 13 Nov 2019 15:17:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lca.pw header.i=@lca.pw header.b="m0pT5dPE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0CC20222C2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lca.pw Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 737B56B0005; Wed, 13 Nov 2019 10:17:43 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6E87E6B0006; Wed, 13 Nov 2019 10:17:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5D8CC6B0007; Wed, 13 Nov 2019 10:17:43 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0169.hostedemail.com [216.40.44.169]) by kanga.kvack.org (Postfix) with ESMTP id 488BD6B0005 for ; Wed, 13 Nov 2019 10:17:43 -0500 (EST) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id 024445820 for ; Wed, 13 Nov 2019 15:17:43 +0000 (UTC) X-FDA: 76151608806.29.ball25_2635cc282511b X-HE-Tag: ball25_2635cc282511b X-Filterd-Recvd-Size: 4665 Received: from mail-qk1-f195.google.com (mail-qk1-f195.google.com [209.85.222.195]) by imf29.hostedemail.com (Postfix) with ESMTP for ; Wed, 13 Nov 2019 15:17:42 +0000 (UTC) Received: by mail-qk1-f195.google.com with SMTP id e187so2034246qkf.4 for ; Wed, 13 Nov 2019 07:17:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lca.pw; s=google; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=H4ypCCbJzD7lt3VfkoActitGcSwU/YTUe9BYJaFohtA=; b=m0pT5dPEiESris5ICXgwBqe1oWqRZmmiMgaQrqmEN/yOqb6iZLuUR4z0FfcKNucQne eflpoonxmAk0xOgxcTeQ+IUwt0az7aUGsElMBCx+ciNW9k/LIcWzGn6NMk9OLqvryapx rU4YiD+Rx7v8L2xzr6RCuhNb9i9zSHjv8AtxBFGnPy2lAiWMGb2KoCYd8G7R+tO1dv4h emnk/XQBHXw6rGTPsxOAJfvQJscN/k4/6bKkU/9VWIYwqSg7cnmiRyzPSq2Qfh29UoQj HAzQHZarBPf48AT5DD90Q86AiifTDLFMXKAd7x447dlEb5+yBSZj0UtiQGR+KWzT8Nqd vB9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=H4ypCCbJzD7lt3VfkoActitGcSwU/YTUe9BYJaFohtA=; b=FfAD7LhyLlArA6ccsaSovcGa7b3hcx05Lnx2RFQp+tzmSr+dFvz5UW0wICb3co+t1b Dhk53U3fbBKUZ2h6z8FkBOX34WWQfjDv7JWA+Ln6AsQ6hjnS5ZKA7LAcI5hZCMKicse+ 8DPDL9cbkc2gX/sznkg0LiHjazmIPuQqfJ+RnwKK1Q567qrssPWHY/X8MpkAi96XcgO0 YW2+L0oojAzLWjiyRadZn30x/m143h9zcUtfs7xwuiGTQv+WrjzFIiHoZO0ncoRDlp/Y unA2vP0ZG3gXN+oonXawL9SpjKr3r1qsmdOZSpyjPOLsuoUeq4YUXWbQYSuQy8epTSP4 gygA== X-Gm-Message-State: APjAAAWiCJDlMF2ourq3LVg+xD8jq9W4nYCsvnrBj1bE4Id1EFXLt2L0 PkUupAPloXw1bKCzVZokJb2auA== X-Google-Smtp-Source: APXvYqyrU62E3gOo/VAIRtzUzQu9IBORQPktpO60EU8u/ZtHUlnA7UaQanHtwIQ3+MQbwBV2/fkRBA== X-Received: by 2002:a05:620a:20c8:: with SMTP id f8mr2865537qka.282.1573658261612; Wed, 13 Nov 2019 07:17:41 -0800 (PST) Received: from dhcp-41-57.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id r4sm459800qkd.9.2019.11.13.07.17.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Nov 2019 07:17:40 -0800 (PST) Message-ID: <1573658259.5937.120.camel@lca.pw> Subject: Re: [PATCH] mm/vmalloc: Fix regression caused by needless vmalloc_sync_all() From: Qian Cai To: Shile Zhang , Andrew Morton , Joerg Roedel Cc: linux-mm@kvack.org, linux-kbuild@vger.kernel.org Date: Wed, 13 Nov 2019 10:17:39 -0500 In-Reply-To: <20191113095530.228959-1-shile.zhang@linux.alibaba.com> References: <20191113095530.228959-1-shile.zhang@linux.alibaba.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6 (3.22.6-10.el7) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit 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 Wed, 2019-11-13 at 17:55 +0800, Shile Zhang wrote: > vmalloc_sync_all() was put in the common path in > __purge_vmap_area_lazy(), for one sync issue only happened on X86_32 > with PTI enabled. It is needless for X86_64, which caused a big regression > in UnixBench Shell8 testing on X86_64. > Similar regression also reported by 0-day kernel test robot in reaim > benchmarking: > https://lists.01.org/hyperkitty/list/lkp@lists.01.org/thread/4D3JPPHBNOSPFK2KEPC6KGKS6J25AIDB/ > > Fix it by adding more conditions. > > Fixes: 3f8fd02b1bf1 ("mm/vmalloc: Sync unmappings in __purge_vmap_area_lazy()") > > Signed-off-by: Shile Zhang > --- > mm/vmalloc.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/mm/vmalloc.c b/mm/vmalloc.c > index a3c70e275f4e..7b9fc7966da6 100644 > --- a/mm/vmalloc.c > +++ b/mm/vmalloc.c > @@ -1255,11 +1255,17 @@ static bool __purge_vmap_area_lazy(unsigned long start, unsigned long end) > if (unlikely(valist == NULL)) > return false; > > +#if defined(CONFIG_X86_32) && defined(CONFIG_X86_PAE) Is it cleaner to use if (IS_ENABLED()...) ? > /* > * First make sure the mappings are removed from all page-tables > * before they are freed. > + * > + * This is only needed on x86-32 with !SHARED_KERNEL_PMD, which is > + * the case on a PAE kernel with PTI enabled. > */ > - vmalloc_sync_all(); > + if (!SHARED_KERNEL_PMD && boot_cpu_has(X86_FEATURE_PTI)) > + vmalloc_sync_all(); > +#endif > > /* > * TODO: to calculate a flush range without looping.