From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756218AbdJPR4s (ORCPT ); Mon, 16 Oct 2017 13:56:48 -0400 Received: from resqmta-po-12v.sys.comcast.net ([96.114.154.171]:47164 "EHLO resqmta-po-12v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753040AbdJPR4q (ORCPT ); Mon, 16 Oct 2017 13:56:46 -0400 Date: Mon, 16 Oct 2017 12:56:43 -0500 (CDT) From: Christopher Lameter X-X-Sender: cl@nuc-kabylake To: Michal Hocko cc: Guy Shattah , Mike Kravetz , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Marek Szyprowski , Michal Nazarewicz , "Aneesh Kumar K . V" , Joonsoo Kim , Anshuman Khandual , Laura Abbott , Vlastimil Babka Subject: Re: [RFC PATCH 3/3] mm/map_contig: Add mmap(MAP_CONTIG) support In-Reply-To: <20171016174229.pz3o4uhzz3qbrp6n@dhcp22.suse.cz> Message-ID: References: <20171013152801.nbpk6nluotgbmfrs@dhcp22.suse.cz> <20171013154747.2jv7rtfqyyagiodn@dhcp22.suse.cz> <20171013161736.htumyr4cskfrjq64@dhcp22.suse.cz> <752b49eb-55c6-5a34-ab41-6e91dd93ea70@mellanox.com> <20171016082456.no6ux63uy2rmj4fe@dhcp22.suse.cz> <0e238c56-c59d-f648-95fc-c8cb56c3652e@mellanox.com> <20171016123248.csntl6luxgafst6q@dhcp22.suse.cz> <20171016174229.pz3o4uhzz3qbrp6n@dhcp22.suse.cz> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-CMAE-Envelope: MS4wfAUaXEcvx9a0CvrDMQ4QzU95Wz3gRt0mxtPa+fksgFCQpiYShx9uAswcdedp8bcJr9WFbnkGu7k+Pf/fXrI4zB9XtvBX1MBJacVRqHJiGhyxnrsKF588 xoW5IvyWcIZkS/YOcRHpNCDIqZC8qw1dgolw92x78uHdDqvsUlJ2e95+Ks5tczo/0Wa9EJ4fSxxaBsVAv3ah//rhTHu9n6G246LV3il5C1XYQzAkyr226kY3 3Pn4/6lIbvebTAEvYfenjbUvL1nmwFzUBh9B+jHW94j8WxRn5t+rwEV64+enP7g9CTPHdwCoLrdYfr2GfhYAvhyIH0DIOZ1FFrlbHYQ/6IgyuZdbuMTXBb/U 7oqGwPr212uMyyaTzICXBEa38mUJtNk9TW1eFreDIjbSMslns6XfEQjF88QH0lYgSAlp30whg2Vv/rzOB0fX0e2FDu4/qESg5a8oFMPCryeKOC0FpFyEg2DA UwgoY36MCG84yi5ZOFbp3PfScGcQwgyc9LOEvQUrt4LOvHhou0+Yj0sYlzh8LmkqzqdP7fE4mwOzj2yylwZk5bU2vLIXuTzznWPdLQ== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 16 Oct 2017, Michal Hocko wrote: > > We already have that issue and have ways to control that by tracking > > pinned and mlocked pages as well as limits on their allocations. > > Ohh, it is very different because mlock limit is really small (64kB) > which is not even close to what this is supposed to be about. Moreover > mlock doesn't prevent from migration and so it doesn't prevent > compaction to form higher order allocations. The mlock limit is configurable. There is a tracking of pinned pages as well. > Really, this is just too dangerous without a deep consideration of all > the potential consequences. The more I am thinking about this the more I > am convinced that this all should be driver specific mmap based thing. > If it turns out to be too restrictive over time and there are more > experiences about the usage we can consider thinking about a more > generic API. But starting from the generic MAP_ flag is just asking for > problems. This issue is already present with the pinning of lots of memory via the RDMA API when in use for large gigabyte ranges. There is nothing new aside from memory being contiguous with this approach. > > There is not much new here in terms of problems. The hardware that > > needs this seems to become more and more plentiful. That is why we need a > > generic implementation. > > It would really help to name that HW and other potential usecases > independent on the HW because I am rather skeptical about the > _plentiful_ part. And so I really do not see any foundation to claim > the generic part. Because, fundamentally, it is the HW which requires > the specific memory placement/physically contiguous range etc. So the > generic implementation doesn't really make sense in such a context. RDMA hardware? Storage interfaces? Look at what the RDMA subsystem and storage (NVME?) support. This is not a hardware specific thing but a reflection of the general limitations of the exiting 4k page struct scheme that limits performance and causes severe pressure on I/O devices.