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.8 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 CF8C9C433DB for ; Thu, 7 Jan 2021 01:50:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 60D612223E for ; Thu, 7 Jan 2021 01:50:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 60D612223E 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 D7FB28D0111; Wed, 6 Jan 2021 20:50:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D31908D0090; Wed, 6 Jan 2021 20:50:51 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C45898D0111; Wed, 6 Jan 2021 20:50:51 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0102.hostedemail.com [216.40.44.102]) by kanga.kvack.org (Postfix) with ESMTP id B0B168D0090 for ; Wed, 6 Jan 2021 20:50:51 -0500 (EST) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 766F1181AEF31 for ; Thu, 7 Jan 2021 01:50:51 +0000 (UTC) X-FDA: 77677300302.04.shape50_3b0cb8e274e6 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin04.hostedemail.com (Postfix) with ESMTP id 5270B8008864 for ; Thu, 7 Jan 2021 01:50:51 +0000 (UTC) X-HE-Tag: shape50_3b0cb8e274e6 X-Filterd-Recvd-Size: 5960 Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) by imf21.hostedemail.com (Postfix) with ESMTP for ; Thu, 7 Jan 2021 01:50:50 +0000 (UTC) Received: by mail-lf1-f46.google.com with SMTP id h22so11112498lfu.2 for ; Wed, 06 Jan 2021 17:50:50 -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; bh=PuS9RFtdF0FSUG+Qus6FJ7bGLYFqsL5wnuYCJEt6Kb0=; b=gBnrY7alv2bsniRlpXrslYlz5zCHsPCg9HVAyMrrsYsO6fa8Fx/JJI2i+Ed2CKM9Hq kwaVRdiWZ6hZerEm7PFP+F3557eBswhDr4tNVlYYBgQVOmTPz6+VXmhmwqrGtJeY3bZn 2zpF1kqD7GFLG7SMhUiMt6e6a47tCVE4G2auXbPYSpzxA15UZDGWHaxubl4cgwl0inpW Mtl0hXyHwAt1yW+4WvA10IDkzf9TzSTQwELoPod/730gf7U/GthD0Jr5TW0Arwufx37v 5iUPS4jb9+FnNz6FmoYduw2j2tuHQRwBRTQg4snwPCLYe5j6rEVHRSPky14EH2EHk8Fz ZNvQ== 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; bh=PuS9RFtdF0FSUG+Qus6FJ7bGLYFqsL5wnuYCJEt6Kb0=; b=LomLUYpo7JrN5ujDf2FN8130w/O91EPDHE47sd6lMEePNMO3BMpjb0zdgcMpF6fl2w 82KWCChKV+y2FVt5UlA59gMxD/F9gUwozooZlbNJ142yNJof+t14W9WFf9Bu4u9/Usss EOash5jKrN9ei5Retj2hkBuSWmc5J7FvOkR8C9zVggfcnyVQsMdiR6pK3xNZoSpofIj5 k1a45W8Q8UsytiBBoZ0wc0Wn7g0YRPSSPsaUlWWWBW0djLVwX3MwsxRpERmqwhmsmQJB GK1Y9+EKTb3lbEt0jxdTDaW5BOpOcBBvAPILgWl/rF9sJzMNDon2QFmIcV/Vux4SqJ0T nRKQ== X-Gm-Message-State: AOAM532dTol9JrpzKgc8fLmoSabuge7zUkBP8ozur1sNeafOLqkJCaXD 0Snm0k3Qx8N2+q3fV5wsKy3kWRNlcgWgUzTQbg4= X-Google-Smtp-Source: ABdhPJw4/jZgVZBc8G/tHe60zJSX2H/7Py1HFEDuWXFYjlClXEGFpq354dcg+/dyXm4CWpJ1P5VMPsd2wXBUjngAhu0= X-Received: by 2002:a19:848f:: with SMTP id g137mr3061829lfd.622.1609984249325; Wed, 06 Jan 2021 17:50:49 -0800 (PST) MIME-Version: 1.0 References: <20210106034623.GA1128@open-light-1.localdomain> In-Reply-To: From: Liang Li Date: Thu, 7 Jan 2021 09:50:35 +0800 Message-ID: Subject: Re: [PATCH 0/6] hugetlbfs: support free page reporting To: David Hildenbrand Cc: Alexander Duyck , Mel Gorman , Andrew Morton , Andrea Arcangeli , Dan Williams , "Michael S. Tsirkin" , Jason Wang , Dave Hansen , Michal Hocko , Liang Li , Mike Kravetz , linux-mm , LKML , virtualization@lists.linux-foundation.org Content-Type: text/plain; charset="UTF-8" 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, Jan 6, 2021 at 5:41 PM David Hildenbrand wrote: > > On 06.01.21 04:46, Liang Li wrote: > > A typical usage of hugetlbfs it's to reserve amount of memory > > during the kernel booting stage, and the reserved pages are > > unlikely to return to the buddy system. When application need > > hugepages, kernel will allocate them from the reserved pool. > > when application terminates, huge pages will return to the > > reserved pool and are kept in the free list for hugetlbfs, > > these free pages will not return to buddy freelist unless the > > size of reserved pool is changed. > > Free page reporting only supports buddy pages, it can't report > > the free pages reserved for hugetlbfs. On the other hand, > > hugetlbfs is a good choice for system with a huge amount of RAM, > > because it can help to reduce the memory management overhead and > > improve system performance. > > This patch add the support for reporting hugepages in the free > > list of hugetlbfs, it can be used by virtio_balloon driver for > > memory overcommit and pre zero out free pages for speeding up > > memory population and page fault handling. > > You should lay out the use case + measurements. Further you should > describe what this patch set actually does, how behavior can be tuned, > pros and cons, etc... And you should most probably keep this RFC. > > > > > Most of the code are 'copied' from free page reporting because > > they are working in the same way. So the code can be refined to > > remove duplication. It can be done later. > > Nothing speaks about getting it right from the beginning. Otherwise it > will most likely never happen. > > > > > Since some guys have some concern about side effect of the 'buddy > > free page pre zero out' feature brings, I remove it from this > > serier. > > You should really point out what changed size the last version. I > remember Alex and Mike had some pretty solid points of what they don't > want to see (especially: don't use free page reporting infrastructure > and don't temporarily allocate huge pages for processing them). > > I am not convinced that we want to use the free page reporting > infrastructure for this (pre-zeroing huge pages). What speaks about a > thread simply iterating over huge pages one at a time, zeroing them? The > whole free page reporting infrastructure was invented because we have to > do expensive coordination (+ locking) when going via the hypervisor. For > the main use case of zeroing huge pages in the background, I don't see a > real need for that. If you believe this is the right thing to do, please > add a discussion regarding this. > > -- > Thanks, > > David / dhildenb > > I will take all your advice and give more detail in the next revision, Thanks for your comments! Liang