From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933847AbdACEec (ORCPT ); Mon, 2 Jan 2017 23:34:32 -0500 Received: from LGEAMRELO12.lge.com ([156.147.23.52]:50738 "EHLO lgeamrelo12.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756140AbdACEe0 (ORCPT ); Mon, 2 Jan 2017 23:34:26 -0500 X-Original-SENDERIP: 156.147.1.126 X-Original-MAILFROM: minchan@kernel.org X-Original-SENDERIP: 165.244.249.25 X-Original-MAILFROM: minchan@kernel.org X-Original-SENDERIP: 10.177.223.161 X-Original-MAILFROM: minchan@kernel.org Date: Tue, 3 Jan 2017 13:34:11 +0900 From: Minchan Kim To: Jan Kara CC: Tim Chen , Andrew Morton , Ying Huang , , , , , , 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 Subject: Re: [PATCH v4 0/9] mm/swap: Regular page swap optimizations Message-ID: <20170103043411.GA15657@bbox> References: <20161227074503.GA10616@bbox> <20170102154841.GG18058@quack2.suse.cz> MIME-Version: 1.0 In-Reply-To: <20170102154841.GG18058@quack2.suse.cz> User-Agent: Mutt/1.5.24 (2015-08-30) X-MIMETrack: Itemize by SMTP Server on LGEKRMHUB08/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2017/01/03 13:34:17, Serialize by Router on LGEKRMHUB08/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2017/01/03 13:34:17, Serialize complete at 2017/01/03 13:34:17 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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/ Or concurrent page cache by peter. https://www.kernel.org/doc/ols/2007/ols2007v2-pages-311-318.pdf Ccing Nick who might have an interest on lockless page cache. Thanks.