From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f72.google.com (mail-pg0-f72.google.com [74.125.83.72]) by kanga.kvack.org (Postfix) with ESMTP id 116E56B0069 for ; Tue, 3 Jan 2017 00:43:50 -0500 (EST) Received: by mail-pg0-f72.google.com with SMTP id f188so1482496070pgc.1 for ; Mon, 02 Jan 2017 21:43:50 -0800 (PST) Received: from mga03.intel.com (mga03.intel.com. [134.134.136.65]) by mx.google.com with ESMTPS id r197si67750029pfr.213.2017.01.02.21.43.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Jan 2017 21:43:49 -0800 (PST) From: "Huang\, Ying" Subject: Re: [PATCH v4 0/9] mm/swap: Regular page swap optimizations References: <20161227074503.GA10616@bbox> <20170102154841.GG18058@quack2.suse.cz> <20170103043411.GA15657@bbox> Date: Tue, 03 Jan 2017 13:43:43 +0800 In-Reply-To: <20170103043411.GA15657@bbox> (Minchan Kim's message of "Tue, 3 Jan 2017 13:34:11 +0900") Message-ID: <87inpwu29c.fsf@yhuang-dev.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ascii Sender: owner-linux-mm@kvack.org List-ID: To: Minchan Kim Cc: Jan Kara , Tim Chen , Andrew Morton , Ying Huang , dave.hansen@intel.com, ak@linux.intel.com, aaron.lu@intel.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Hugh Dickins , Shaohua Li , Rik van Riel , Andrea Arcangeli , "Kirill A . Shutemov" , Vladimir Davydov , Johannes Weiner , Michal Hocko , Hillf Danton , Christian Borntraeger , Jonathan Corbet , Peter Zijlstra , Nicholas Piggin Hi, Minchan, Minchan Kim writes: > Hi Jan, > > On Mon, Jan 02, 2017 at 04:48:41PM +0100, Jan Kara wrote: >> Hi, >> >> On Tue 27-12-16 16:45:03, Minchan Kim wrote: >> > > Patch 3 splits the swap cache radix tree into 64MB chunks, reducing >> > > the rate that we have to contende for the radix tree. >> > >> > To me, it's rather hacky. I think it might be common problem for page cache >> > so can we think another generalized way like range_lock? Ccing Jan. >> >> I agree on the hackyness of the patch and that page cache would suffer with >> the same contention (although the files are usually smaller than swap so it >> would not be that visible I guess). But I don't see how range lock would >> help here - we need to serialize modifications of the tree structure itself >> and that is difficult to achieve with the range lock. So what you would >> need is either a different data structure for tracking swap cache entries >> or a finer grained locking of the radix tree. > > Thanks for the comment, Jan. > > I think there are more general options. One is to shrink batching pages like > Mel and Tim had approached. > > https://patchwork.kernel.org/patch/9008421/ > https://patchwork.kernel.org/patch/9322793/ This helps to reduce the lock contention on radix tree of swap cache. But splitting swap cache has much better performance. So we switched from that solution to current solution. > Or concurrent page cache by peter. > > https://www.kernel.org/doc/ols/2007/ols2007v2-pages-311-318.pdf I think this is good, it helps swap and file cache. But I don't know whether other people want to go this way and how much effort will be needed. In contrast, splitting swap cache is quite simple, for implementation and review. And the effect is good. Best Regards, Huang, Ying > Ccing Nick who might have an interest on lockless page cache. > > Thanks. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org