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=-2.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 7F275C433DB for ; Tue, 22 Dec 2020 14:42:29 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 15788221FC for ; Tue, 22 Dec 2020 14:42:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 15788221FC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 6D08F6B0098; Tue, 22 Dec 2020 09:42:28 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 67D996B00AA; Tue, 22 Dec 2020 09:42:28 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 56CE86B00AB; Tue, 22 Dec 2020 09:42:28 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0186.hostedemail.com [216.40.44.186]) by kanga.kvack.org (Postfix) with ESMTP id 3EDAC6B0098 for ; Tue, 22 Dec 2020 09:42:28 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id E99528249980 for ; Tue, 22 Dec 2020 14:42:27 +0000 (UTC) X-FDA: 77621183934.01.jam09_3213fcd27460 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin01.hostedemail.com (Postfix) with ESMTP id C5DF71004D016 for ; Tue, 22 Dec 2020 14:42:27 +0000 (UTC) X-HE-Tag: jam09_3213fcd27460 X-Filterd-Recvd-Size: 5131 Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) by imf07.hostedemail.com (Postfix) with ESMTP for ; Tue, 22 Dec 2020 14:42:27 +0000 (UTC) Received: by mail-lf1-f43.google.com with SMTP id b26so23000815lff.9 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=JDXTuV3hl4kDznmJveFi9PdXnehVkSZKKemo6ER5wXu/XFzg6QkGmnj3vMzKBH3Atd LNVCNsy0Nj/AOMCpSp9zOXZxmU5xOm9waCxJ7znV6vyqRr7r8TZcHoVKphwnsC2+UPPG 3v5wPf8/zDwQrYQs0rCP4xJgCoGyQyGagG3LG71SZYqPG/guUcfgM9AvWPosMm1g9ynd IW2qpgdLSzPIsPulMABDeLd6dQuKbNibD4S9dtwqupoapwbaKfgBM0g7Cu42SKPafZkV IiiP6Fs3tJRFDf7VpVIjvowl4I7wGwJuPf5LFYZRHf6eLUz/F17IaRvyHQCZAPl2Zxdr LERA== X-Gm-Message-State: AOAM531wCVSUomnmwDXMjzltjwJGqPRUtwlwDlKmCRjHGARMq3AM1G9d YFt16z1EcWYIgnj/Shlq+dGBeL4823kGQtlhvJM= X-Google-Smtp-Source: ABdhPJxqqF6DeEfobHr4FNiEpBMxW4vxPKWsWcJjyGcXFw9khzRdoSAi//pN1D6khHbWpS/nxbl3E2oiIBNjy+9urAU= 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 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: > > =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