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=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, 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 EEC28C2BB85 for ; Sun, 12 Apr 2020 10:12:32 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AF80120709 for ; Sun, 12 Apr 2020 10:12:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="E/y/4XcD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AF80120709 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 368338E00CD; Sun, 12 Apr 2020 06:12:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 33E638E0007; Sun, 12 Apr 2020 06:12:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2552C8E00CD; Sun, 12 Apr 2020 06:12:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0235.hostedemail.com [216.40.44.235]) by kanga.kvack.org (Postfix) with ESMTP id 0C5158E0007 for ; Sun, 12 Apr 2020 06:12:32 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id A646B5DEB for ; Sun, 12 Apr 2020 10:12:31 +0000 (UTC) X-FDA: 76698788502.06.band12_3323607851931 X-HE-Tag: band12_3323607851931 X-Filterd-Recvd-Size: 2860 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf24.hostedemail.com (Postfix) with ESMTP for ; Sun, 12 Apr 2020 10:12:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:To:From:Date:Sender:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description; bh=IeLMEVbvWVML8LPWQwzHP2rI+YsS4LJFQqPobAoE0tQ=; b=E/y/4XcDknSVI1zx7tOO8lIIH1 tl+TJApQwjBaxjL9NVH82By12JnXxz1NeXwbGJgfGWRqbY9GqCGHl/VPjaHWEhBs/gwpdJshy8skB UG/rF9MyMoCncohfY5JBnVgKdViPNk09ol9DW9H00aEfGgKiMdelCVE7zFrERgTQ22s1c4du6XB5k Ahn0YXtnOnEc3a6PtATx/zbeseBzE+o/sd824d8rvTKdifPsE9qc+1tg7YmbyCCbpWqRU0LSQnj9V JE3uSTNRYbnnO+l1LpGY6lBx/PDxtxsBSRNwRz45iuqpaCHr3jsXRM6aanKaLVf7ddBrSMYlElgyK Uhu7b25g==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jNZbD-0002RV-Uv; Sun, 12 Apr 2020 10:12:23 +0000 Date: Sun, 12 Apr 2020 03:12:23 -0700 From: Matthew Wilcox To: Alexander Duyck , Mel Gorman , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrea Arcangeli , Dan Williams , Dave Hansen , David Hildenbrand , Michal Hocko , Andrew Morton , Alex Williamson Subject: Re: [RFC PATCH 4/4] mm: Add PG_zero support Message-ID: <20200412101223.GK21484@bombadil.infradead.org> References: <20200412090945.GA19582@open-light-1.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200412090945.GA19582@open-light-1.localdomain> 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 Sun, Apr 12, 2020 at 05:09:49AM -0400, liliangleo wrote: > Zero out the page content usually happens when allocating pages, > this is a time consuming operation, it makes pin and mlock > operation very slowly, especially for a large batch of memory. > > This patch introduce a new feature for zero out pages before page > allocation, it can help to speed up page allocation. > > The idea is very simple, zero out free pages when the system is > not busy and mark the page with PG_zero, when allocating a page, > if the page need to be filled with zero, check the flag in the > struct page, if it's marked as PG_zero, zero out can be skipped, > it can save cpu time and speed up page allocation. We are very short on bits in the page flags. If we can implement this feature without using another one, this would be good. If the bit is only set on pages which are PageBuddy(), we can definitely find space for it as an alias of another bit.