From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751767AbdKBEW2 (ORCPT ); Thu, 2 Nov 2017 00:22:28 -0400 Received: from LGEAMRELO13.lge.com ([156.147.23.53]:41953 "EHLO lgeamrelo13.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751321AbdKBEW1 (ORCPT ); Thu, 2 Nov 2017 00:22:27 -0400 X-Original-SENDERIP: 156.147.1.151 X-Original-MAILFROM: minchan@kernel.org X-Original-SENDERIP: 10.177.220.163 X-Original-MAILFROM: minchan@kernel.org Date: Thu, 2 Nov 2017 13:22:23 +0900 From: Minchan Kim To: zhouxianrong Cc: "Huang, Ying" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , "akpm@linux-foundation.org" , "tim.c.chen@linux.intel.com" , "mhocko@suse.com" , "rientjes@google.com" , "mingo@kernel.org" , "vegard.nossum@oracle.com" , "aaron.lu@intel.com" , Zhouxiyu , "Duwei (Device OS)" , fanghua , hutj , Won Ho Park Subject: Re: =?utf-8?B?562U5aSNOiBbUEFUQ0g=?= =?utf-8?Q?=5D?= mm: extend reuse_swap_page range as much as possible Message-ID: <20171102042223.GA26523@bbox> References: <1509533474-98584-1-git-send-email-zhouxianrong@huawei.com> <87tvyd4fsx.fsf@yhuang-dev.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 02, 2017 at 02:09:57AM +0000, zhouxianrong wrote: > writes: > > > From: zhouxianrong > > > > origanlly reuse_swap_page requires that the sum of page's mapcount and > > swapcount less than or equal to one. > > in this case we can reuse this page and avoid COW currently. > > > > now reuse_swap_page requires only that page's mapcount less than or > > equal to one and the page is not dirty in swap cache. in this case we > > do not care its swap count. > > > > the page without dirty in swap cache means that it has been written to > > swap device successfully for reclaim before and then read again on a > > swap fault. in this case the page can be reused even though its swap > > count is greater than one and postpone the COW on other successive > > accesses to the swap cache page later rather than now. > > > > i did this patch test in kernel 4.4.23 with arm64 and none huge > > memory. it work fine. > > Why do you need this? You saved copying one page from memory to memory > (COW) now, at the cost of reading a page from disk to memory later? > > yes, accessing later does not always happen, there is probability for it, so postpone COW now. So, it's trade-off. It means we need some number with some scenarios to prove it's better than as-is. It would help to drive reviewers/maintainer. Thanks.