Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757246AbcDGRlQ (ORCPT ); Thu, 7 Apr 2016 13:41:16 -0400 Received: from mga02.intel.com ([134.134.136.20]:19547 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756645AbcDGRlP convert rfc822-to-8bit (ORCPT ); Thu, 7 Apr 2016 13:41:15 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,449,1455004800"; d="scan'208";a="682532184" Date: Thu, 7 Apr 2016 13:41:11 -0400 From: Matthew Wilcox To: Toshi Kani Cc: mingo@kernel.org, bp@suse.de, hpa@zytor.com, tglx@linutronix.de, dan.j.williams@intel.com, kirill.shutemov@linux.intel.com, linux-mm@kvack.org, x86@kernel.org, linux-nvdimm@ml01.01.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86 get_unmapped_area: Add PMD alignment for DAX PMD mmap Message-ID: <20160407174111.GG2781@linux.intel.com> References: <1459951089-14911-1-git-send-email-toshi.kani@hpe.com> <20160406165027.GA2781@linux.intel.com> <1459964672.20338.41.camel@hpe.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1459964672.20338.41.camel@hpe.com> User-Agent: Mutt/1.5.24 (2015-08-30) Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1295 Lines: 26 On Wed, Apr 06, 2016 at 11:44:32AM -0600, Toshi Kani wrote: > > The NVML chooses appropriate addresses and gets a properly aligned > > address without any kernel code. > > An application like NVML can continue to specify a specific address to > mmap(). ?Most existing applications, however, do not specify an address to > mmap(). ?With this patch, specifying an address will remain optional. The point is that this *can* be done in userspace. You need to sell us on the advantages of doing it in the kernel. > > I think this is the wrong place for it, if we decide that this is the > > right thing to do.??The filesystem has a get_unmapped_area() which > > should be used instead. > > Yes, I considered adding a filesystem entry point, but decided going this > way because: > ?-?arch_get_unmapped_area() and?arch_get_unmapped_area_topdown() are arch- > specific code. ?Therefore, this filesystem entry point will need arch- > specific implementation.? > ?- There is nothing filesystem specific about requesting PMD alignment. See http://article.gmane.org/gmane.linux.kernel.mm/149227 for Hugh's approach for shmem. I strongly believe that if we're going to do this i the kernel, we should build on this approach, and not hack something into each architecture's generic get_unmapped_area.