From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760917AbbA3KB3 (ORCPT ); Fri, 30 Jan 2015 05:01:29 -0500 Received: from mta-out1.inet.fi ([62.71.2.203]:40418 "EHLO jenni2.inet.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754008AbbA3KB0 (ORCPT ); Fri, 30 Jan 2015 05:01:26 -0500 Date: Fri, 30 Jan 2015 11:58:07 +0200 From: "Kirill A. Shutemov" To: Ebru Akagunduz Cc: linux-mm@kvack.org, akpm@linux-foundation.org, mhocko@suse.cz, mgorman@suse.de, rientjes@google.com, sasha.levin@oracle.com, hughd@google.com, hannes@cmpxchg.org, vbabka@suse.cz, linux-kernel@vger.kernel.org, riel@redhat.com, aarcange@redhat.com, zhangyanfei.linux@aliyun.com Subject: Re: [PATCH v4] mm: incorporate read-only pages into transparent huge pages Message-ID: <20150130095807.GA27412@node.dhcp.inet.fi> References: <1422543547-12591-1-git-send-email-ebru.akagunduz@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1422543547-12591-1-git-send-email-ebru.akagunduz@gmail.com> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 29, 2015 at 04:59:07PM +0200, Ebru Akagunduz wrote: > This patch aims to improve THP collapse rates, by allowing > THP collapse in the presence of read-only ptes, like those > left in place by do_swap_page after a read fault. > > 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 applies the same limit for > read-only ptes. > > The patch was tested with a test program that allocates > 800MB of memory, writes to it, and then sleeps. I force > the system to swap out all but 190MB of the program by > touching other memory. Afterwards, the test program does > a mix of reads and writes to its memory, and the memory > gets swapped back in. > > Without the patch, only the memory that did not get > swapped out remained in THPs, which corresponds to 24% of > the memory of the program. The percentage did not increase > over time. > > With this patch, after 5 minutes of waiting khugepaged had > collapsed 60% of the program's memory back into THPs. > > Signed-off-by: Ebru Akagunduz > Signed-off-by: Ebru Akagunduz > Reviewed-by: Rik van Riel > Acked-by: Vlastimil Babka > Acked-by: Zhang Yanfei Acked-by: Kirill A. Shutemov -- Kirill A. Shutemov