Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp5027152pxu; Tue, 22 Dec 2020 06:46:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJxx+v+85/A6jSZErx0zhHx7PZO9dAYSQFouHoNtX2zIRFzk4MFiO0q3PAxOpXmYfRVigEMT X-Received: by 2002:a17:906:3ac8:: with SMTP id z8mr6841190ejd.273.1608648367247; Tue, 22 Dec 2020 06:46:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608648367; cv=none; d=google.com; s=arc-20160816; b=xSJ1kmZNoq7LlCRV/rxXq8WX7o77sl+2/L19yPF6OhypXWKfea7knDDWffqDQFScnf z/9pbcpoVjqbucb8jsRC6bWIkRdQQznsggCrtwtonpVieOJZTSy6HfA2Ktm2VIdIh0S4 nJ81V1Uki4HW4TUvyPAwaeKjHq7o16RHdxvyy0lYv8op/nrPwn5yUELKG+I9UyzdgLr1 eqnHlRiLjM+KMWH/wzGmruga647IDPrdSPB3RLW/A/bX6YaEMzTGz3LuHdtfpWioYAvL IBEl+IYhlh+PfkvqfMycAHmnsIGfc/Xvkt9c3d6a28mPUjMa8V0eLPgZD6wwIGRCowsO LfXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=QOsSeP8Izdxam9v2mGDHrUG4xsPA2erruOt/uVv66oE=; b=wrXYq4nqYyQjEkHQW68iPFDOspbQgtMzOEb5zJCW6gj8SslDFfc6PhDow06J8sp8pU Wx2EkZqwLbmzJOdr3nTIAohI2sPjAi74GakpRt+mHEd6EDgM7gGNn+LFi70TWtfKOmNk M4jLTfNNuyjxYTHh+HOG/yCTUdp7F7IuugmrUp4gJ7w8v4AF/o0dFt0Jo7x8xHSq9qZX dljeymLpoeCW2R+kUPKwC4KPf/P2WquM3WaQvHNi27or1NOROynjEWo8RMmA/tIOVt62 vV0LsGIwBp1uiiopg/l4DPPEjnx+c99jnBkyXkP70R13Mkv8KudnNWAHdqAPR1fjt2Sa Yl8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HqWh94hU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g13si11940788edk.250.2020.12.22.06.45.43; Tue, 22 Dec 2020 06:46:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HqWh94hU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727562AbgLVOnI (ORCPT + 99 others); Tue, 22 Dec 2020 09:43:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726868AbgLVOnH (ORCPT ); Tue, 22 Dec 2020 09:43:07 -0500 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 639B0C061793 for ; Tue, 22 Dec 2020 06:42:27 -0800 (PST) Received: by mail-lf1-x130.google.com with SMTP id a12so32518145lfl.6 for ; Tue, 22 Dec 2020 06:42:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=QOsSeP8Izdxam9v2mGDHrUG4xsPA2erruOt/uVv66oE=; b=HqWh94hUaTDliG35Zagh2f9xBEF/weISci7WNbqpEcNYYUgmXJ1eT3aYMRTcPtGzey uKL8y5yEyMFZGUqJIYtd+D67pU8zOqcUk99fO18DohfDSO6o+fBr5bc+UqMBTFg5dQSd BJkLqaW4aJIm4o5BvC1EMdP7rLo6TeWi1tcL8TbzB03rLcXJgPLzhFsk1dMlHwA1lf+o rTB90BJBjfXtI7yonUC52lDUxrsgDMOtgFDfoDck01hcOx5PeyNHGpyr4bkB22HWdNx/ aEVmjaXpKzKEmx5YCuGOKsjVsgnzc4r33NB4BH9vM6P/4QcvWftZWySPfLttxIOFEu6v VE3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=QOsSeP8Izdxam9v2mGDHrUG4xsPA2erruOt/uVv66oE=; b=gEDUQOKmtMTZknY+0U+SAZ0aQoAtiDW3Y9O51s+Z2hoPwC3YCZfXvSgp70X+d0fdYv EiskV/p4SjvHZQYqSvBI/PsLNlOayH9026swVRmq4TOqebFHpfFohzEG8TZh6ABxhxUO 59nijO+0BsALp9tO/aWqdFGuJhXSZuXPrwlm5zp9HiUecrefPRjJxwoV0u+X0yqHtLPM dvXQ5Gcd1pBDDvpI0j1fOHFPs1FT4n79jBt/h0QAZSaIl64K2bYiENpGUh7YiwDldZ8U crQKbpDZrD1VwLRgkYEO0/+utjpAtsm1Ys1l2ui6EQodI9IFD7iLOYKLILK/9q0qBpxu sSOA== X-Gm-Message-State: AOAM532w6toP+tWBLi/cBA7cCZHyYE9YkSW+v1s6fLDqtxfxhc8kVe3b KEFH6JijR36FGuZOpo+v0KJVhHsWghAdfvCYpI4= X-Received: by 2002:a05:651c:1068:: with SMTP id y8mr9567821ljm.76.1608648145923; Tue, 22 Dec 2020 06:42:25 -0800 (PST) MIME-Version: 1.0 References: <20201221162519.GA22504@open-light-1.localdomain> <20201222122312.GH874@casper.infradead.org> In-Reply-To: <20201222122312.GH874@casper.infradead.org> From: Liang Li Date: Tue, 22 Dec 2020 22:42:13 +0800 Message-ID: Subject: Re: [RFC v2 PATCH 0/4] speed up page allocation for __GFP_ZERO To: Matthew Wilcox Cc: Alexander Duyck , Mel Gorman , Andrew Morton , Andrea Arcangeli , Dan Williams , "Michael S. Tsirkin" , David Hildenbrand , Jason Wang , Dave Hansen , Michal Hocko , Liang Li , linux-mm@kvack.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > QEMU use 4K pages, THP is off > > round1 round2 round3 > > w/o this patch: 23.5s 24.7s 24.6s > > w/ this patch: 10.2s 10.3s 11.2s > > > > QEMU use 4K pages, THP is on > > round1 round2 round3 > > w/o this patch: 17.9s 14.8s 14.9s > > w/ this patch: 1.9s 1.8s 1.9s > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > The cost of zeroing pages has to be paid somewhere. You've successfully > moved it out of this path that you can measure. So now you've put it > somewhere that you're not measuring. Why is this a win? Win or not depends on its effect. For our case, it solves the issue that we faced, so it can be thought as a win for us. If others don't have the issue we faced, the result will be different, maybe they will be affected by the side effect of this feature. I think this is your concern behind the question. right? I will try to do more tests and provide more benchmark performance data. > > Speed up kernel routine > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > This can=E2=80=99t be guaranteed because we don=E2=80=99t pre zero out = all the free pages, > > but is true for most case. It can help to speed up some important syste= m > > call just like fork, which will allocate zero pages for building page > > table. And speed up the process of page fault, especially for huge page > > fault. The POC of Hugetlb free page pre zero out has been done. > > Try kernbench with and without your patch. OK. Thanks for your suggestion! Liang