From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932954AbdABPsx (ORCPT ); Mon, 2 Jan 2017 10:48:53 -0500 Received: from mx2.suse.de ([195.135.220.15]:51815 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932589AbdABPsw (ORCPT ); Mon, 2 Jan 2017 10:48:52 -0500 Date: Mon, 2 Jan 2017 16:48:41 +0100 From: Jan Kara To: Minchan Kim Cc: 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 , jack@suse.cz Subject: Re: [PATCH v4 0/9] mm/swap: Regular page swap optimizations Message-ID: <20170102154841.GG18058@quack2.suse.cz> References: <20161227074503.GA10616@bbox> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161227074503.GA10616@bbox> 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 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. Honza -- Jan Kara SUSE Labs, CR