Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1172997ybe; Wed, 11 Sep 2019 10:27:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqwzVdBOFby6mo17qvA9sWoDosTNNB9eUvpIpQVShuTNBwOnXubQzfmLaXo482XaI5iMoD0Y X-Received: by 2002:a17:906:a851:: with SMTP id dx17mr31122167ejb.116.1568222869280; Wed, 11 Sep 2019 10:27:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568222869; cv=none; d=google.com; s=arc-20160816; b=gz/zGznzNHJxkhmKCLama9dcuAICzVt6YP0jpOG+StgS8ls/HiSv36F0u1jwJBUTtr 0E2hyup/0GqdNKEmr3A2TpBOlcWUQbPmmqeO0orA4cSdm++yZVNE1AkfzQHkZWRapx0T IDVliQzxRjoyVDNa5u/GJ3xLPo6rOJE2ZIFKPKf60otO8I+UyKUUrbSOVS5SywqTsmei jEYb/+AHRV73rtUV/YWsqS5QT6NLYO8jeT7EhVjoJ8dkAV3KUO2tgDcyimo7DIh7+wPX Unj9kcTWgzpNmybeO9RFKUaV9IWJo/EETLPndNiW42V4UkHXs/qlDj8LRyXC7+gyqbbv iW7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=0ExgZnqgklMWdIYiMJ2Wv1Hn7vtnSFHAJcrwJboP42E=; b=bCfnAd5BfS/c2rxp+k1WP750RIro9BvoUsigYKZF+HwnWn8ytnhJmlie7ra9B6KlIY EymaFFcVyJI9kRwqs373v+w84wALVq7cIfXJ5cL1b/bcq9IaQZr8i4eOylG1kua6Wruu Ox7Y/d9TKamaIHk4MyYtk4Ba7dWOgd09C8v0L3SDfJb39+k0x7IlaioxvBDdVFtBMKiZ yN6Dt1QMNnebBa17A2cpknlxxjeXhEvpRtY4hon1r31rxFyQN/9/A5Hg+FzmAuSdSl0E GjRI1uMxuPB9zl5Ocosm6+NaLsysAtiP14zfGlCQEyU0QOXplTiVQ95CJ/BwbRak2qKG 4LyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b=VZFyADzL; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u19si11416321ejt.159.2019.09.11.10.27.25; Wed, 11 Sep 2019 10:27:49 -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=@lca.pw header.s=google header.b=VZFyADzL; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729518AbfIKRWv (ORCPT + 99 others); Wed, 11 Sep 2019 13:22:51 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:38952 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729264AbfIKRWu (ORCPT ); Wed, 11 Sep 2019 13:22:50 -0400 Received: by mail-qt1-f194.google.com with SMTP id n7so26226038qtb.6 for ; Wed, 11 Sep 2019 10:22:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lca.pw; s=google; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=0ExgZnqgklMWdIYiMJ2Wv1Hn7vtnSFHAJcrwJboP42E=; b=VZFyADzL38joKkpJuBWRKTPWsj0AsFVHMPzQmYRB/9/C00xWTM+HXGJVBChxai54gS ZPDKBIEv+3XmTYpkzKY7npox4Dpl/3w3jabJF7K01DBzkyOfowbsgdPSoZi4zbw7T8CS lqhkLI0CL+AYPPCIzX//zUnH4CsC4l3bdqsfFiwzgR2Q0vLYsW54MCzPPN7qQrLcWHUO 1MJuuxIZkyUguMM0yxqT9xz9lWg2D9i4fcLnIxLFON/CwLmciDK0B0fnx/egtBiLgJ0o KCSian6nIevP8C/tUooQePOnZKoolNdww5VPAbHN3PYUKhXRjSI+JcIY9AM13ZVeaekW iTNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=0ExgZnqgklMWdIYiMJ2Wv1Hn7vtnSFHAJcrwJboP42E=; b=f8ltNAfhU0T2Nui7YFZDNa4BXbVABFPwg7HZDR7OeUkKaj7BtqjD9KnkmoX9IliSlb PrxrGoqpHC8Qeo11Yqd02LNJDbEVPOoJxMh7wLcmG+8zgu5iTerG3QbOai2dU9aQ8mZy yxxk3D75PhKEepamqNHnGc7mGw9DNdMupWkA92PwGdS/ePYbwHLNOUhK8Rssjow9DO/v HFcZ4nk/Ktn/XSGi4ANe1T5BEbu2emfOAHf1nU0/Qteg9OXyBdbc3Ue4opusTovTqRhH WZO1ILEnQCB+ttGW6/8zfTiGqTlc6oFuWFFCO04RqP9gtqA2oJU4FJCkkbK8lUo3yikB c0WA== X-Gm-Message-State: APjAAAX/CapKsmIAaSdzRw4g7DIxMY5LHufLXujK/TY6/5u1tHgBsSQr 4/vRTZux8pzIVbZecl0BhL/m7A== X-Received: by 2002:ac8:6983:: with SMTP id o3mr18706431qtq.31.1568222569708; Wed, 11 Sep 2019 10:22:49 -0700 (PDT) Received: from [192.168.1.153] (pool-71-184-117-43.bstnma.fios.verizon.net. [71.184.117.43]) by smtp.gmail.com with ESMTPSA id w11sm12308601qtj.10.2019.09.11.10.22.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Sep 2019 10:22:49 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: [PATCH 5/5] hugetlbfs: Limit wait time when trying to share huge PMD From: Qian Cai In-Reply-To: <5229662c-d709-7aca-be4c-53dea1a49fda@redhat.com> Date: Wed, 11 Sep 2019 13:22:47 -0400 Cc: Mike Kravetz , Matthew Wilcox , Peter Zijlstra , Ingo Molnar , Will Deacon , Alexander Viro , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, Davidlohr Bueso Content-Transfer-Encoding: quoted-printable Message-Id: References: <20190911150537.19527-1-longman@redhat.com> <20190911150537.19527-6-longman@redhat.com> <20190911151451.GH29434@bombadil.infradead.org> <19d9ea18-bd20-e02f-c1de-70e7322f5f22@redhat.com> <40a511a4-5771-f9a9-40b6-64e39478bbcb@oracle.com> <5229662c-d709-7aca-be4c-53dea1a49fda@redhat.com> To: Waiman Long X-Mailer: Apple Mail (2.3445.104.11) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Sep 11, 2019, at 1:15 PM, Waiman Long wrote: >=20 > On 9/11/19 6:03 PM, Mike Kravetz wrote: >> On 9/11/19 8:44 AM, Waiman Long wrote: >>> On 9/11/19 4:14 PM, Matthew Wilcox wrote: >>>> On Wed, Sep 11, 2019 at 04:05:37PM +0100, Waiman Long wrote: >>>>> When allocating a large amount of static hugepages (~500-1500GB) = on a >>>>> system with large number of CPUs (4, 8 or even 16 sockets), = performance >>>>> degradation (random multi-second delays) was observed when = thousands >>>>> of processes are trying to fault in the data into the huge pages. = The >>>>> likelihood of the delay increases with the number of sockets and = hence >>>>> the CPUs a system has. This only happens in the initial setup = phase >>>>> and will be gone after all the necessary data are faulted in. >>>> Can;t the application just specify MAP_POPULATE? >>> Originally, I thought that this happened in the startup phase when = the >>> pages were faulted in. The problem persists after steady state had = been >>> reached though. Every time you have a new user process created, it = will >>> have its own page table. >> This is still at fault time. Although, for the particular = application it >> may be after the 'startup phase'. >>=20 >>> It is the sharing of the of huge page shared >>> memory that is causing problem. Of course, it depends on how the >>> application is written. >> It may be the case that some applications would find the delays = acceptable >> for the benefit of shared pmds once they reach steady state. As you = say, of >> course this depends on how the application is written. >>=20 >> I know that Oracle DB would not like it if PMD sharing is disabled = for them. >> Based on what I know of their model, all processes which share PMDs = perform >> faults (write or read) during the startup phase. This is in = environments as >> big or bigger than you describe above. I have never looked at/for = delays in >> these environments around pmd sharing (page faults), but that does = not mean >> they do not exist. I will try to get the DB group to give me access = to one >> of their large environments for analysis. >>=20 >> We may want to consider making the timeout value and disable = threshold user >> configurable. >=20 > Making it configurable is certainly doable. They can be sysctl > parameters so that the users can reenable PMD sharing by making those > parameters larger. It could be a Kconfig option, so people don=E2=80=99t need to change the = setting every time after reinstalling the system. There are times people don=E2=80=99t care = too much about those random multi-second delays. For example, running a debug = kernel.