Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2325053ybb; Sun, 12 Apr 2020 03:13:26 -0700 (PDT) X-Google-Smtp-Source: APiQypJ708t0EBf/I49xTUUwR9l0JB/i5h6i6urW4kRhEghxhfLXkOu+M7Wp1xSkXPXRaquSLkv3 X-Received: by 2002:a37:a650:: with SMTP id p77mr11216742qke.342.1586686406200; Sun, 12 Apr 2020 03:13:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586686406; cv=none; d=google.com; s=arc-20160816; b=Gk4FsMelmxfDrjP3F47nQao/N9k8p8Y3rfcBNfkFEIrPp3YqRqE0l+2jZywtwoWhSB ZmtGL5YA6ZRiVggIo+4up8WC3nzaPnLXZb3ohFh3Dz8MCHYIOj5z0eWhGDVGq3DRoKN1 W0jBBnafJXZ6CCML3gwO9HqlhRL2pCcYy6KLqLDYXJ1Hupbx+xAWsHHt8PLV2xWyFh5l 23f1OwDF33O+g6nasPzYR8bJmqZbj95sTmcDyoo45NWyPdgbbSvOUnzA3O+9eBzJT19j UFG1gk9qFwudTjFX9LBTv86Z5jCEPzHLp6yuKndGJ25F8p147N1kyB85C/UK7FGgsr3e V+kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:to:from:date :dkim-signature; bh=IeLMEVbvWVML8LPWQwzHP2rI+YsS4LJFQqPobAoE0tQ=; b=WrJ6tfIfWkn15Lr3j1TPKS8LqzNRLp05sFvvpz0G+m6Opj+a12Rsr9armxW+/HUKtU CdpUzAvQdyrILMF4VExrlIU3WwZlfJcfxbWtHDUwZjkIudsOreDBBuVIt5zrgUVc/llV duZVR+ykkn9hEk2FRSTvbyhQqdmnEaFRJ/5+vnM4hVMwDEjhoqyzEf+g3B3lh54BES4o u0c/7F6zu4EzqmmsuLa8xwQmXyPum35aa4HAZgZZciLCJnw+aXjTWM/L/mLiPefv+nQG gu+aCJmGqcEKTQwveda+DjsZ3geB9qdKgXtSHRAZDp3azM7G7/YvTlZXukoCL+9j8AcF i9TA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="E/y/4XcD"; 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 c19si3272700qtg.376.2020.04.12.03.13.12; Sun, 12 Apr 2020 03:13:26 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="E/y/4XcD"; 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 S1726932AbgDLKM3 (ORCPT + 99 others); Sun, 12 Apr 2020 06:12:29 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:45750 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725909AbgDLKM2 (ORCPT ); Sun, 12 Apr 2020 06:12:28 -0400 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.