From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S948093AbdDTXhC (ORCPT ); Thu, 20 Apr 2017 19:37:02 -0400 Received: from mga07.intel.com ([134.134.136.100]:27113 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S947895AbdDTXhA (ORCPT ); Thu, 20 Apr 2017 19:37:00 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,227,1488873600"; d="scan'208";a="79363269" From: Andi Kleen To: Laurent Dufour Cc: linux-mm@kvack.org, Davidlohr Bueso , akpm@linux-foundation.org, Jan Kara , "Kirill A . Shutemov" , Michal Hocko , Peter Zijlstra , Mel Gorman , haren@linux.vnet.ibm.com, aneesh.kumar@linux.vnet.ibm.com, khandual@linux.vnet.ibm.com, Paul.McKenney@us.ibm.com, linux-kernel@vger.kernel.org Subject: Re: [RFC 4/4] Change mmap_sem to range lock References: <1492698500-24219-1-git-send-email-ldufour@linux.vnet.ibm.com> Date: Thu, 20 Apr 2017 16:36:57 -0700 In-Reply-To: <1492698500-24219-1-git-send-email-ldufour@linux.vnet.ibm.com> (Laurent Dufour's message of "Thu, 20 Apr 2017 16:28:20 +0200") Message-ID: <8737d2d52e.fsf@firstfloor.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Laurent Dufour writes: > [resent this patch which seems to have not reached the mailing lists] > > Change the mmap_sem to a range lock to allow finer grain locking on > the memory layout of a task. > > This patch rename mmap_sem into mmap_rw_tree to avoid confusion and > replace any locking (read or write) by complete range locking. So > there is no functional change except in the way the underlying locking > is achieved. > > Currently, this patch only supports x86 and PowerPc architectures, > furthermore it should break the build of any others. Thanks for working on this. However as commented before I think the first step to make progress here is a description of everything mmap_sem protects. Surely the init full case could be done shorter with some wrapper that combines the init_full and lock operation? Then it would be likely a simple search'n'replace to move the whole tree in one atomic step to the new wrappers. Initially they could be just defined to use rwsems too to not change anything at all. It would be a good idea to merge such a patch as quickly as possible beause it will be a nightmare to maintain longer term. Then you could add a config to use a range lock through the wrappers. Then after that you could add real ranges step by step, after doing the proper analysis. -Andi