Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932509AbbBPLuW (ORCPT ); Mon, 16 Feb 2015 06:50:22 -0500 Received: from cantor2.suse.de ([195.135.220.15]:36446 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932388AbbBPLuU (ORCPT ); Mon, 16 Feb 2015 06:50:20 -0500 Message-ID: <54E1D977.30004@suse.cz> Date: Mon, 16 Feb 2015 12:50:15 +0100 From: Vlastimil Babka User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Ebru Akagunduz , linux-mm@kvack.org CC: akpm@linux-foundation.org, kirill@shutemov.name, mhocko@suse.cz, mgorman@suse.de, rientjes@google.com, sasha.levin@oracle.com, hughd@google.com, hannes@cmpxchg.org, linux-kernel@vger.kernel.org, riel@redhat.com, aarcange@redhat.com Subject: Re: [PATCH v2] mm: incorporate zero pages into transparent huge pages References: <1423688635-4306-1-git-send-email-ebru.akagunduz@gmail.com> In-Reply-To: <1423688635-4306-1-git-send-email-ebru.akagunduz@gmail.com> Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1325 Lines: 33 On 02/11/2015 10:03 PM, Ebru Akagunduz wrote: > This patch improves THP collapse rates, by allowing zero pages. > > Currently THP can collapse 4kB pages into a THP when there > are up to khugepaged_max_ptes_none pte_none ptes in a 2MB > range. This patch counts pte none and mapped zero pages > with the same variable. > > The patch was tested with a program that allocates 800MB of > memory, and performs interleaved reads and writes, in a pattern > that causes some 2MB areas to first see read accesses, resulting > in the zero pfn being mapped there. > > To simulate memory fragmentation at allocation time, I modified > do_huge_pmd_anonymous_page to return VM_FAULT_FALLBACK for read > faults. > > Without the patch, only %50 of the program was collapsed into > THP and the percentage did not increase over time. > > With this patch after 10 minutes of waiting khugepaged had > collapsed %99 of the program's memory. > > Signed-off-by: Ebru Akagunduz > Reviewed-by: Rik van Riel Acked-by: Vlastimil Babka -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/