Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp6207254imm; Mon, 23 Jul 2018 13:29:53 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeBz0+6uUCeB0UbIxnFai0Ubiw1egyqHayTy/gN8lNgvS0YP+A/Dmfpeug+TM5zfSXuwQzl X-Received: by 2002:a65:62d8:: with SMTP id m24-v6mr13659887pgv.307.1532377793620; Mon, 23 Jul 2018 13:29:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532377793; cv=none; d=google.com; s=arc-20160816; b=XlzN7lWsiKNreDceVKrx5zgHj+VTrs9aWuy8/vyuyE/et1KE2cwoI3Vwsq1skP52Jh UdKAUHpcaoUxspbbPN/iczAQAGJ5bYxZY5NFws5bDPrISHUSILnGXh1jscQf6nISzrqx dKSrkhE6iX6cki2s8SZjqMQe353DSZ2CQZQkDd4PXn21vyB0Pm8pKRyzeJgzIsa9zDcM zmWmR4a0Cv3+k94adXBGNpHhlDRu29GUNNhtbfQkVgiMCMlq6/hYzhSW5ciW9vsh1dzd QiuVok07Z+FU/CcIGuE7t4xqxGhH5fNoGaExXkOW+TOQk0Wz+1UOVHqxlRVChRjloIyb QQow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=xOWqm0a+Cdy4lBwXBzXMerNrIuCNQhmpk+71lRXuYGo=; b=YYbtQOrS0+gSFP8OYDdyxhym4pRhH2M8aKrii3u3FFbiOz3ba4TD8iu+RfFNBGkg2x DPFuH9JqHVx+1axKog7eIodNI2AepYUQ00Q1ezqYRv0umPyWupnWV21OIp2F2XtRjK5w M3z8w7tyLAStACI/anlOfgX1agUt4VYN7pzrXwUpP/t9HNUdhiSc6Clq823JQaSDlcPc Ivq/2EocAuRvBmQOgOJSXtFJDsWRWfh6S8CFWE1eRvH9MJienlvKrAqAS4MJnGCDTkRY gO0ZxkZzJQJ/6izhUnBfdJA9VteqzRlJlkZ4sTtORFSE8XlgBDs0jvc7Q5h3tA4fyEOF W55g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Z+9cEnTn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 6-v6si9064189plb.409.2018.07.23.13.29.39; Mon, 23 Jul 2018 13:29:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Z+9cEnTn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388199AbeGWVbo (ORCPT + 99 others); Mon, 23 Jul 2018 17:31:44 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:37718 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388056AbeGWVbo (ORCPT ); Mon, 23 Jul 2018 17:31:44 -0400 Received: by mail-pf1-f193.google.com with SMTP id a26-v6so313364pfo.4 for ; Mon, 23 Jul 2018 13:28:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=xOWqm0a+Cdy4lBwXBzXMerNrIuCNQhmpk+71lRXuYGo=; b=Z+9cEnTnKPWmVynuetxxZ/MIIGvzwcyXZ8nDjSvG5NzRBcy+SskxwlhW430KhGvUzb 4p+veTQV7uVACTa3SP/u8LwvwqKpZOgccm+pAExyAzXqIbDUJXtlACz9a3g/h6Vceshk I/TwoslOOz4T9AMMMm/KFKzVKRnHNlz9GiQfi0h3rITPxwh9viEzymOxiAZIvubKUX3k a8Cl0O7Q7X69nt0daamL+lyP2/BoXqpkqhgth/9rtD38aJVwWrjSHj8CpoFxm8U1PFDd zwNIvINK/BnWty+BVCa2KiynhodoB/ccApYFp5NMeUvK/j/CUfcmw28MjENYEkC5IYrM 7lZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=xOWqm0a+Cdy4lBwXBzXMerNrIuCNQhmpk+71lRXuYGo=; b=Hw9In1JndMjceZg6bipaF2rDXk7E0fiCJs9gfOms3kD5q4YMyyKWesAhDrThCY06zf HcOHdaVsEVnqZBQjcaK4NROv60jZyGGS2ONb410K/CIMRLh9URnruZ5bw36exZ111IYy ujUGvG29xvzpMInxVyeRSfj4gB7N2aQuzEyOmU4Uv7WQgf4MGL4ZJLonVE/DO3uca2bg KzGIK6M9dfAJx3RtnAriRXeXPC34NT+ntn1JP9F1PXvNiirhFrPpuBOHBqaj+T3wJ5vx qTHyzn30hed2iFvKFaZvv/oauLANUh08ay2ZweFrm5KAd/VUkga0UONCZxFqoZfuEqMd gBvQ== X-Gm-Message-State: AOUpUlEf7d6QWlJs8lxFYAr5eaNHtKNdD9PhmW2D7p7u/OAQe4qdTNli 0933bxfzHUky3U9RD5PrrY8JtQ== X-Received: by 2002:a63:1403:: with SMTP id u3-v6mr13608389pgl.13.1532377731148; Mon, 23 Jul 2018 13:28:51 -0700 (PDT) Received: from [2620:15c:17:3:3a5:23a7:5e32:4598] ([2620:15c:17:3:3a5:23a7:5e32:4598]) by smtp.gmail.com with ESMTPSA id h24-v6sm22010680pfk.113.2018.07.23.13.28.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Jul 2018 13:28:50 -0700 (PDT) Date: Mon, 23 Jul 2018 13:28:49 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Matthew Wilcox cc: Yang Shi , Andrew Morton , kirill@shutemov.name, hughd@google.com, aaron.lu@intel.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: thp: remove use_zero_page sysfs knob In-Reply-To: <20180722035156.GA12125@bombadil.infradead.org> Message-ID: References: <1532110430-115278-1-git-send-email-yang.shi@linux.alibaba.com> <20180720123243.6dfc95ba061cd06e05c0262e@linux-foundation.org> <3238b5d2-fd89-a6be-0382-027a24a4d3ad@linux.alibaba.com> <20180722035156.GA12125@bombadil.infradead.org> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 21 Jul 2018, Matthew Wilcox wrote: > > The huge zero page can be reclaimed under memory pressure and, if it is, > > it is attempted to be allocted again with gfp flags that attempt memory > > compaction that can become expensive. If we are constantly under memory > > pressure, it gets freed and reallocated millions of times always trying to > > compact memory both directly and by kicking kcompactd in the background. > > > > It likely should also be per node. > > Have you benchmarked making the non-huge zero page per-node? > Not since we disable it :) I will, though. The more concerning issue for us, modulo CVE-2017-1000405, is the cpu cost of constantly directly compacting memory for allocating the hzp in real time after it has been reclaimed. We've observed this happening tens or hundreds of thousands of times on some systems. It will be 2MB per node on x86 if the data suggests we should make it NUMA aware, I don't think the cost is too high to leave it persistently available even under memory pressure if use_zero_page is enabled.